From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id NAA23094; Thu, 3 Jul 2003 13:36:21 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA16004 for ; Thu, 3 Jul 2003 13:36:20 +0200 (MET DST) Received: from mailrelay1.alcatel.de (mailrelay2.alcatel.de [194.113.59.71]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h63BaJf09131 for ; Thu, 3 Jul 2003 13:36:20 +0200 (MET DST) Received: from alcatel.de (slbpx8.bln.sel.alcatel.de [149.204.198.4]) by mailrelay1.alcatel.de (8.9.3/8.9.3) with ESMTP id NAA17876 for ; Thu, 3 Jul 2003 13:35:58 +0200 (MET DST) Message-ID: <3F041534.2000508@alcatel.de> Date: Thu, 03 Jul 2003 13:36:20 +0200 From: Mirko Aigner User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3) Gecko/20030312 X-Accept-Language: en-us, en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] prevent more than one object References: <3F0304DF.1010300@alcatel.de> <3F041173.8010903@ozemail.com.au> In-Reply-To: <3F041173.8010903@ozemail.com.au> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Alcanet-MTA-scanned-and-authorized: yes X-Spam: no; 0.00; alcatel:99 caml-list:01 implemented:01 sdg:99 dnj:99 coerce:01 modules:02 wrote:03 constructor:03 object:03 shared:05 define:05 hints:06 max:06 pattern:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk John Max Skaller wrote: > Why? Its a design error. Fix your design. > > There's never any need for a singleton object, > > because there is no resource for which there > cannot be more than one. I have seen (C++) designs > using singletons and they create an utter mess > because someone wrongly assumed something was > unique. > > If you want one object, define the class in your > mainline, create it, and then coerce it to > a shared class type which does not provide a constructor. > Maybe you're right, but this is not the right place to discuss the usefullnesss of the design patterns described by the GoF. Vincente and Wagner describe in their paper, that singleton pattern could be implemented with modules. sdg.lcs.mit.edu/~dnj/6898/projects/vicente-wagner.pdf I was testing it and got some problems, mentioned it here and got some hints how to solve the problem. THANKS to all helping me with it!! Mirko Aigner ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners