MathewWi / umple

Automatically exported from code.google.com/p/umple
0 stars 0 forks source link

association 0..1 to m..n multiplicity no set method generated #646

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Take the following code:

class A {}

class B {
   0..1 b -- 2..3 A a;
}

When the java is generated, there is no set or add method in class A.  Since 
there is no argument of type B in the constructor of A, there is no way to 
initialize variable b in class A with the generated code.

I also discovered this writing tests for composition.  It seems to occur fo all 
associations.

Original issue reported on code.google.com by ellen.ar...@gmail.com on 11 Oct 2014 at 1:19

GoogleCodeExporter commented 9 years ago
This is also present in php and ruby.
There is a work-around, which involves setting the instance variables directly, 
from outside the class; this fix depends on the language.

Original comment by ellen.ar...@gmail.com on 4 Nov 2014 at 6:16