Author Topic: Association class and DDL  (Read 6784 times)

sgs32r

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Association class and DDL
« on: April 03, 2008, 02:12:00 am »
Hello,

I'm a french newbie and I'm a problem with DDL Transformation.
When I create an association class (A) between two classes (B,C). The DDL transformation create four tables : one table by classes and a table to join B and C.

What is a problem for me, I would like only three table.

Someone would have a solution ?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Association class and DDL
« Reply #1 on: April 03, 2008, 02:18:10 am »
Think about what your association class represents. If there are any possible many-to-many relationships, perhaps the join table is actually doing what you want.

If there are not, you need to somehow ensure that the associations are clearly defined as one-to-one, and the attributes are somehow unique.

I don't know if the automatic DDL transform will pick this up, but perhaps it will.
No, you can't have it!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Association class and DDL
« Reply #2 on: April 03, 2008, 08:05:09 am »
The code and transformation templates do not currently determine the difference between an association class and a completely seperate class and association.

Handling of this is on our to-do list.

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Association class and DDL
« Reply #3 on: April 03, 2008, 08:55:50 am »
Quote
...
Handling of this is on our to-do list.
As are so many things Simon.

Please don't take that the wrong way! It's just that the size of EA necessitates a broad front. So...

Any idea where on the list it is? I'm not looking for a definite commitment here - unless it's in the hopper now, so to speak - but some idea if we (the community) should be writing our own functions to do this. If this looks like it will come out in the pre 7.5 timeframe then it would likely be best to wait.

David
No, you can't have it!

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Association class and DDL
« Reply #4 on: April 03, 2008, 10:11:55 am »
I really can't say anything more than it's not one of my immediate priorities.

sgs32r

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Association class and DDL
« Reply #5 on: April 03, 2008, 06:32:51 pm »
If the code and transformation templates do not currently determine the difference between an association class and a completely seperate class and association, this means that most of the DDL gererated will be false  :-/.

Have you an idea ?

I have another question: When I delete a class and that reexecute the "DDL transformation", the corresponding table is not removed. What solution to this problem ?
« Last Edit: April 03, 2008, 11:17:16 pm by sgs32r »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Association class and DDL
« Reply #6 on: April 04, 2008, 08:40:06 am »
The solution is to manually delete the transformed class.  It can't be done automatically because EA doesn't assume that all classes need to be transformed at once.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Association class and DDL
« Reply #7 on: April 04, 2008, 04:52:47 pm »
I guess the options you have are:

1. Wait for Sparx to fix this
2. Write your own DDL generator
3. Avoid using association classes. At a former client we had to stop using association classes as well because their generator couldn't handle it. It's annoying, but quite possible. Each assocation class becomes a normal class with associations to the two classes. Just make sure you get the constraints right.

sgs32r

  • EA Novice
  • *
  • Posts: 10
  • Karma: +0/-0
    • View Profile
Re: Association class and DDL
« Reply #8 on: April 04, 2008, 05:19:51 pm »
Thank you for your response and your help