Hi guys,
I've been playing around with different configurations of MVC for the last few days.
I tested total seperation:
class Model holds the model of the reservetion dialog
class View configures the reservation panel, has methods to configure the view(enable buttons...) and inner classes that call the controller
class controller knows the view, the model and tne buisines layer
class TravelAgent implements the busines layer (lookup airports, flights book flight
ant talks to the database
Last night i concluded that the design gets too complicated so I asked myself what this effort is good for? Code reuse?
I replaced Model, View and Controller with one class:
My conclusion is that the gui component book flight is specialised and code reuse is no issue. Tje Busines Layer is well encapsulated - so I started to encapsulate the GUI:
class Reservationpane is a encapsulated reusable component that only has to be given a TravelAgent and to be placed somewhere in the GUI to work.
It sets up the Gui, and iplements the controller with inner classes, that ocasionally call methods to make the implementation cleaner:
what do you think about this solution
Bern