Author Topic: Code Engineering 4 Aggregatt/Compositt relations  (Read 4013 times)

orientphoebus

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Code Engineering 4 Aggregatt/Compositt relations
« on: December 01, 2005, 12:30:05 pm »
I am using c#. When doing reverse engineering, it seems like EA only reverse the basic association relationships. for one-to-many , I need to modify the line manually.  And for bi-direction, it creat 2 association lines in class diagram. Can it be a little smarter?

I think it is because the collection is not strong typed. For .Net 2.0, and Java1.5, there is Generic Collection. What is EA's plan to adapt them? Do I have to modify templates and "Automatic interface" to make it work. It shall be a build in feature.

What I hope is with Aggregation or Composition relationship drawed in diagrams, and specify "List<>" as the collection class(or specify "object array", or "IDictionary<>" for qualified collection ),  code generation will provide code like:
Quote
class Parent{
   public List<Child> Children;
 }

For reverse engineering, EA found above code would automatically put composition relationship with 0..* on the diagram.

Have your development teams include this in your next release plan? This will cause EA, which I like very much already, stands a lot of higher than other Case tool.



But for now, what I need is the reverse engineering automatically take the field's name as reference and find the class (in the same namespace) as the collection's item class, then when draw diagrams, automatically link the classes with Aggregation or composition. Can I use "Automation Interface" to define some "Reverse Engineering" rules? I am totally newbie in Add-ins area. If it's not for "Reverse" , please let me know.

Another suggestion for code generation, currently, it put unnecessary "import" or "using" for relationship between 2 classes in the same namesapce or package. Can you take them out? I think it's an easy fix.
Thanks
« Last Edit: December 01, 2005, 02:12:45 pm by orientphoebus »

orientphoebus

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Code Engineering 4 Aggregatt/Compositt relatio
« Reply #1 on: December 01, 2005, 12:52:22 pm »
After read this post
http://www.sparxsystems.com.au/cgi-bin/yabb/YaBB.pl?board=general;action=display;num=1128520043

I found the problem is similar. here is rhk's original problem:
Quote
The class "A" has a property named "x" and the type of "x" is the Class "B". In the detail dialog for the property x I have set the multiplicity to 0..* and have set the Container Type of the Collection to java.util.Set. Additionally I've checked the "attribute is a Collection".
 
The code-generator produces confused code:
 
public class A {
    private B xjava.util.Set;
}
 
So it just adds the "Container Type" behind the propertyname without a whitespace.  
 
But what I expect to be generated is:
 
public class A {
    private java.util.Set<B> x;
}
 
How can this be solved?


I think the reason is EA fails to deal with Generic Collection. For me, I am not using Java now, but c#2.0 is coming. Really hope EA can solve this soon. I don't want to go that Heavy Pricy Rational Rose.

orientphoebus

  • EA Novice
  • *
  • Posts: 18
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Code Engineering 4 Aggregatt/Compositt relatio
« Reply #2 on: December 02, 2005, 07:28:53 am »
Please! anybody help me with this? There proberbly is some "Code Template" for Java can solve this. But which one? Please help.

Hans

  • EA User
  • **
  • Posts: 78
  • Karma: +0/-0
    • View Profile
Re: Code Engineering 4 Aggregatt/Compositt relatio
« Reply #3 on: December 04, 2005, 07:20:35 am »
EA has support for that, albeit not  an automatic one: you'll need to write your custom templates.
This is a mess of unpleasant work, I know, but right now, seems to be the only way.

I once forwarded a request for a forum dedicated for all kinds of templates, so that all users may gain from their code being shared.

That did not get much reponse, though, so we're sitting happily and lonesome on our secret, sparse treasures at the moment.

Hans

Bruno.Cossi

  • EA User
  • **
  • Posts: 803
  • Karma: +0/-0
    • View Profile
Re: Code Engineering 4 Aggregatt/Compositt relatio
« Reply #4 on: December 04, 2005, 09:39:21 am »
Hi Hans,

there is no need for bitterness. There is the EA User Group forum where anyone can post their templates and other things, quite a few interesting things have been posted there. People usually post the template (or whatever else) on the EAUG forum and then post the link here to increase the exposure. Feel free to check it out.

Thanks,
Bruno

Quote
EA has support for that, albeit not  an automatic one: you'll need to write your custom templates.
This is a mess of unpleasant work, I know, but right now, seems to be the only way.

I once forwarded a request for a forum dedicated for all kinds of templates, so that all users may gain from their code being shared.

That did not get much reponse, though, so we're sitting happily and lonesome on our secret, sparse treasures at the moment.

Hans


Hans

  • EA User
  • **
  • Posts: 78
  • Karma: +0/-0
    • View Profile
Re: Code Engineering 4 Aggregatt/Compositt relatio
« Reply #5 on: December 04, 2005, 10:17:55 am »
Thanks, Bruno!

Regards
Hans

Hans

  • EA User
  • **
  • Posts: 78
  • Karma: +0/-0
    • View Profile
Re: Code Engineering 4 Aggregatt/Compositt relatio
« Reply #6 on: December 04, 2005, 10:24:54 am »
..but, Bruno, that's not what a template forum should be about: in there, there's nothing but a (small) list of templates; no description sections, no discussion board about them; this is not a place where code is to be presented, discussed, and enhanced.

And this is missing.

Regards,
Hans

Bruno.Cossi

  • EA User
  • **
  • Posts: 803
  • Karma: +0/-0
    • View Profile
Re: Code Engineering 4 Aggregatt/Compositt relatio
« Reply #7 on: December 04, 2005, 11:45:22 am »
Hi Hans,

discussion board is certainly there, as well as a place for descriptions of the posted items. Of course, the description will be there only when the poster enters it, and the discussion will be there only when people start it.
As I have mentioned before, typically people post the templates or what-not on the EAUG site, then post the link here, where the discussion, if necessary, takes place. This makes sense to me as the audience here is obviously broader.
Do you have better suggestions? Maybe we can bring something better to life!

Bruno

Quote
..but, Bruno, that's not what a template forum should be about: in there, there's nothing but a (small) list of templates; no description sections, no discussion board about them; this is not a place where code is to be presented, discussed, and enhanced.

And this is missing.

Regards,
Hans