Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!mitel!sce!cognos!keithc From: keithc@cognos.UUCP (Keith Campbell) Newsgroups: comp.lang.eiffel Subject: Re: How to use STORABLE? Message-ID: <7738@cognos.UUCP> Date: 15 Dec 89 21:54:53 GMT References: <1989Dec11.170552.8455@isy.liu.se> Reply-To: keithc@cognos.UUCP (Keith Campbell) Distribution: comp Organization: Cognos Inc., Ottawa, Canada Lines: 46 In article <1989Dec11.170552.8455@isy.liu.se> nicwi@isy.liu.se (Niclas Wiberg) writes: >An other approach would be to have an "dummy" object, >to make the retrieval. But problem arises if you have >class invariants. You don't want to create a big object >structure, just to be able to retrieve old objects! Dr. Meyer posted an article some time ago which suggested that he was considering the addition of a feature which would allow the Storable class to be more useful. That feature would allow the invocation of features on a void instance. Retrieve could then be changed so operate in this way avoiding the necessity of creating your large object. For the mean-time, I would suggest that you simply write a dummy class like the one below. CLASS Retriever[ T -> Storable ] -- The constraint isn't really necessary. EXPORT retrieve FEATURE retrieve( fileName : String ) : T IS -- This is essentially a copy of Storable.retrieve -- except that c_retrieve returns an object of type "T" -- instead of "LIKE CURRENT". EXTERNAL c_retrieve : T LANGUAGE "C"; DO Result := c_retrieve( fileName.to_c ); END; -- retrieve END -- CLASS Retriever[ T -> Storable ] You can inherit or create a local Retriever[ BigObject ] and use it to retrieve the structure created by BigObject.store. -- Keith Campbell Cognos Incorporated S-mail: P.O. Box 9707 Voice: (613) 738-1338 x5222 3755 Riverside Drive FAX: (613) 738-0002 Ottawa, Ontario UUCP: uunet!mitel!sce!cognos!keithc CANADA K1G 3Z4