• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

"data access class" - B&S

 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm doing B&S at the moment and my spec mentions a "Data Access Class". This must implement a given interface - "DBAccess".

But what is the meaning of "Data Access Class"?

Does it mean the class which must implement this interface is the one manipulating database I/O, at the file level?

Or does it mean that this interface must be the one exposed to remote and local GUI's?

My current project contains a DataFileAccessor class and LockingManager class inside the Data class. I'm considering building another layer on top of this, so communication with the GUI is done via container objects (Record objects, as opposed to String arrays).
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

What about the "call sequence":

GUI-> (controller || connector) -> (local || remote data access facade) -> your data access, that implements Db-access?
There can be many various design decisions, but I see data access implementation just as DAO or domain layer for the persistance (in each case on the server behind business logic (server too) and can't be called from GUI)...

Best regards...
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Does it mean the class which must implement this interface is the one manipulating database I/O, at the file level?



Yes.

You have to provide intermediate classes that use this data access class. (between the gui and this Data access class). In the local client (stand alone client), this intermediate class would call the methods of the data.java class directly (as the db file is on the same machine), but when the client is in networked mode, the calls from the gui have to be passed on to the server over sockets/rmi.

The server will then execute the request using his data.java class.

cheers,
chris
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe he was asking whether the DBAccess file has to be the one that does file IO, or is it acceptable to use it as a facade, with a DataFileAccess class containing the actual reads/writes to the file (as in Monkhouse & Camberlengo). I'm also slightly worried whether this approach fulfils the requirement of:

"Your data access class 'x' must be in a package called 'y' and must implement the following interface"



Is the class the "data access class" if it only a facade?
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Matthew Undy:
I believe he was asking whether the DBAccess file has to be the one that does file IO, or is it acceptable to use it as a facade, with a DataFileAccess class containing the actual reads/writes to the file (as in Monkhouse & Camberlengo). I'm also slightly worried whether this approach fulfils the requirement of:



Is the class the "data access class" if it only a facade?



Yes.
I think both are correct. If it delegates the access to the file or not is part of your choices. The facade solution splits the responsabilities of reserving and filemanagment to two separated classes.
 
Xabier Martija
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Mickey Mulligan:
I'm doing B&S at the moment and my spec mentions a "Data Access Class". This must implement a given interface - "DBAccess".

But what is the meaning of "Data Access Class"?

Does it mean the class which must implement this interface is the one manipulating database I/O, at the file level?

Or does it mean that this interface must be the one exposed to remote and local GUI's?



I would not expose the class directly to the gui since you sould throw remote exception changing the interface. An intermediate class sould call the DBAccess class.
 
Is that a spider in your hair? Here, threaten it with this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic