• Post Reply Bookmark Topic Watch Topic
  • New Topic

My design outlay - please critique.  RSS feed

Anton Golovin
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, and thank you in advance for your valuable time.

My design could be conceptually broken down into four packages:


I'd like to ask your opinion of the design of two of those packages:

The functionality in suncertify.db.io is such:

DBSchemaBuilder builds a valid DBSchema object. It throws DBSchemaBuilderException if it cannot build a valid schema.

DBSchema is then handed off to a DBParser. The DBParser knows how to read the db file based on the schema. It throws a DBParserException for error conditions, and uses exception chaining.

Classes in suncertify.db.io package take care of my db access functionality.

The functionality in suncertify.db is such:

DBCache is the database data class. It loads up the database into memory and knows how to manipulate the information. It is built using a DBCacheBuilder, which throws a DBCacheBuilderException.

Data gets a copy of DBCache and DBParser. It is responsible for ensuring thread safety and synchronization of data in the DBCache and the db file. Before it changes the data in DBCache, it requires a true return from an appropriate DBParser method, indicating the data were written to disk. It also gets a copy of DBLocker, which contains locked records. Data class throws required exceptions, which are chained.

DataAdapter implemets a DBClient interface, which contains more understandable methods for application logic - book instead of lock, change record, unlock, for example. It throws chained exceptions such as BookingException, DeleteRecordException, CreateRecordException, etc.

DataImpl class implements the DBRemote interface, which extends DBClient and remote interfaces; and it extends the UnicastRemoteObject. It is the remote class.

It throws the same exceptions as the DBAdapter class since it also implements the DBClient Interface.
[ August 13, 2004: Message edited by: Anton Golovin ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!