GeeCON Prague 2014*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes About client-server interaction... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "About client-server interaction..." Watch "About client-server interaction..." New topic
Author

About client-server interaction...

Andrea Gazzarini
Ranch Hand

Joined: Sep 09, 2002
Posts: 125
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...


Regards,<br />Andrea<br /> <br /><a href="http://www.linkedin.com/in/andreagazzarini" target="_blank" rel="nofollow">Andrea Gazzarini</a><br />Skype ID : gazzax72<br />Google Talk ID : a.gazzarini@gmail.com<br /><a href="http://www.andreagazzarini.blogspot.com" target="_blank" rel="nofollow">My Blog</a>
Max Habibi
town drunk
( and author)
Sheriff

Joined: Jun 27, 2002
Posts: 4118
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


Java Regular Expressions
Andrea Gazzarini
Ranch Hand

Joined: Sep 09, 2002
Posts: 125
Thanks Max...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: About client-server interaction...