• 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

Design Review

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello All,
The following is the design that I am able to come up with. Please give me your comments, I will really appreciate it.
* public interface DataInterface (has all the methods of Data, also the methods over here throw RemoteException)
* public interface RemoteDataInterface extends DataInterface & Remote
* public class RemoteData extends UnicastRemoteObject implements RemoteDataInterface ( here I will have an instance of Data and LockManager)
* public class LocalData implements DataInterface also have an instance of Data
* public interface Connection
* public class RemoteConnection implements Connection & extends UnicastRemoteObject. (Over here given a location I will look into a Map to see if a RemoteData already exist for this loc, if it does return the same RemoteData/Lock or else create new ones)
* public class LocalConnection implements Connection
* ConnectionFactory returns a connection based on the user's request.
Also I am planning to modify the Data object rather than extending it.
Please comment on my design!
Thank You very much!
Amish
[ January 25, 2003: Message edited by: Amish Patel ]
[ January 26, 2003: Message edited by: Amish Patel ]
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ranchers Please help
-Amish
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ranchers Please help!
-Amish
 
Ranch Hand
Posts: 263
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Amish Patel:

* public class LocalData implements DataInterface also have an instance of Data
[ January 26, 2003: Message edited by: Amish Patel ]


what is the need for having a LocalData. is it not the LocalData, the actual Data itself.

Originally posted by Amish Patel:

* public interface Connection
* public class RemoteConnection implements Connection & extends UnicastRemoteObject. (Over here given a location I will look into a Map to see if a RemoteData already exist for this loc, if it does return the same RemoteData/Lock or else create new ones)


what is the rationale behind creating some kind of Connection class ?? will it be a reusbale one(the Connection class).what i mean is, will the client be coding for the Connection interface?. IMHO, the client should not be required to know about things unless otherwise it is absolutely required to fullfill a functionality.
hope this helps.
[ January 28, 2003: Message edited by: aadhi agathi ]
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,
Client will know about the connection interface. Regardless of the mode I am in, the client will
need to know about the connection interface. My Factory will either return a local connection which will have a LocalData underneath its skin or a RemoteConnection which will have
RemoteData underneath its skin. The need I justified is in order to read, write to the db.db the user needs to connect to it first and then using that connection the user can get hold of either RemoteData or LocalData.
-Amish

Originally posted by aadhi agathi:

what is the rationale behind creating some kind of Connection class ?? will it be a reusbale one(the Connection class).what i mean is, will the client be coding for the Connection interface?. IMHO, the client should not be required to know about things unless otherwise it is absolutely required to fullfill a functionality.
hope this helps.
[ January 28, 2003: Message edited by: aadhi agathi ]

reply
    Bookmark Topic Watch Topic
  • New Topic