home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.object:3199 comp.lang.eiffel:1062
- Newsgroups: comp.object,comp.lang.eiffel
- Path: sparky!uunet!gatech!cc.gatech.edu!news
- From: guna@cc.gatech.edu (L. Gunaseelan)
- Subject: Re: Persistence: Pragmatic and Abstract
- Message-ID: <1992Aug13.163917.1771@cc.gatech.edu>
- Keywords: persistence think class oop
- Sender: news@cc.gatech.edu
- Organization: College of Computing, Georgia Tech
- References: <1992Aug9.164259.23429@reed.edu>
- Date: Thu, 13 Aug 1992 16:39:17 GMT
- Lines: 48
-
- In article <1992Aug9.164259.23429@reed.edu> chaffee@reed.edu (Alex Chaffee) writes:
- >I have an object-oriented design question. This is my first big OOP project,
- >and I'm fumbling through it the best I can. The project involves two
- >programs, a client and a server, and they need to send data structures back
- >and forth across a local network. To accomplish this, I imagine that each
- >data structure will be an object that can "wrap itself up" into a stream of
- >bytes (actually into a Macintosh handle), and then "unwrap" such a handle
- >and change its state to match the other object's. These handles will be sent
- >across the wire and "unwrapped" at the other end. In other words, the
- >problem is one of persistence.
- >
- >What's the problem? Since I'm using the Think Class Library, I have a class
- >hierarchy available to me which implements things like arrays, which I want
- >to use. Unfortunately, this hierarchy doesn't allow persistence. I am left
- >with several options, and I can't decide between them.
- >
-
- The point I am making here may not be of direct use to solve
- your problem. However, I would like to highlight that the problem is
- one of language design than programming.
-
- In C language, when you see a pointer you are not sure of what
- it points to (with typecasting and so on); when you have list
- you don't know how long it is, it requires traversing the list and
- packing the elements. The XDR (external data representation) support
- that is part of the Sun RPC (also OSF/DCE, I guess) allows the
- programmer to do exactly that.
-
- In contrast, consider the Eiffel programming language. In Eiffel,
- there are no pointers and it uniformly uses reference semantics -
- a reference always points to an object of specific type.
- Since objects are completely typed, the language design
- allows writing routines that can automatically pack and unpack
- objects, without out bothering the programmer to write class-specific
- marshalling and unmarshalling routines. This is the basis of the
- STORABLE class in the Eiffel implementation.
-
- In fact, we have a distributed implementation of Eiffel that runs
- on the Clouds distributed operating system, where any graph structure
- of fine-grained Eiffel objects can be passed during remote
- invocations (RPCs) by deep copying the graph into a string of bytes.
- The programmer makes RPC calls as he would in a procedural language,
- and the run-time system handles marshalling and unmarshalling
- automatically, using the routines available in the ISE's run-time
- library. Again, the programmer never needs to write class-specific
- packing/unpacking routines.
-
- Guna..
-