Book a Demo

Author Topic: Relationship between data and class models  (Read 3670 times)

jramosd

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Relationship between data and class models
« on: October 14, 2002, 08:35:27 am »
Hi,

I have made up my data and class models, and I would like to express, for persistent classes, the mapping between class attributes and database tables/columns. I am not sure how to do this... can anyone help?


jaimeglz

  • EA User
  • **
  • Posts: 164
  • Karma: +0/-0
    • View Profile
Re: Relationship between data and class models
« Reply #1 on: October 15, 2002, 08:02:17 am »
Hi J,

Do you have one model for classes and another for persistent data or tables?   For example: do you have a class for user in one model or diagram, and a table t_user in another model/diagram?

Jaime

jramosd

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
  • I love YaBB 1 Gold!
    • View Profile
Re: Relationship between data and class models
« Reply #2 on: October 15, 2002, 08:11:10 am »
Yes, I have separate class model and db table models. I am now playing with the relatinship matrix, which I think is the solution. Any more ideas? Thanks in advance...

jaimeglz

  • EA User
  • **
  • Posts: 164
  • Karma: +0/-0
    • View Profile
Re: Relationship between data and class models
« Reply #3 on: October 15, 2002, 09:45:01 am »
The matrix is a good solution. However, if you want to make the relationship more graphical, you have three additional possibilities, all of which are complementary to the matrix:

1. Create a generalization relationship in a diagram (either in an existing diagram, or in new one, depending on cluttering) between the db table and the analysis class. To be more precise, the table should inherit from the analysis class.

2. Create a realization relationship between them, in which the table is the realization of the analysis class.

3. Create a dependency relationship.

I preffer the inheritance relationship, since it is the most complete.

Realization seems to be the most intuitive, but let me quote Rumbaugh and his amigos' UML Reference on the definition of realization: "an indication of the inheritance of behavior without the inheritance of structure" (p. 405). So, realization would look nice, but it does not express the complete relationship between analysis classes and tables.

Dependency is a very "safe" relationship, but it is probably far too weak to express the relationship between analysis classes and tables.

I know that I am giving a little bit of overhead info on this, but I hope you find it useful.

Jaime