Book a Demo

Author Topic: Data Modeling Question  (Read 3986 times)

newGuy

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Data Modeling Question
« on: November 04, 2005, 01:48:27 pm »
Greetings.

A bit o' background (aka, a plea for mercy):
I am entirely self-taught in OOP, and now recently UML 2.0 (actually the ICONIX method of using UML 2.0).

I have recently purchased EA to (i) clarify my ideas for a new product; and (ii) effectively communicate these ideas to experienced OOP-ers that will eventually be helping me bring this idea to life.

I am trying to model a linguistic database that I have developed, and herein lies my question.

What is the (or "a") correct way of modeling in EA a table wherein the possible values for a column can only be from within the results of a sql query involving other tables?

I started doing this by defining a "check" operation using the <<check>> stereotype under the class's General tab

    <<check>>CHK_QueryName(char)

and then in the Initial Code window under the Behavior tab supplying the query

  = SELECT blah FROM blah WHERE blah

and then in the Column tab simply selecting the colum to which this "query constraint" applies.

I just wanna make sure this is right before I get too far along, because I have ALOT of tables like this that I need to model.

Thanx Ladies and Gents for any kind help!
« Last Edit: November 04, 2005, 04:29:42 pm by newGuy »

thomaskilian

  • Guest
Re: Data Modeling Question
« Reply #1 on: November 05, 2005, 11:16:58 pm »
Hi newGuy,
this seems to me a bit far off :-/ Access to your tables is normally granted via specific access classes. Both, your tables and your access class, can be derived from a logical class model (your domain model). This can be done in EA using transformation templates. There are several way to really implement what you want (depends on the needs).

Bruno.Cossi

  • EA User
  • **
  • Posts: 803
  • Karma: +0/-0
    • View Profile
Re: Data Modeling Question
« Reply #2 on: November 06, 2005, 01:55:53 am »
Hi,

my 2 cents: newGuy, using the <<check>> is not a bad way to go, you may also want to look into creating a constraint on the column, which may be a bit more transparent.

Hope this helps!
Bruno
« Last Edit: November 06, 2005, 02:01:53 am by Bruno.Cossi »

newGuy

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Data Modeling Question
« Reply #3 on: November 13, 2005, 01:08:55 pm »
Thanks for the posts and the direct emails I got.

After a bit of reserach at safari.oreilly.com, I found a way to do it in EA:

What I was describing was an AFTER Trigger (duh!).  And lo, EA has a <<trigger>> stereotype (double duh!).

According the the directions in Help, I name and define an Operation in the Table Properties.  I put the SQL code in the "Notes" section.  It is a simple matter of assigning the tables to which the trigger applies in the "Columns" tab of the Operations dialog box.

Thanks again for the support.  Hope this helps any fellow newGuys out there!

mikewhit

  • EA User
  • **
  • Posts: 608
  • Karma: +0/-0
  • Accessing ....
    • View Profile
Re: Data Modeling Question
« Reply #4 on: November 14, 2005, 08:23:40 am »
Good on you, summarising the answer to your question for future readers/seekers after truth !