Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About client-server interaction...

 
Andrea Gazzarini
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my design, the Data class is fully encapsuled in a DataFactory, which is in turn used by a <Remote/Local>BusinessService that implements the interface BusinessService:
Collection findByCriteria(Criteria criteria);
Bookable book(Bookable bookable, BigInteger requested seats);
In this way, the client does not call directly the criteriaFind or getRecord method(it doesn't know anything about how the data is retrieved), but it iteracts with a command pattern which uses a remote or local BusinessService and return the business object (an object which implements the Bookable interface).
Is that design wrong?? The instructions.html says : "The remote client code should implements all the public method of the Data class".
I think the client code shouldn't know the method getRecord, criteriaFind. The server(local or remote) should must hide this details providing any method like book, findByCriteria, findByPrimaryKey, etc...
Thanks everyone...
 
Max Habibi
town drunk
( and author)
Sheriff
Posts: 4118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Andrea,
I can't be sure, but I think you're on the right track: it sounds like you're pretty much providing an Adapter pattern, which is pretty much what you want to do.
All best,
M, author
The Sun Certified Java Developer Exam with J2SE 1.4
 
Andrea Gazzarini
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Max...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic