<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/07/e6b497b6561e6b659094f56674cbd2d4"
  from="John Max Skaller &lt;skaller@o...&gt;"
  author="John Max Skaller"
  date="2003-07-03T11:20:34"
  subject="Re: [Caml-list] prevent more than one object"
  prev="2003/07/3444f9db4683b79f42ccc688703d54b7"
  next="2003/07/1a00e490e8337df3f522867c8a55be6e"
  prev-in-thread="2003/07/1289d7b595f1d629c162939d33309862"
  next-in-thread="2003/07/1a00e490e8337df3f522867c8a55be6e"
  prev-thread="2003/07/d3684049ef97610c271443c5f8c1c003"
  next-thread="2003/07/9d5c44985ef4846fa1879e4f91dc551f"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] prevent more than one object">
<msg 
  url="2003/07/49d3704bd9b76044d06a619f87144574"
  from="Mirko Aigner &lt;Mirko.Aigner@a...&gt;"
  author="Mirko Aigner"
  date="2003-07-02T16:14:24"
  subject="[Caml-list] prevent more than one object">
<msg 
  url="2003/07/1289d7b595f1d629c162939d33309862"
  from="Nick Name &lt;nick.name@i...&gt;"
  author="Nick Name"
  date="2003-07-02T16:42:04"
  subject="Re: [Caml-list] prevent more than one object">
</msg>
<msg 
  url="2003/07/e6b497b6561e6b659094f56674cbd2d4"
  from="John Max Skaller &lt;skaller@o...&gt;"
  author="John Max Skaller"
  date="2003-07-03T11:20:34"
  subject="Re: [Caml-list] prevent more than one object">
<msg 
  url="2003/07/1a00e490e8337df3f522867c8a55be6e"
  from="Mirko Aigner &lt;Mirko.Aigner@a...&gt;"
  author="Mirko Aigner"
  date="2003-07-03T11:36:21"
  subject="Re: [Caml-list] prevent more than one object">
</msg>
</msg>
</msg>
</thread>

<contents>
Mirko Aigner wrote:

&gt; Hi !
&gt; 
&gt; I'm looking for a way to prevent that from a class more than one object 
&gt; is builded. 


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.

-- 
John Max Skaller, mailto:skaller@ozemail.com.au
snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.
voice:61-2-9660-0850


-------------------
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

</contents>

</message>

