This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Hopefully my final design, comments welcome Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Hopefully my final design, comments welcome" Watch "Hopefully my final design, comments welcome" New topic
Author

Hopefully my final design, comments welcome

Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
ok here it is:
db package
All classes provided by sun. I modify instead of extend
DataInterface extends remote throws Exception. Contains all public methods
Lock Manager contains lock/unlock uses same signature as Data class.
server package
ConnectionInterface extends remote. One method getConnection returns DataInterface throws RemoteException
ConnectionFactory extends UnicastRemoteObject implements ConnectionInterface. binds to registry creates an instance of Data
RemoteDataImpl extends UnicastRemoteObject implements DataInterface

client package
StartClient acts as facade starting in local or remote mode. Boots the ClientController
LocalDataImpl implements DataInterface. wraps calls to Data class
RemoteDataClient. does lookup of connection factory, calls getConnection, passes calls via DataInterface
ClientController. Holds all ActionListeners for Gui. Boots ClientModel passes model into constructor of GUI
ClientGui the view for the application.
ClientModel extends AbstractTableModel holds the display data.
I am using JMenu although it doesn't do much. JTabbedPane to hold search and booking panes.
JComboboxes for the origins and destinations.
Just getting this far has taught me alot, so even though there have been frustrating moments, I do believe I will be a better programmer/developer after completing this exam
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
Server and db side looks really good. I would have only lock/unlock/modify pass through methods in the LockManager instead of all the methods in the Data class.
I am not really able to follow your client side design. Can you elaborate so that I can give you my comments? May be you are not to that point yet in the client design. Anyway...good luck
Nigel Browne
Ranch Hand

Joined: May 15, 2001
Posts: 673
Ok I'll try to explain the client side a little better.
The user uses the StartClient class with either the arguments: local db.db or rmi <ipaddress> <port>. This class then initializes either a local or remote implementation of the DataInterface.
It then passes this instance into the ClientController class. The controller then creates a ClientModel instance passing in the column headers from the database. It then does a default query populating the model. This is so that I can run a method to populate Vectors of the origin and desination airports. These vectors and the model instance are passed to the constructor of the ClientGui so as to create the view of the application.
The controller class has anonymous innerclasses that handle all functionality of the view components. It also has a search database and then refresh view method, as well as the book flights method.
The gui class just initializes the components made visible to the user but doesn't perform any functionality.
As a reply to your previous mail my Lock Manager class only has lock and unlock methods. I was thinking of modifying Data so that add, modify and delete always lock and unlock. Do you think this is a good idea?
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
This class then initializes either a local or remote implementation of the DataInterface.
I assume here you use a factory and a client side proxy class
Rest of the gui design looks good. I am sure you will change it a bit when you implement it.
was thinking of modifying Data so that add, modify and delete always lock and unlock. Do you think this is a good idea?
As long as the add() and delete() methods in the Data class are synchronized, I wouldn't worry about locking the record for add and delete.
But to modify a particular record, you need to think in this flow, lock/read/modify/unlock. Some people have one method to take care of this sequence. I have the modify() in my LockManager to check to make sure the record is modified by the client who locked it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hopefully my final design, comments welcome