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

  1. Xref: sparky comp.lang.c++:11291 comp.lang.objective-c:451
  2. Newsgroups: comp.lang.c++,comp.lang.objective-c
  3. Path: sparky!uunet!europa.asd.contel.com!darwin.sura.net!mips!pacbell.com!tandem!UB.com!quack!rmd
  4. From: rmd@quack.sac.ca.us (Robert M. Diamond)
  5. Subject: Object Oriented Design Question
  6. Message-ID: <fQbGjid@quack.sac.ca.us>
  7. Followup-To: poster
  8. Organization: The Duck Pond public unix: +1 408 249 9630, log in as 'guest'.
  9. Date: Wed, 22 Jul 1992 01:05:19 GMT
  10. Lines: 19
  11.  
  12. Hello,
  13.     I am attempting to design a system which reads data in from a
  14. file and writes it back to another file.  Data items can be of various
  15. basic types, like number, string, date or time.  They can be read from
  16. the file or calculated from other read or calculated data items.  They
  17. can be stored in the database (in various ways) or marked for temporary
  18. use only.  The scheme I have come up with is thus:  
  19. Have a class "data_item" which can store itself or retrieve its value.
  20. Have subclasses "numeric_data_item," "date_data_item, " etc. which
  21. instantiate the ::store() and ::retrieve() functions.
  22.     The problem is that the typed_data_item either needs to know how
  23. to store itself in each possible way, or the storage_class has to know
  24. how to store each possible type, or I must create classes for the
  25. cartesian product of type and storage class.
  26.     This is my first OOD project, and I would appreciate any ideas
  27. that people can come up with.
  28.     thanx,
  29.     Robert Diamond
  30.     +1 415 493-4122
  31.