hiho,

Singleton, as one pattern amongst many patterns out there, has no specific
representation in UML.  The suggestion of using a particular stereotype
could work.  I am wary of using stereotypes for too many of these types of
things because you only get one -- what about a singleton <<entity>> vs. a
singleton <<controller>> (given the premise that you use these or other such
stereotypes). 

One interesting aspect of this from the perspective of Rose is the
multiplicity listbox that appears on the Detail tab of the Class
Specification.  (Note: If you are using Java or another langauge Add-In that
overrides the class spec, you might have to right-click and select "Open
Standard Specification")  That listbox is left over from the old Booch
notation that had special adornments for classes that would only have one
instance in a system (i.e. Singletons).  So, though this has no visual
representation in UML, you could use that as a way to mark such classes in
your Rose model.

Once you know that you have certain classes marked as Singleton (either via
stereotype, via the above mentioned method, or via a new property that you
could add), you could have a script that really makes the class a Singleton.
The script could work something like the "Singleton Pattern Script" written
by Kevin Kelly of Rational and found here:
http://www.rational.com/support/downloadcenter/addins/rose/ 

           ------- b

--
Brian G. Lyons
Number Six Software - Voted Rational's Best Complementary Service Provider 
http://www.numbersix.com/
1101 30th Street, NW, Suite 500, Washington, DC, 20007


-----Original Message-----
From: Pierre BEZENCON
To: '[EMAIL PROTECTED]'
Sent: 12/7/00 4:21 AM
Subject: (ROSE) singleton


Hi,

Is there a way to describe a class as singleton (instance) in UML (in
Rose actually) ?
************************************************************************
* 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