home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / cplus / 11878 < prev    next >
Encoding:
Internet Message Format  |  1992-07-31  |  1.5 KB

  1. Path: sparky!uunet!olivea!decwrl!csus.edu!ucdavis!othello.ucdavis.edu!fzjaffe
  2. From: fzjaffe@othello.ucdavis.edu (Rory Jaffe)
  3. Newsgroups: comp.lang.c++
  4. Subject: establishing a registration/database class for program defaults
  5. Message-ID: <15705@ucdavis.ucdavis.edu>
  6. Date: 31 Jul 92 20:34:30 GMT
  7. Sender: usenet@ucdavis.ucdavis.edu
  8. Organization: University of California, Davis
  9. Lines: 32
  10.  
  11. I want to have a class that maintains a defaults file for a program.
  12. This class would also have a database with class tags and default
  13. information read from the file. Objects that wanted to read/write
  14. defaults would refer to this class. Each class that used defaults would
  15. have their own methods to send defaults to, and extract them from, the
  16. database field that contained the default information. The acquired
  17. default info would be in static data members so that changing it would
  18. propagate amongst all class instances.
  19.  
  20. This is not quite like persistent objects, where the database class
  21. would create objects corresponding to the stored information.
  22.  
  23. My questions:
  24.  
  25. 1. How do you avoid collisions between class tags in the database? (2
  26. classes with the same tag).
  27.  
  28. 2. How do you ensure that classes wanting to access the defaults class
  29. find it?
  30.  
  31. 3. How should classes that use the database and thus read/write to the
  32. default field develop their read/write functions? --e.g. overload a
  33. function, or inherit and modify something from the database class?
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41. I expect that this is a common enough need that someone has good
  42. experience with the issues involved.
  43.