wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Basic Design Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Basic Design" Watch "Basic Design" New topic
Author

Basic Design

Sowjanya Raghu
Greenhorn

Joined: Oct 29, 2000
Posts: 17
Hi,
I have come up with the following design.
Any suggestions/comments would be welcome.

interface DataInterface //Used for local mode and has all the public methods of Data.
class FBNData extends Data implements DataInterface
interface RemoteDataInterface extends DataInterface,Remote
//Used for Remote mode.Has the same methods as DataInterface but they throw RemoteException.
class RemoteData implements RemoteDataInterface //This has a reference to FBNData
I am also planning to have a factory class called FBNFactory which might return the appropriate instance depending on the mode (local/remote)to the GUI.
At the moment, I am worried about the interfaces DataInterface and RemoteDataInterface. The duplication of methods in them.Ofcourse they throw different exceptions.
Is there a way to get around that problem.
And then locking...should we implement locks in the local mode as well.
Thanks in advance.
Cheers,
Sowjanya

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Basic Design