• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Final Design Please help

 
Farouk Mohamed1
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
The following is my design for the assignment can you please give your views please
UserInterface:
FBNClient - Client Interface for Flight Information
FlightInformationManager -
* This Manager acts as a Facade to the system and has all major system operations as a method
* (eg. getFlightDetailsMatching(String Criteria)
* This manager is a Factory aswell for creating connections based on client selection (Local or Remote)
Databeans:
SearchCriteriaBean -
* This Bean is used for holding the search Information and gives a easy Interface for creating a search Criteria method getSearchCriteria() returns a String with SearchCriteria
FlightInformationBean -
* This Bean is used for holding Flight Information and gives a easy Interface for retrieving specific information
* say getFlightID() will get the application the flight ID without iterating throught the Data Info record.
* Essentially a place hodler object for DataInfo
FlightInformationBeans -
* This Bean is used for holding a list of FlightInformationBean and gives a easy Interface for retrieving specific information from different FlightInformationBean say flight informationBean.getFlightID() will get the application the flight ID without iterating throught the Data Info record of the Bean.
BookingInformationBean -
* This Bean is used for holding Flight Booking Information
* i) No of Seats reqauired
* ii)Flight ID
SessionInformationBean -
* This Bean is used for holding the Session Information and gives a easy Interface for getting Connection
* This is a one place store for all the session related information, like Remote or Local connection etc..

Server:
ConnectionInterface
connect(),disconnect(), getConnection()
LocalConnection implements ConnectionInterface
connect() - returns a LocalConnection singleton instance
getConnection() - returns a LocalData (DataInterface)
RemoteConnection implements COnnectionInterface
connect - returns a RemoteConnection registry object
getConnection() - returns a RemoteData (DataInterface)
DataInterface (Wrapper for Data)
All public methods of Data
LocalData implements DataInterface
redirects all messages to Data instance
RemoteData implements DataInterface
redirects all messages to Lock Manager and Data Instance held in RemoteConnection
Database:
Data
DatabaseException
DataInfo
FieldInfo
Please can you all give your honest and humble opinion and ideas on this design please
Your help will be greatly appreciated
Farouk
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I like it. If it works and you can defend it, then it should easily pass. You have a lot of similarities to mine, and I like the Facade and the factory, I did the same, except as two different classes, but that doesn't matter.
Mark
 
Farouk Mohamed1
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mark for your immediate reply
I have a LocalConnection just to have a same api for getting connection in both Remote and Local did you have the same.?
I am confused how to package these things together
The LocalConnection and Local Data gives the most problem.
I decide to have the following
suncertify.client:FBNApp,FlightInformationManger,FBNTableModel,All Databeans
suncertify.db: Data,DatabaseException,DataInfo,FieldInfo
suncertify.server: LockManager,LocakInformation,RMIServer(swingApp),RemoteConnection,RemoteData,RemoteConnectionInterface,
RemoteDataInterface
suncertify.shared: ConnectionInterface,DataInterface
Confusions:
I plan to have client.jar and server.jar
1. Where will LocalConnection,LocalData go in suncertify.server or suncertify.client packages
2. Should I have to include datainfo ,fieldInfo ,data ,Data
in both client.jar and server.jar they are used by only LocalData object.
Peter are you very busy?
Please mark
Farouk
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
>>"I have a LocalConnection just to have a same api for getting >>connection in both Remote and Local did you have the same.?"
No I didn't. I have a ConnectionFactoryEngine class that gets bound into the Registry. That is the only class I have that has a getConnection method. It returns an instance of a RemoteDataAccess class the inherits from the DataAccess Interface.
On the client, I have a DataAccessFactory class that takes a parameter of a URL. If there is no value I know it is local and just return an instance of DataAccessLocal, if there is a URL I lookup the ConnectionFactoryEngine class and call getConnection to return an instance of DataAccessRemote. So an instance of a DataAccess implementing class gets returned to the client, and the client doesn't need to know how it got it, just that it now has a class that by contract follows the DataAccess Interface.
I then pass this to the constructor of my DataAccessFacade class. So now the client only has to deal with the simple methods of the Facade class.
So for my jar files I only need to include the Local version of Data Access in the client.jar. The remote version stays in the server.jar, but it's stub and skeleton also go into the client.jar.
I think that your LocalConnection should only need to be in the client.jar. Sorry that's not what you asked
You asked:
>>1. Where will LocalConnection,LocalData go in >>suncertify.server or suncertify.client packages
by the looks of you packages, I would say the client before the server package. It seems cleaner, but how does that affect your jar files? tough question
>>2. Should I have to include datainfo ,fieldInfo ,data ,Data
>>in both client.jar and server.jar they are used by only >>LocalData object.
I put them in both client.jar and server.jar
Hope this helps more than confuses, I know I am.
Mark
 
