Book a Demo

Author Topic: From Data to Logical Model  (Read 3689 times)

janigorse

  • EA Novice
  • *
  • Posts: 6
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
From Data to Logical Model
« on: September 06, 2005, 10:50:24 am »
Hello!

I imported database model with Database -> Import DB Schema from ODBC. Great. Now I want to generate Logical Model of this Data Model. Is this possible? I could transform Data Model to C# model, but the result was Data Model (again) with classes with stereotype "table". When I want to generate C# class code, I could only generate DDL files.
What I'm doing wrong?

Please help...

thomaskilian

  • Guest
Re: From Data to Logical Model
« Reply #1 on: September 06, 2005, 11:16:38 pm »
You have to modify the template to your needs. It's not too hard, but certainly you'll need a few days.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: From Data to Logical Model
« Reply #2 on: September 07, 2005, 03:28:54 pm »
A good start would be to modify the C# transformation templates so that a stereotype of table is never generated.  Something like the following would probably do the job.  (I'm only showing the relevant part of the Class template.

Code: [Select]
 %TRANSFORM_REFERENCE("Class")%
 %TRANSFORM_CURRENT("language","stereotype")%
 language="C#"
%if classStereotype != "table"%
 stereotype=%qt%%classStereotype%%qt%
%endIf%

Simon

mark.myers

  • EA User
  • **
  • Posts: 97
  • Karma: +0/-0
    • View Profile
Re: From Data to Logical Model
« Reply #3 on: January 09, 2007, 02:47:09 pm »
I am doing the same thing at the moment.  It has been very quick and this is my first foray into the templates - nice.  There is one issue I have however.  I would like to remove the primary key and foreign key fields (attributes) from the logical model.  I have a workaround for this which is to add a tagged value for each key field in the DDL model and then endTemaplte the Attribute template if that field is set so no problem other than ging out and manually adding the tagged values.  So my question is is there another way from withing the template to know whether an attribute is a primary or foreign key?  I had a custom template that built up a string of key names in the Class template but couldn't find any way to communicate that down to the Attribute template so it could do a FIND and endTemplate if found.  I could rebuild the list of key names in the Attribute template but that would do it for every attribute and I think it would be too much of a performance hit.
Any ideas?
Cheers, Mark

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: From Data to Logical Model
« Reply #4 on: January 10, 2007, 07:14:00 am »
Check tagged values.
No, you can't have it!

mark.myers

  • EA User
  • **
  • Posts: 97
  • Karma: +0/-0
    • View Profile
Re: From Data to Logical Model
« Reply #5 on: January 10, 2007, 06:39:49 pm »
I already did - nothing there - on either class or attributes.  I had to manually add a tagged value to each FK attribute.
Should there have been something there?  If so, where & what?
Cheers, Mark