home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / object / 5009 < prev    next >
Encoding:
Internet Message Format  |  1993-01-23  |  1.7 KB

  1. Path: sparky!uunet!olivea!decwrl!cache.crc.ricoh.com!cache!steve
  2. From: steve@crc.ricoh.COM (Stephen R. Savitzky)
  3. Newsgroups: comp.object
  4. Subject: Re: Three approaches to designing OBJECTs
  5. Message-ID: <STEVE.93Jan22110628@styx.crc.ricoh.COM>
  6. Date: 22 Jan 93 19:06:28 GMT
  7. References: <1993Jan21.191431.11321@uhura1.uucp>
  8. Sender: news@crc.ricoh.com (USENET News System)
  9. Followup-To: comp.object
  10. Organization: RICOH California Research Center
  11. Lines: 19
  12. In-Reply-To: rdm@uhura1.uucp's message of Thu, 21 Jan 1993 19:14:31 GMT
  13. Nntp-Posting-Host: styx.crc.ricoh.com
  14.  
  15. I recommend a variation on your approach 1.
  16.  
  17. Give Entity a virtual function (I usually call it dscr()) that returns
  18. a descriptor for the entity, having as one of its attributes a list of
  19. attribute-name / attribute-descriptor pairs.  If you're really lucky,
  20. you can get this information out of the OODB's schema.  Otherwise, you
  21. could be ambitious and get them by parsing the declarations yourself.
  22.  
  23. Note that the descriptors are not persistent -- they're just static
  24. data structures referred to by the dscr() function.  Because they're
  25. not stored with the object, they can have application-specific stuff
  26. in them, like how to display the attribute and where it goes on a
  27. panel.
  28.  
  29. You can do a lot with a descriptor of this sort, including the generic
  30. Get, Set, and display stuff you mention, and also generic stream I/O
  31. (<< and >> operators).  Put a class name in the Entity descriptor, and
  32. you can use it in error messages.  You can also do run-time class
  33. checking.
  34. --
  35. \ --Steve Savitzky--  \    343 Leigh Ave   \ REAL HACKERS USE AN AXE!
  36.  \ steve@crc.ricoh.COM \ San Jose, CA 95128 \     Free Cyberia!
  37.   \ w: 415-496-5710     \   h:408-294-6492   \ 
  38.    \_________________________________________________________________________
  39.