The Artima Developer Community
Sponsored Link

Legacy Design Forum
Designing with Static Members



This page contains an archived post to the Design Forum (formerly called the Flexible Java Forum) made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


singleton classes

Posted by Manimuthulakshmi on December 19, 2000 at 2:27 AM

> In an application I'm developing I have a singleton class
> which provides basic services used throughout the application.
> The singleton is implemented using statics. I do not believe
> the question of object-oriented versus procedural programming
> applies here. It is one of style.

> For a singleton accessed in many places, ClassName.method()
> seems to me to be more readable than
> ClassName.getInstance().method. Since the concensus
> is not to use statics for singletons I will probably change
> it, but I am not completely convinced.

please explain in detail about the singleton classes.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us