Yes, that is the definition of an association. But, it isn't the association
in and of itself that makes it a Singleton. It's the combination of a few
things. First, it's the reflexive assocation (resulting in the attribute).
Second, it's the fact that the instance that is the result of the
association is defined as static. Third, the fact that the constructor is
private. Take away any of these, and we no longer have a Singleton.

For instance, if you were to make the constructor public, you no longer have
a Singleton, and can instantiate an instance directly, which could contain
an instance of itself. This would be an example of an association as you
describe it below.

Or, if you were to make the variable non-static, then any instance you
create could contain it's own instance. Again, this is similar to what you
describe below.

Or, take away the reflexive association, and you don't have an attribute,
and subsequently, no instance.

Essentially, the class itself is an instance of something (in Java, it's an
instance of the Class class in the JVM) in the underlying system, which in
turn has a reference to a single instance of itself.

Kirk Knoernschild
Senior Consultant
TeamSoft, Inc.
www.teamsoftinc.com
Consulting, Training, & Mentoring
**--------------------------------------------------------------------------
----------------
* The opinions expressed here do not necessarily reflect those
* of TeamSoft, Inc., nor Kraft Foods.
**--------------------------------------------------------------------------
----------------


> -----Original Message-----
> From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, December 07, 2000 10:15 AM
> To:   [EMAIL PROTECTED]
> Subject:      RE: (ROSE) singleton
> 
> 
> 
> I have a question which relates to representation of a Singleton class in
> UML.
> 
> When a singleton class REed into Rose, it shows up with a unidirectional
> reflexive association. Rose does this because it finds a STATIC object of
> this class as a member varaible. To my way of thinking (correct me if I am
> wrong), reflexive association for a class means that TWO objects of this
> class are rquired to communicate. But   for a singleton class ONE and ONLY
> ONE object can exist.
> 
> Is this a correct representation of a singleton class? Any comments or
> thoughts are appreciated.
> 
> Manoj Chopra
> 
> ************************************************************************
> * Rose Forum is a public venue for ideas and discussions.
> * For technical support, visit http://www.rational.com/support
> *
> * Admin.Subscription Requests: [EMAIL PROTECTED]
> * Archive of messages:
> http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
> * Other Requests: [EMAIL PROTECTED]
> *
> * To unsubscribe from the list, please send email
> *
> * To: [EMAIL PROTECTED]
> * Subject:<BLANK>
> * Body: unsubscribe rose_forum
> *
> *************************************************************************
************************************************************************
* Rose Forum is a public venue for ideas and discussions.
* For technical support, visit http://www.rational.com/support
*
* Admin.Subscription Requests: [EMAIL PROTECTED]
* Archive of messages: 
http://www.rational.com/products/rose/usergroups/rose_forum.jtmpl
* Other Requests: [EMAIL PROTECTED]
*
* To unsubscribe from the list, please send email
*
* To: [EMAIL PROTECTED]
* Subject:<BLANK>
* Body: unsubscribe rose_forum
*
*************************************************************************

Reply via email to