Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!snorkelwacker!bloom-beacon!eru!luth!sunic!liuida!isy!nicwi From: nicwi@isy.liu.se ( Niclas Wiberg) Newsgroups: comp.lang.eiffel Subject: How to use STORABLE? Message-ID: <1989Dec11.170552.8455@isy.liu.se> Date: 11 Dec 89 17:05:52 GMT Distribution: comp Organization: Dept of EE, University of Linkoping Lines: 39 For evaluation purpose i am trying to use the Eiffel standard library in a small size project. My opinion is that the documentation is poor. My problem right now concerns about the basic class STORABLE. As I dare not publish part of ICE copyrighted material, you will have to cope with my explanation. Objects of class STORABLE (or of a descendent class to STORABLE) has the features store and retrieve, which takes as argument a filename. Store works just fine, the problem arises when you whish to retrieve objects: 1. Before you can use retrieve, you have to Create an object of the desired class, which may involve a lot of work (as you cannot have several different Create routines). 2. Retrieve does *not* change the "Current" object, but (it is a function) returns a new object. My first attempt was to call retrieve from within Create (to overcome (1) above), but that did not work because of (2). 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! Am I missing something? What is the recommended programming style? Thanks in advance. -- ---------------------------------------------------------------------- Niclas Wiberg nicwi@isy.liu.se Dept. of EE Linkoping University Sweden