Back to list
Views:   0
Replies:  0
Archived
,
Reply 1
Yogi:

Actually sealed modifiers, singletons, and constructors that initialize a series of private variables are all concepts that solve different problems. 

If you don't want others to access private variables then your constructor idea seems fine. If you don't want any other class to derive from your class, then the sealed modifier is fine. If you want just one instance of your class then the Singleton pattern works great.

So, the answer to your question really depends on what the problem is you're trying to solve.

Hope this helps.


Dan McMillan, Dec 03, 2010
Thanks for your explanation.
Aug 31, 2010
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas