Sponsored Link •
|
Advertisement
|
Advertisement
|
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.
Message:
I'm inclined to agree with Shawn on this one. 1) Constants (static final) With the singletons I guess one has to take care that garbage collecting a singleton object can't result in any problems - as (I presume) is potentially the case if the singleton is responsible for maintaining some kind of dynamic state. Just out of interest, Eiffel dispenses with statics altogether and instead provides a modifer for methods called "once". public Singleton instance() This applies to any "lazy evaluation" style method as well as singletons. - Mike
Replies: |
Sponsored Links
|