Author Topic: Relation between a Data Model and a Code Model  (Read 141 times)


  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Relation between a Data Model and a Code Model
« on: September 25, 2010, 02:17:01 am »

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.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 7968
  • Karma: +180/-21
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Relation between a Data Model and a Code Model
« Reply #1 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.