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