• 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

Advice about db interface

 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Need some advice about the interface for the data access class in this assignment.
(a) Is this interface the same one that must be respected in the network layer and on the client side to call the data layer through the network layer?
or
(b) is this interface just for the data layer, allowing one to change the function calls in the network layer to make it easier for client? The reason I'm asking is:
(1) I thought the 3 layers are supposed to be independent tiers, so 1 could change the front end component with a different GUI layer, if needed.
or
(2) is (1) not a requirement?
The reason I'm asking is all functions in my interface use arrays and not objects, for example, was hoping to create a room reservation class and pass along network. My difficulty at mom. is I'm presently having difficulty wondering do I even need to create a room reservation class, since it mightn't even be passed along network.
Thanks.
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Mark,

It is certainly the interface for your Data access class, otherwise you will fail automatically. I don't think you can use that interface for your network layer, because no method is throwing the RemoteException for example. So you will have to create another interface and it's your choice to keep the same method signatures as sun's interface (but with the RemoteException) or create some kind of business interface (with methods like findRooms or bookRoom for example).

Your approach will be fully dependent on the answer to the question "will you expose lock methods to the client?". There is 1 big discussion which you can find here.

I followed the approach with the business service: my interface had just 2 methods and I used a transfer object to let the room data travel from server to client and from client to server. I also clarified this decision in my choices.txt

Kind regards,
Roel
 
Bartender
Posts: 2292
3
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Howdy, Mark!

I'm with my good buddy Roel. But just one comment, the implementation of your remote interface will end up using the Data class (for more details of how it can be done, please take a look here). What I did is, I created an interface with the same methods of the interface that is provided in the assignment. For instance, only a few methods of it have to be used. But what if tomorrow they decide to add the functionality of creating records? If so, your interface is already prepared. Then, for my business interface, I just added, like 5 methods, including bookRoom and search. These methods use the remote interface implementation, which uses the Data class.
 
Mark O' Sullivan
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cheers, Thanks for your kind replies.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic