Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!brutus.cs.uiuc.edu!zaphod.mps.ohio-state.edu!sol.ctr.columbia.edu!cica!iuvax!rutgers!mit-eddie!bloom-beacon!eru!luth!sunic!tut!tukki!sakkinen From: sakkinen@tukki.jyu.fi (Markku Sakkinen) Newsgroups: comp.lang.eiffel Subject: Re: global objects Message-ID: <3477@tukki.jyu.fi> Date: 21 Feb 90 07:43:17 GMT References: <925@tuewsd.lso.win.tue.nl> Reply-To: sakkinen@jytko.jyu.fi (Markku Sakkinen) Organization: University of Jyvaskyla, Finland Lines: 31 In article <925@tuewsd.lso.win.tue.nl> wsineel@lso.win.tue.nl (e.vriezekolk) writes: > >We want to define some classes, and create only one object of >each class. The object names must be global, so that they can > ... >I realize that this conflicts with the pure object oriented >principle, but it seems to be necessary in our project. I cannot see any necessary conflict: there can well be useful and "natural" classes such that they always have exactly one instance. (That's one of the main reasons why some people claim prototype-based object models to be better than class-based ones.) If your design truly abounds with such classes, then its object orientation may be questionable. >Can anyone help us out? Are such global object possible in >Eiffel? > ... The largest part of your problem can probably be solved by "once functions" (OOSC 13.3). Some Eiffel expert please suggest an elegant way to inhibit creating additional instances of those classes. Markku Sakkinen Department of Computer Science University of Jyvaskyla (a's with umlauts) Seminaarinkatu 15 SF-40100 Jyvaskyla (umlauts again) Finland SAKKINEN@FINJYU.bitnet (alternative network address)