home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / modula2 / 1629 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  2.3 KB

  1. Path: sparky!uunet!wupost!spool.mu.edu!agate!ucbvax!COMPUSERVE.COM!100023.2527
  2. From: 100023.2527@COMPUSERVE.COM (Guenter Dotzel)
  3. Newsgroups: comp.lang.modula2
  4. Subject: O2: Persistent Objects
  5. Message-ID: <930107081614_100023.2527_EHF12-2@CompuServe.COM>
  6. Date: 7 Jan 93 08:16:14 GMT
  7. Sender: usenet@ucbvax.BERKELEY.EDU
  8. Reply-To: Modula2 List <INFO-M2%UCF1VM.BITNET@uga.cc.uga.edu>
  9. Organization: The Internet
  10. Lines: 47
  11.  
  12. Oberon-2:
  13.  
  14. The chapter on Persitent Objects in the new book
  15. "Objektorientierte Programmierung in Oberon-2", Springer Verlag, 1992
  16. (OOPiO2) by H.P. Moessenboeck inspired me to write a test program in
  17. Oberon-2 on VAX/VMS (H2O).
  18.  
  19. When writing to file, the program retrieves the record type name information
  20. at run-time with the procedure Objects.ObjToName and writes the type names
  21. ("moduleName.typeName") together with the associated
  22. data of a heterogeneous list of objects to a file.
  23.  
  24. When reading the list from file, the type names stored in the
  25. file are used to reconstruct the original type with SYSTEM.NEW (p, n),
  26. where the pointer's type tag and size n are set their original values
  27. in Objects.NameToObj.
  28.  
  29. The advantage is that simply adding new methods to load and store
  30. any extension of the base class is all you need to support new
  31. data structures on the file. There is no need to modify the
  32. write-to or read-from-file procedure.
  33.  
  34. Does anybody know what Oberon-2 implementations support or provide facilities
  35. for ObjToName and NameToObj for arbitrary (non-anonymous) type names?
  36.  
  37. The C++ working group plans to make language provisions for run-time type
  38. information and persitent objects too.
  39. In Oberon-2 this is possible now without any language extension.
  40.  
  41. Guenter
  42.  
  43. PS.:
  44.  Thanks to my coworker +++hartmut who extended the VAX/VMS Oberon-2 compiler
  45.  to store the type name information, size and tag.
  46.  He also wrote the low-level module Objects for H2O.
  47.  The design took him one day :-) I needed two days to debug his changes in
  48.  the compiler's object-file generation module (VMS linker interface) :-(
  49.  
  50.  I'll list the source of Test_Objects (uses ISO M2 Std I/O Lib)
  51.  in an upcoming issue of ModulaWare's "The ModulaTor" newsletter.
  52.  
  53.  H.P. Moessenboeck's book OOPiO2 will also be available in English soon.
  54.  
  55.  
  56.  
  57. Distribution:
  58.   comp.lang.modula2 feed >INTERNET: info-m2@ucf1vm.bitnet
  59.