Re: Sequence Diagram to Java Code ATL Transformations [message #626876] |
Fri, 15 August 2008 14:59 |
Ed Merks Messages: 33216 Registered: July 2009 |
Senior Member |
|
|
Hugo,
I think answers to your questions rely on understanding what a sequence
diagram means, so I'll be of little help in that regard. More likely
someone with UML knowledge can help, so I've added the UML2 newsgroup to
the "to" list of the reply.
Hugo Marques wrote:
> Hello,
>
> I am currently developing a tool for generating Java code from UML
> sequence diagrams. In this context, I have two doubts and should be
> grateful if someone could help me.
>
> Doubts:
>
> 1 - Concerning the instantiation of the objects represented by the
> lifelines, these objects should be translated a) as attributes from
> other objects
> class {
> private LifelineObject1 l1;
> private LifelineObject1 l2;
>
> }
>
>
> b) as parameters taken in the method generated to the sequence diagram?
> returnType method(LifelineObject1 l1, LifelineObject2 l2) { ... }
>
> 2- Concerning control flow of the method. For example, consider a
> sequence diagrama named test that has three lifelines ( l1, l2 and
> l3), where l1 sends a message msg1() to l2 that in turn sends a
> message msg2() to l3. Which would be the correct translation (see the
> options below) from this flow to the java code?
>
> a) All messages in the same method but from different classes.
> class l1 {
> test() {
> l2.msg1();
> l3.msg2():
> }
> }
>
> b) All messages in the same method and class.
>
> class l1 {
> test() {
> self.msg1();
> self.msg2();
> }
> }
>
>
> c) Messages from different classes and differente methods.
> class l1 {
> test() {
> l2.msg1();
> }
> }
>
> class l2 {
> msg1() {
> l3.msg2();
> }
> }
> Thanks in advance for any help,
>
>
> Best regards,
> Hugo Marques
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.06099 seconds