aspose file tools*
The moose likes OO, Patterns, UML and Refactoring and the fly likes Single pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » OO, Patterns, UML and Refactoring
Bookmark "Single pattern" Watch "Single pattern" New topic
Author

Single pattern

rex tony
Ranch Hand

Joined: Aug 29, 2007
Posts: 159
Single pattern with simple example code in java
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2500
    
    8

Rex,
can you give a little more information. Your post is not clear to me.

Regards, Jan


OCUP UML fundamental and ITIL foundation
youtube channel
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41889
    
  63
Do you mean Singleton?


Ping & DNS - my free Android networking tools app
rex tony
Ranch Hand

Joined: Aug 29, 2007
Posts: 159
What are the steps to implement Singleton Design pattern in our java class
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
The most common implementations use the following ingredients:

* Private constructor - prevents any other class from making an instance

* Static getInstance() method - gives clients a way to get the one instance

* Static variable - holds the one instance

Can you picture how those would work together? See if you can code something up and share what you make. It will be a lot more memorable than just copying an answer we give you.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
rex tony
Ranch Hand

Joined: Aug 29, 2007
Posts: 159
Thanks james i got some idea from your concepts.Can you tell me what are the pros and cons.
rex tony
Ranch Hand

Joined: Aug 29, 2007
Posts: 159
James,
Can you tell me all the design pattern procedure like this with pros and cons
rex tony
Ranch Hand

Joined: Aug 29, 2007
Posts: 159
James,
Can you tell me all the design pattern procedure like this with pros and cons
Kevin Smither
Ranch Hand

Joined: Oct 22, 2007
Posts: 30
gosh just google it, i'm sure you'll get 123456789 hits! sorry to be blunt but there is oodles of information out there on this pattern.
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
See OO, Patterns, UML and Refactoring FAQ: Singleton Pattern.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Single pattern