Why should I not model this as an association. I don't see where the UML spec tells me I shouldn't. In fact, from what I can tell, this is in fact a true UML association. Where does UML make the distinction that the reference must be maintainted constantly?
The problem I have with static classes is the same - if I draw an association from a Sender to a Receiver that happens to be a static class, Rose insists on creating an instance variable. And again, I don't see where UML tells me I should not make this an association. In fact, in the target scope discussion for an association end, one of the structural properties is defined as "target scope", which defines whether the links relate objects or entire classes.
Several of the Rose folks are pretty active on this forum. Come on folks, help me out here. What am I missing?
-----Original Message-----
From: Ilya Zvyagin [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 12, 2001 9:38 AM
To: [EMAIL PROTECTED]
Subject: Re: (ROSE) How to show association to local class variable
without generating extraneous Java code
-----Original Message-----
From: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: 12 ���� 2001 �. 15:34
Subject: (ROSE) How to show association to local class variable without
generating extraneous Java code
>variable as opposed to an instance variable. I want the model to show that
>Sender sends messages to Receiver, so I think I want to create an
>association between Sender and Receiver. But I have two problems when I
You SHOULD NOT create this association if two classes instances don't have
this references constantly, every time. The association between them meens
exactly what is generated and what you don't want to have.
>forward engineer:
>1) Rose insists on creating an instance variable for the Receiver class
>object, which I don't want since I've got the reference in a local
variable.
I've explained.
>2) Rose doesn't add an import for the class if it is in another package.
To make imports, you should creat an dependency link between two classes,
from Sender ( the client ) to Receiver ( the server ).
>The only good way I've found to force Rose to include the import is to
>create a dependency to the Receiver class.
I did not read :-))
But in this case Sender depends on Receiver, this fact SHOULD be reflected
in the
model as DEPENDENCY link.
>On a similar note, I have the same problem showing associations to static
>classes (i.e., classes that only have static methods and never get
>instantiated).
I fear I don't understand what you mean. What's wrong thith them ?
--------------------
Ilya Zvyagin, First Container Terminal of SPb Sea Port
e-mail: [EMAIL PROTECTED] - personal, [EMAIL PROTECTED] - business.
ICQ UID: 29427861(MasterZIV)
