on 9/29/2000 9:47 AM, "Daniel L. Rall" <[EMAIL PROTECTED]> wrote:
>> public MyObject getMyObject(String name){
>> MyObject mo = (MyObject) myobjects.get(name);
>> if(mo == null){
>> synchronized(myobjects){
>> mo = (MyObject) myobjects.get(name);
>> if(mo == null){
>> mo = new MyObject(name);
>> myobjects.put(name, mo);
>> }
>> }
>> }
>> }
>
> Correct. Since the above pattern is necessary in the majority of the
> places where Hashtable is used, we will be providing our own
> synchronization and therefor would not almost need the synchronization
> provided by Hashtable.
Seems to me that it would be _really_ cool to find a way to reuse that
pattern without actually having to actually code it up. Almost like Services
are a re-use of the Singleton pattern yet they don't even have to know that
they are a Singleton.
Any ideas?
-jon
--
http://scarab.tigris.org/ | http://noodle.tigris.org/
http://java.apache.org/ | http://java.apache.org/turbine/
http://www.working-dogs.com/ | http://jakarta.apache.org/velocity/
http://www.collab.net/ | http://www.sourcexchange.com/
------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?: [EMAIL PROTECTED]