If using Java, you might also wish to select the Java tab for that class,
and set the ConstructorIs property to private. Plus, you can create a
reflexive association, setting the static on the Role A/B detail tab, and
choosing private on the Role A/B general tab. Then creating your getInstance
static method that returns the single instance, and you truly do have a
Singleton. Really no need to create a stereotype.

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


> -----Original Message-----
> From: Brian Lyons [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, December 07, 2000 6:56 AM
> To:   'Pierre BEZENCON '; ''[EMAIL PROTECTED]' '
> Subject:      RE: (ROSE) singleton
> 
> 
> 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
> *
> *************************************************************************
************************************************************************
* 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