• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How does this sound for Client design?

 
Matt Ghiold
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thought's, Comments, Critism very welcome.

The client was designed to allow for easy upgrading and maintainability. The overall design of the client is in the spirit of the MVC design pattern. The following interfaces were created to allow for maximum flexibility. The FlyByNightViewIntf represents the view interface, the FlyByNightCtrlIntf represents the controller interface and the DataModelIntf represents the model.
The view implementation FlyByNightViewImpl has a helper class in FlyByNightGui to provide the actual components for the user interface. The FlyByNightGui class acts in an observer pattern with the view in that the view registers itself with the GUI and the GUI notifies the view of events the user attempts. Then, the view will notify the controller that an event has taken
place and wait for instructions on how to proceed. If a booking is requested the controller will submit the request on the views behalf and notify the view of the results as these requests will normally result in modification of the data and this is traditionally the controllers responsibility. The view will then be instructed by the controller to obtain the data to comply with the user's request and display the appropriate screen or dialogue message. All requests will be submitted to the DataMgmtFacade facade interface that hides the underlying complexity of booking from the front end. The facade also provides methods for obtaining any an all data on a flight or flights. By hiding the back end functionality from the client I hide a layer of complexity from the client system which should allow for flexibility and upgrades in the future. I chose to use inner classes to handle the various events that would be triggered.
I created the searching functionality to be user friendly. To this, I used combo boxes to represent the unique data for each valid search criteria which is loaded on the client start up. This removes the possibility of end users creating a typo in a search field.
I also created booking to be user friendly. I made booking work off of table selection at any time, so that when the user would like to book a flight they just need to click on the flight desired in the bottom table, the data will be populated and the client will wait for seats to be requested.
There was also some flexibility built into the overall GUI. I use a card layout to hold the main view for the end user. If a new piece of front end functionality was needed to display, it could be placed into the card layout, associated with a name and in terms of display the job is done. This allows you to treat each view independantely of the other.
Finally, I decided to create my own table model implementation in FlightTableDataModel. This allows me to easily update and load the table with flight data.

Thank's again, almost there...
[ January 09, 2003: Message edited by: Mark Spritzler ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Matt, I too the liberty to change your CODE tag to a QUOTE tag so it was more readable.
Mark
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My only questions are;
1. Why use the Card Layout? The GUI is really just one screen.
2. Why do you have three interfaces for your front end?
3. Is your view going out and getting the data/model? meanine does this mean that your view knows about the model? If so then it might be too tightly coupled.
Mark
 
Matt Ghiold
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Matt, I too the liberty to change your CODE tag to a QUOTE tag so it was more readable.

Thank you!

1. Why use the Card Layout? The GUI is really just one screen.

I used the card layout to allow for the interchaning of 2 screens booking and searching
for flights. The gui holds the panels that display these screens.

2. Why do you have three interfaces for your front end?

I actually have 4
1. The view
2. The controller
3. The model
4. The facade
I think this allows for a lot of flexibility as you can create new views and controllers and such and as long as you implement the interface your are ok.

3. Is your view going out and getting the data/model? meanine does this mean that your view knows about the model? If so then it might be too tightly coupled.

The view has no clue about the model, instead it talks to a DataMgmtFacade class and then this class talk's to the model on the view's behalf.
Thoughts?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The view has no clue about the model, instead it talks to a DataMgmtFacade class and then this class talk's to the model on the view's behalf.

So then in this case the view knows about the DataMgmtFacade?
Which is actually a model too.
Mark
 
Matt Ghiold
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would think it's a facade to the model, but I think you are right in term's of the view, it is a model.
The view takes it's facade as a constructor argument by the FlyByNightClient class, so I don't there is much coupling there...
Thoughts?
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Really what I mean by it is the view is doing more than just displaying itself. I also meant that the Facade is the Model, or say access to the Data. The view is not a Model and shouldn't be.
And even though the view only has a Facade reference passed to it, it still knows about the Facade and all the methods that it can call, that is where it is coupled, the logic in the view has to change if you replace the Facade with a completely different class. So the maintenance of the class when changes are made are high.
Hope that helps
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic