Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

clarify this pls

Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[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
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
Posts: 17346
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic