wood burning stoves
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes clarify this pls 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 "clarify this pls" Watch "clarify this pls" New topic

clarify this pls

Kruger Scheitz
Ranch Hand

Joined: Jul 31, 2002
Posts: 72
[B]" Writing Data Client. This implementation should include a class that implements the same public methods as the Data class "[\B]
what does this mean? pls help
Mag Hoehme
Ranch Hand

Joined: Apr 07, 2002
Posts: 194
Hi Kruger,
I have the same statement in my requirements, and I am also wondering about what I am supposed to do.
My design has a GUI, a remote DataAccess.class, and a DataAccess.class with a reference to Data. DataAccess has the same public interface as Data, plus business methods such as loadAll(), book().

I feel that it is enough if DataAccess has the same public interface as Data. Tucking something like DataClient between my GUI and DataAccess seems to be an unnecessary level of indirection.
However, maybe I create an interface called DataClient. This interface is implemented by DataAccess.
Any comments on this question are welcome!

Nate Johnson
Ranch Hand

Joined: May 13, 2002
Posts: 301
Here is what I did...
GUI -> ConnectionFactory -> LocalData (that extends Data)
GUI -> ConnectionFactory -> RemoteDataFactory (on server) -> RemoteData (extends UnicastRemoteObject) and has ref to the one Data created by the RemoteServer
My ConnectionFactory returns a DataAccess interface (either RemoteData or LocalData as shown) above. This is determined based on the command line options that the client is given. My GUI also has a Facade (pattern) class that does things like booking and searching so that other developers can just call those methods rather than deal with the logic that is inside the methods.
Hope that helps
[ August 29, 2002: Message edited by: Nate Johnson ]

scwcd, scjd, scjp<br /><a href="http://natejohnson.us" target="_blank" rel="nofollow">http://natejohnson.us</a><br /><a href="http://rice.kuali.org" target="_blank" rel="nofollow">http://rice.kuali.org</a>
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

What the statement means is that you need to create an interface that has all the public methods of the Data class, you will then create two classes that implement this interface. One for Remote Access and one for Local Access.
You can then make a Facade class that wraps around a DataAccess interface and only provides methods for the GUI that make sense, like bookFlight() or getAllAirlines() or searchFlight().
But including the Facade is up to you. I highly recommend this solution though.

Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
I agree. Here's the link: http://aspose.com/file-tools
subject: clarify this pls
It's not a secret anymore!