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

Remote/Local Db class

 
Matt Ghiold
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,
In regards to the instructions where sun indicates you should have a local and remote db class. I find that to be redundant. If you have
a local and remote facade, your db class can be the same and not need any additional changes.
Is this a valid solution? Or do I need to copy and paste the local data class to a remote data class.
Thoughts?
 
Mag Hoehme
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Matt,
it is fine if it works! I did it in a similar way (and got away with it).
Hope this helps.
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This requirement is there to nudge you in a specific direction with regard to your design choices. In another thread I wrote this about it:
Ha! Any excuse to whip out my generic 3-tier architecture template[tm] will do.
GUI <==> business logic <==> database
There are three layers, with two interfaces to separate them. The most natural way to implement your application is to make the RMI interface correspond to one of the two interfaces above.
So there are two possible choices.
The requirement that you must have a client-side class that implements the public methods from Data means that Sun forces you into one specific choice. They force you to make the business <==> database interface your RMI interface. Because if you'd make it the GUI <==> business interface, i.e. implement your business logic on the server, then having a Data-like object in the client would be useless and in fact simply bad object design.
This choice they force you into is also implied in the requirement that your code needs to be as reusable as possible. After all, Data is fully generic and reusable. A well-written database server will also be fully generic and reusable. However, if you'd implement the business logic on the server, your server tier would suddenly be application specific and non-reusable (unless you reinvent EJBs). So from a reusability point of view, the first choice makes much more sense.
You appear to have made the GUI <==> business logic interface your client/server split. Ignore the instructions at your own peril. Yes, you will no doubt pass if you implement this architecture correctly, but perhaps not with the score you would otherwise have got.
- Peter
 
Matt Ghiold
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank's for the advice guys, I think I will go
refactor my dataclass as suggested. That would solve one of my other icky feelings I was having about thread safety, if I make the data class server it removes an issue I had in the back of my mind.
Thanks again!!
-Matt
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic