Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

urlybird: Implementing DBAccess in RMI class

 
Mees Witteman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am working on the implementation of the urlybird assigment and I have a question about implementing the DBAccess interface.

My solution so far is that the Data class implements the DBAccess interface as is prescribed in the assignment.
Then I have written a DatabaseAdapter interface that has two methods find(anAccomodation) and reserve(anAccomodation).

I have implemented an adapter class that implements this interface and that access the Data class. My RMI implementation also implements these two methods and uses the adapter to access the Data class.

The advantage seems that only one network call is needed upon a request for find or reserve and that the logic of accessing the database is written only once.

My question is if I will lose points for not implementing the DBAccess in my RMI class, because the database functionality will only be available through my own defined interface.
 
Oricio Ocle
Ranch Hand
Posts: 284
Debian Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Mees, and welcome.
There is a mythical thread in this forum called "what methods should be callable" or something like this, if you search the forum you will find it easily. It's an extense thread but it is worth reading.
I have created a business interface too, with booking methods, in order to give a transactional behaviour to booking operations.
But given that the specs are fuzzy, i decided expose both, database (DBAccess) and business methods through a common facade. This way you ensure DBAccess clients are supported.
Regards
 
Oricio Ocle
Ranch Hand
Posts: 284
Debian Firefox Browser Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello again,
here is the link:
Should lock methods be callable by the client
Regards
 
Mees Witteman
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Oricio, thanks for your replies! I have found the thread. It is huge.
I have scanned the surface and will return there for more inspiration later on.

Kind regards,
Mees

SCJP 1.4
SCJD URLyBird (in progress)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic