• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Database Access Class

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

Hope I'm making some sense!
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.

Which solution is supposed? Which is better?

Thanks Petr
 
hangman
Posts: 220
Angular Framework Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic