Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Database Design Suggestion

 
Michael Bulpin
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I�ve seen a few designs in this magnificent forum, and I have a suggestion for another server/database design, and would like your thoughts on it, especially from a Bartender?
Draw your UML as follows: Data.java is a member of DataAccess.java and is Singleton controlled. DataAccess is in purely used for local access to the database and implements DataAccessInterface that in turn extends Remote for RMI. DataAccessServer extends DataAccess implements UnicaseRemoteObject and uses overriding for the methods that use locking via the member LockManager.java. I think the difference is that the DataAccessServer extends on the DataAccess�s functionality � to basically implement the record locking.
A connection factory can still work as DataAccessServer implements the DataAccessInterface indirectly through DataAccess.
This design removes the need for separate remote and local access classes to Data.java in some designs and conditional code to implement locking.
Mick
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Singleton controlled

don't need to make it a Singleton.

This design removes the need for separate remote and local access classes

In your design DataAccess is your seperate local access class and DataAccessServer is your seperate remote access class. BUt you only have to override the methods that are different between the two modes.
It's kind of similar to my Beta assignment, however that was just to resolve the problem with their Interface not being complete, and having to create another interface that extends the first interface.
The big key to your design will be to see if it can accomodate all the requirements onf the assignment.
I think it should be fine.
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic