• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Connection Design

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
My design is as follows :
On the client side I have the following
Connection - Interface which defines all the methods of the data class.
RemoteConnection - Implements Connection and provides remote data access
LocalConenction - Implements Connection and provides local data access.
On the server side I have the following
RemoteConnectionFactory - Interface for a factory that creates connections
RemoteConnectionFactoryImp - Implements RemoteConnectionFactory and creates connections
ClientConnection - Interface which defines all the methods of the data class.
ClientConnectionImp - Implements the ClientConnection interface. Each client that connects will receive it's own instance of this class

My question is, should the ClientConnection interface extend the Connection interface instead of defining it's own methods, this way I could get rid of the RemoteConnection class
Any suggestions would be greatly appreciated
Brian
 
Brian Blignaut
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Anyone?
 
town drunk
( and author)
Posts: 4118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Brian,
How does a local client get a connection? Does your GUI have to be smart enough to know that it's using a local connection, or do you want provide a general Connection Factory: one that decides if it, in turn, needs a LocalConnection or a RemoteConnection? I'm not suggesting that one way or another is correct: I'd just like to hear your approach.
All best,
M, author
The Sun Certified Java Developer Exam with J2SE 1.4
 
Brian Blignaut
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The user would select what type of connection they wish to establish. And yes, I do have a connection factory is responsible for creating the actual connection.
 
Brian Blignaut
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry to answer the other question, the the GUI does not need to have any concept of what type of connection it is working with, that is totally transparent, all the GUI knows is that it has a connection (Connection Interface)
 
Ranch Hand
Posts: 127
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In my design, using MVC in GUI. Controller connects to Abstract Factory pattern which returns ConnectionFactory (Local or Remote). LocalConnection class connects to DataAdapter class which connects to Data class. RemoteConnection class connects to RMI using proxy and adapter pattern.
I didn't finish yet from coding but I think the design is alright.
Max,
I read your book. A beautiful design there. Although Nobody lost points for not implementing ClientID, I will use ClientID in my design, that's why I used Abstract Factory, proxy and adapter patterns. I think you know many members takling about unlock() method documentaiton, so it is a chance to learn something here.
Regards
 
reply
    Bookmark Topic Watch Topic
  • New Topic