This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I've been digging into my brand new SCJD assignment (contractor) for the past few hours and I've come up against a little problem. My assignment refers to something called the "Database Access Class". This must implement a certain interface, DBAccess, and be named Data.
I can't work out whether this is supposed to be the class that directly read/writes to the database file or not. Can it use another class to access the database file? I'm looking to do something like...
ContractorInformationManagementFacade has-a Data Data has-a DatabaseFileReadWriter
I think you can use any subclass or delegation as far as your class with given name will implement required interface. There is no requirement on how to do it.
But I would ask some more general question. I think it is really not clear in assignment. How should client/server interface should be done. I figured out two options:
a) data interface is also a interface between client and server (some statements in assignment seems to require this, but not in clear way..). Then I will have to implement some lock cleaning mechanism and bussines logic will be on client side
b) interface between client and server is provides bussiness methods (book() for example) that calls some sequences on data interface. This would not require lock clean up code because bussines methods would be located on server. But database interface itself will not be available through network.
Mickey: I just a have file called DBAccess.java which is really just an interface with all the methods they descbribe in the instructions, but the methods have no statments, because they are all abstract. The file has a line in it at the beginning like this:
Then I have a file called Data.java which is where I build a class "Data" that implements all these methods. It has a line in it that says:
I hope this helps. [ February 26, 2006: Message edited by: Bob Nedwor ]
SCJP - 1.4
SCJD - (B&S) Used 1.5 And It Runs On Solaris10
SCWCD - Thanks to HFSJ!!