Author Topic: Collections, Containers, Composites & Nests  (Read 7853 times)

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 5882
  • Karma: +71/-78
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Collections, Containers, Composites & Nest
« Reply #45 on: October 02, 2005, 06:24:27 am »
Quote
Swans, Tigers - its all Good!  ;D ;D ;D
Why pick this thread?
Or did you know I used to drive past the Balmain Club a lot when I lived in Sydney?

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 5882
  • Karma: +71/-78
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Collections, Containers, Composites & Nest
« Reply #46 on: October 02, 2005, 06:51:38 am »
Quote
Paolo;

I'm used to seeing constructor methods inside of the class they instantiate, not outside of it.  It looks like they are generating two constructors.  What I'm getting is two classes in the same source file (a no no where I come from because of the problems that creates, but allowed by Java) and both classes have the same name!!  I think c++ allows this type of class specification resumption, but I'm not aware that Java does.
[size=13][SNIP][/size]
Jim,
I think you have fallen foul of EA's UI (Unique Interface).  My version only has the one constructor, inside the class.  You may have got a left over from a previous emission.  When I was doing my preliminary testing of EA code emission, I couldn't get it to reliably locate and update the right stuff in various files, especially if I tried round-tripping.  If you delete the file and recreate, you should find all is fine.

My testing was another reason I decided to go the route of decoupling code generation from model management.  Again, I don't think EA is worse than any other tool, I just think round tripping to pure code is fatally flawed.
Quote
I agree. Most texts are too patronizing about the instantiation process, especially about what goes on behind the scenes.  However, in your code you have placed the constructor inside of the class, which is where I expect to find it.
As I said, try it again and it should be in yours also.
Quote
Another unique EA interface then as EA allows them both to be independently Stereotyped.  These extensions to UML might be nice, but they are really confusing if Sparx does not document them as such.  ::)
Here, It's not EA's fault.  This is my private view (that they are one and the same) - I've explained the reasons in other posts.  Given the current state of the UML 2 specification, EA is quite within its rights to see them as separate elements.  Again, EA isn't alone in this.
Quote
For the sake of consistency in our goal to demonstrate the six meronymies, can we put one on this association too?
Do you mean the new 1:0..1 be made from \ be made into?  I put the «portionOf» stereotype on the other one.  The reason I didn't put one on the Association I just mentioned is that I don't think it's a meronymy.  In my view the relationship between the BreadProductDough and the BreadProduct is between two wholes and therefore not a meronymy.
Quote
Can you republish the original diagram (used in the reply #32 of this thread) so that that reply will always contain the current version?  It would be nice to keep the current drawing published in one place for reference from the other threads forked from here.
I'm happy to publish the current diagram in one place, but #32 shouldn't be it (In my view).  I think it's good to show the evolution.  Also, the diagram and discussion wouldn't make sense if it wasn't static.

Paolo


Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: Collections, Containers, Composites & Nest
« Reply #47 on: October 02, 2005, 05:00:12 pm »
Paolo;
Quote
I think you have fallen foul of EA's UI (Unique Interface).  My version only has the one constructor, inside the class.  You may have got a left over from a previous emission
Nope!  I deleted all the source files and the directory they were in and reran the generation.  I got the exact same result that I posted above.  :'(  I think EA has an an enhancement opportlunity here.

Quote
In my view the relationship between the BreadProductDough and the BreadProduct is between two wholes and therefore not a meronymy.

OK, upon further reflection I see that you are correct.  I agree.

Quote
I'm happy to publish the current diagram in one place, but #32 shouldn't be it (In my view).  I think it's good to show the evolution.  Also, the diagram and discussion wouldn't make sense if it wasn't static.
I had the same thoughts, but didn't know you were willing to provide a home for a current version.  When you set that up, give me the URL so I can use it for refererence in the new threads.

Verbal Use Cases aren't worth the paper they are written upon.

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 5882
  • Karma: +71/-78
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Collections, Containers, Composites & Nest
« Reply #48 on: October 02, 2005, 06:41:56 pm »
Quote
Paolo;
Nope!  I deleted all the source files and the directory they were in and reran the generation.  I got the exact same result that I posted above.  :'(  I think EA has an an enhancement opportunity here.
[size=13][SNIP][/size]
Check your database, you may have a second object with that name... That's what I meant about the UI.  If you change a Class to an Association Lozenge, it is no longer visible in the Browser...  But it's still there!

Paolo
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!

jeshaw2

  • EA User
  • **
  • Posts: 701
  • Karma: +0/-0
  • I'm a Singleton, what pattern are you?
    • View Profile
Re: Collections, Containers, Composites & Nest
« Reply #49 on: October 02, 2005, 09:36:34 pm »
I've looked in gthe project browser and only found one BreadRecipe class.

I opened the database in Access and looked at t_object but didn't find anything but packages.  When I expanded the Bread Package, I didn't see anything recognizable.  :'(
Verbal Use Cases aren't worth the paper they are written upon.

SF_lt

  • EA User
  • **
  • Posts: 216
  • Karma: +1/-0
  • The Truth Is Out There
    • View Profile
Re: Collections, Containers, Composites & Nest
« Reply #50 on: October 10, 2005, 06:59:22 am »

Paolo, what tools do you use to get code?
EA for design, then emit XMI to Rose?
registertm everything to SparX

Paolo F Cantoni

  • EA Guru
  • *****
  • Posts: 5882
  • Karma: +71/-78
  • Inconsistently correct systems DON'T EXIST!
    • View Profile
Re: Collections, Containers, Composites & Nest
« Reply #51 on: October 10, 2005, 03:32:42 pm »
Quote
Paolo, what tools do you use to get code?
EA for design, then emit XMI to Rose?
sf,

My references to Rose are historical.  Initially I had my own Conceptual Modelling Tool based on ER style diagrams (with OO overtones).   I built a lot of model checking algorithms and a verbaliser (it describes the model in narrative).  When I joined my current employers, I changed to Rose (as it was their modelling tool) and I wanted to get experience in UML.  I built the verbaliser in Rose.   I haven't yet moved it to EA - only through lack of resources.

The only code I've emitted is using EA, but apart from some early tests I've emitted model metadata through my own XML structure and used another tool CodeSmith/CodeDOM to create the code.

Unfortunately, for the present I've been diverted onto other tasks so the code generator is on-hold.

Nevertheless, I believe that the stuff Jim and I are talking about will allow me to adorn the model with sufficient metadata to aid in the generation process.  I stress that it is early days yet, but so far, each piece of the vision has been implemented without undue problems.  Thus I'm quite hopeful.

Also, in line with my approach to system building, I canvas as much as possible in the CIM domain.  One I have a CIM model that makes sense, I start implementing.  I try to resist implementation until the CIM makes sense in the area I'm trying to implement.

Paolo
« Last Edit: October 10, 2005, 03:33:40 pm by PaoloFCantoni »
Inconsistently correct systems DON'T EXIST!
... Therefore, aim for consistency; in the expectation of achieving correctness....
-Semantica-
Helsinki Principle Rules!