Sparx Systems Forum

Discussion => General Board => Topic started by: UrquanMaster on September 25, 2010, 02:17:01 am

Title: Relation between a Data Model and a Code Model
Post by: UrquanMaster on September 25, 2010, 02:17:01 am
Hello,

I'm looking for a way to represent the relation between a database (SQL tables) and their entities under C++.

I can build a data model, and i can build code model, but i'm lost has to put their respective relationship.

Another problem i face is that some entity may be combinaison of more then one table or some fields may be of a complex type (ex: 2 columns for one property).

Is there a way in EA to display clearly the relation between tables and their respective object representation (a la ORM).

Thank you in advance.
Title: Re: Relation between a Data Model and a Code Model
Post by: Geert Bellekens on September 27, 2010, 03:14:50 pm
According to MDA both your C++ classes and your Database tables are part of their own PSM.
The theory states that you should have a PIM that is the source for both PSM's.
This would mean that you transform each PIM entity into (one or more) C++ class(es) and DB table(s).
You could then create a trace relation between the PSM entities and the C++ entities.

If all of this is too much overhead I suggest you create trace relations between the C++ classes and db tables directly.

I'm afraid this will be a manual process, I don't think EA will create the relations for you.

Geert