Martin Habicht
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Farouk and Mark
i'm just working on the architecture of the modules. so I can't provide a well-thought and tested design, but here are my thoughts... (hoping this helps more than it confuses )
In general your design looks very nice. I didn't plan on using so many classes (Design pattern: Keep it Simple ), but yours probably looks nicer.

a) DataBeans: are they really needed? I thought of just useing a FlightTableModel, which holds all record. Not sure yet whether I want to apply a filter (for user selection of origin and dest), so a selection doesen't drops records out of the model or rather implement a simpler aproach of reloading the model from the db evertime a selection is made (using criteriaFind(...)).

b)DataInterface: which Exceptions do you throw? DatabaseException and RemoteException? I also have a DataInterface for local and remote use: it is implemented by Data and RemoteData, which redirects all calls to a Data instance. So it looks pretty much the same as yours.

c) LockManager?!? can't I just implement lock() and unlock() in Data? I guess therefore only one instance needs to be guaranteed - how? Using a Singleton pattern might not work across multiple VM's?

d) Server: you made a GUI-Server? Wow! I used a simple Server class, that basically creates a RemoteData (which holds the Data instance) and put in on the RMI registry. Istn't this enough?

e) .jar files: I also plan two jars (client.jar and server.jar), but use only 3 packages (db is shared).

f) I like the Factory for creating a Connection, but wouldn't it be possible to simply implement 2 methods somewhere on the client side like:
DataInterface getLocalConnection(String db-file-path);
DataInterface getRemoteConnection(String host [,port?] [,path?]);

ok, that's enough for now
- Martin

PS: Farouk, I hope your nice design didn't get screwed with those brut force aproaches...
 
Farouk Mohamed1
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks very much Mark,
I really really appreciate your reply, I think having LocalConnection is unnecessarily complicating things and not very important , i think i will follow the way you did without it.
Many thanks
Farouk
 
Farouk Mohamed1
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Martin
Thanks for your time and comments I really appreciate
a) DataBeans: are they really needed?
Databeans is needed as they work as wrappers for DataInfo otherwise we have to keep on iterating over DataInfo to get specific information.
In my case I use list boxed for searching and using dataBeans
FlightInformationBean and FlightInformationBeans provides me a easy interface for retriving details like FlightId and a list of distinct FlightIds
b)DataInterface: which Exceptions do you throw? DatabaseException and RemoteException?
Yes the same i have a LocalData and a RemoteData and Data doesn not throw RemoteException
c) LockManager?!? can't I just implement lock() and unlock() in Data? That is a design Issues, i dont have a singleton LockManager has it will be required by different databases ,and that is also why i have a separate connectionInterface on the server with a getConnection method instead of client so that the RemoteConnection acts like a factory for RemoteData

d) Server: you made a GUI-Server? Wow! I used a simple Server class, that basically creates a RemoteData (which holds the Data instance) and put in on the RMI registry. Istn't this enough?
RemoteData is not in myt design the registry object and for ease of use i provided a fileChooser for selecting the database file remotely
e) .jar files: I also plan two jars (client.jar and server.jar), but use only 3 packages (db is shared).

f) I like the Factory for creating a Connection, but wouldn't it be possible to simply implement 2 methods somewhere on the client side like:
DataInterface getLocalConnection(String db-file-path);
DataInterface getRemoteConnection(String host [,port?] [,path?]);
It is not possible in my casse as the registry object is a factory of remote objects and not remoteData itself
Your comments pelase
Farouk
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic