posted 21 years ago
Hi
I have decided to make the database layer of my program as modular as possible, trying to ensure reusable code modules and good OO principles.
I have a record class implementing Serializable, containing all record fields and record number, with getter/setter methods for everything. These serializable record objects will be passed over the network to the client.
I also have a similiar database class, holding all database schema details and database file location, with only getter methods for most except a setter method also for the file location.
The intention being to have a database member in the Data class (main access class) and reading individual records into record objects, maybe even storing the full set of records objects in a collection (is this "caching the database records into memory" ?)
I originaly coded all the above into the one Data class, reading the records directly from the database file each read/update etc, but this did not seem to comply with any OO principles.
Am I on the right track with this??? advice welcome.
Regards
Hugh