Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!helios!ee.tamu.edu From: greg@ee.tamu.edu (Greg Economides) Newsgroups: comp.lang.eiffel Subject: Global object question Message-ID: <10538@helios.TAMU.EDU> Date: 30 Nov 90 18:48:25 GMT Sender: usenet@helios.TAMU.EDU Organization: Texas A&M University, College Station Lines: 71 I am unable to get mail to go to "rick@tetrauk.uucp" -- it bounces back. So I am posting this question for Rick Jones regarding his recent posting. If anyone else can answer my question, feel free to do so. Rick, Addressing the subject of global objects in Eiffel, you posted a message to the net a while back. The topic is of interest to me, so I hope you can take a moment to clarify the idea that you presented for me. You gave the following example of a "global" class: class DEFS feature Const1: INTEGER is 1 ; Const2: INTEGER is 2 ; Const3: INTEGER is 3 ; -- etc ... foo: FOO is -- I assume you meant "foo: DEFS is" here (greg) once Result.Create ; end ; -- etc ... end And then wrote: Hence any class which inherits from DEFS can refer to foo as an attribute of the Current object, and all classes will share only one instance. In a large system it may be appropriate to have multiple definition classes, each concerned with a particular group of cooperating classes which can be treated as a subsystem. ==================== My question is, do you imply here that (since foo returns type DEFS) in the classes that inherit from DEFS there should be a statement of the form: globals: DEFS; ... globals := foo; And then when we want to access the global objects, we do a call such as: globals.Const1 (which would imply that Const? and other globals would have to be exported)? Or is this scenario supposed to be used in another fashion? Peace, %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Greg Economides Internet: greg@zadok.tamu.edu Texas A&M University greg@eemips.tamu.edu "This sentence is false" -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Greg Economides Internet: greg@zadok.tamu.edu Texas A&M University greg@eemips.tamu.edu