Meaningless Drivel is fun!*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Design Review 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 "Design Review" Watch "Design Review" New topic
Author

Design Review

Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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

Joined: Nov 22, 2008
Posts: 18944
Ranchers Please help
-Amish
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
Ranchers Please help!
-Amish
aadhi agathi
Ranch Hand

Joined: Apr 29, 2002
Posts: 263
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 ]

Aadhi
Anonymous
Ranch Hand

Joined: Nov 22, 2008
Posts: 18944
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Design Review
 
Similar Threads
RemoteDataInterface and DataInterface
why do we need RemoteInterface?
Initial design review
Overall Architecture
Can I Defend this Design? Help Peter, Mark