SCJP, SCJD, SCWCD<br />"Meekness is not weakness, but power under control"
The network call can take some time, especially in an internet/VPN environment. Are you using worker threads to keep the GUI responsive?Originally posted by Chiji Nwankwo:
BookingDialog (modal) - shows the user a snapshot of the flight details and number of seats entered and gives the user the option to either cancel or make a booking.
Have you considered that it may not be clear to the operator whether a flight is fully booked or whether (s)he just mistyped origin or destination?[... a flight is] removed from the table completely if all the seats are booked.
What is the rationale behind this? Wouldn't it be much simpler and just as effective to have Data (or DataExtensionImpl), and (the RMI stub of) some server-side object which implements the same interface, and use that?DataClient [...] AbstractDataClient [...] LocalDataClient [...] RemoteDataClient
What benefit does this factory class give you over just having some code related to your connection dialog that instantiates the right flavour of object?DataClientFactory
TravelAgent - serves as a facade to the DataClient instances, providing business methods like, searchFlights, bookFlights
What's your rationale for introducing this above and beyond the bog standard TableModel, TableModelListener and TableModelEvent?[QB]ClientModel - provides an interface, which the view accesses in order to update itself. [...] a ClientEvent is sent to all this models ClientListeners.
What is the benefit? Do you anticipate having multiple implementations of this interface anytime soon?DefaultClientModel
What is your rationale for not simply incorporating the criteriaFind method into Data?DataExtension - is an interface that contains all the public / protected methods, which are contained within the provided Data class as well as criteriaFind.
Are you aware that the presence of a GUI makes it impossible to deploy the server on many Unix server systems? Often these do not have a graphical terminal attached to them simply because there's no need whatsoever. You can run graphical applications for configuration and so forth through remote X terminals. The server processes themselves do not need and should not have a GUI; it's simply another point of failure.Server GUI:
I understand the client gets a Connection as well. Why two different objects? Can't the Connection simply implement the Data interface?DataService - remote interface that is provided to the Client
What's the rationale for using an interface?LockManager [...] LockManagerImpl
You have clearly taken design patterns and many good design practices on board, which is excellent. My beef with your design is its sheer complexity; you seem to have designed this application as if you were designing an abstract, pluggable, highly layered framework. Design patterns are a good thing, but that does not mean you should use as many of them as possible
My SCJD instructions asked for a clear design, such as will be readily understood by junior programmers. Also, I tend to subscribe to the XP mantra to make a design as complicated as is necessary to fulfil the requirements, but no more. Others succinctly refer to the KISS principle (Keep It Simple, Stupid). While I have no doubt that you will pass, probably with a fine score, if you want to get the maximum out of the learning experience I suggest you look at your design with a critical eye and trim some of the fat.
- Peter
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
The network call can take some time, especially in an internet/VPN environment. Are you using worker threads to keep the GUI responsive?
Have you considered that it may not be clear to the operator whether a flight is fully booked or whether (s)he just mistyped origin or destination?
What is the rationale behind this? Wouldn't it be much simpler and just as effective to have Data (or DataExtensionImpl), and (the RMI stub of) some server-side object which implements the same interface, and use that?
What benefit does this factory class give you over just having some code related to your connection dialog that instantiates the right flavour of object?
What's your rationale for introducing this above and beyond the bog standard TableModel, TableModelListener and TableModelEvent?
What is the benefit? Do you anticipate having multiple implementations of this interface anytime soon?
What is your rationale for not simply incorporating the criteriaFind method into Data?
Are you aware that the presence of a GUI makes it impossible to deploy the server on many Unix server systems? Often these do not have a graphical terminal attached to them simply because there's no need whatsoever. You can run graphical applications for configuration and so forth through remote X terminals. The server processes themselves do not need and should not have a GUI; it's simply another point of failure.
I understand the client gets a Connection as well. Why two different objects? Can't the Connection simply implement the Data interface?
What's the rationale for using an interface?
You have clearly taken design patterns and many good design practices on board, which is excellent. My beef with your design is its sheer complexity; you seem to have designed this application as if you were designing an abstract, pluggable, highly layered framework. Design patterns are a good thing, but that does not mean you should use as many of them as possible
SCJP, SCJD, SCWCD<br />"Meekness is not weakness, but power under control"
SCJP, SCJD, SCWCD<br />"Meekness is not weakness, but power under control"
Smashing.the code that handles all the gui freezing logic is started in their own threads
It is clear how it works, but it still seems to be an entire layer that could be cut out without significant functionality or flexibility loss. What prevents your business object from talking to Data directly (in local mode) or to your remote flavour of Data (in networked mode)?[Re: DataClient and friends] could you please elaborate on this point. i will try explain it the way i understande.[...]
You could simply pass the right DataClient in as a constructor argument. I would not put this code in the dialog itself -- personally, I just had a small static method in my main class that instantiated the right objects and glued them together at startup. I don't think a factory would have gained me anything there. There's simply not enough substance to it to justify yet another class.i use this class as a seemless way for the facade to request for a DataClient instance, without having to worry about whether the instance returned is a LocalDataClient or a RemoteDataClient. are you suggesting that the ConnectionDialog should contain the logic that is used to create either a Local or Remote DataClient instance?
I agree with the necessity of a ClientModel class, but does it need to be a full-blown observable? Isn't it enough to just have a getTableModel() method?my rationale behind [ClientModel] is to create a clean seperation between the view and data aspects of the GUI.
There is a profound difference between application development and framework development. In this application, I have difficulties seeing a need for a second ClientModel implementation. I would contend that reasonable future growth can be catered for by simple modification.has that possibility [of multiple ClientModel implementations] been ruled out? i thought one of the rationales behind this work was to design for reuse and to make modifications to the system relatively seemless.
Why is that a good idea?my whole idea for [DataExtension] was not to add any new features to the existing Data class.
Excellent. Be sure to put a sentence or two in your design documentation, so the assessor can see you have thought about these matters.i see the point you are making [about server GUIs]. but what if another ui was provided for the systems that do not support the GUI and instead of printing to a GUI it just printed out to the screen.
What are you trying to achieve? Are you trying to limit the number of remote objects you have to create because they are rather heavyweight? They are, but my instructions specifically said that you were not to compromise the simplicity of your design for performance reasons. Very good advice indeed. Many a system was rendered hard to maintain by premature and misdirected "optimisation". Optimisation is something you do at a later stage, with a profiler to back your theories up. But I digress.yes the client does get a connection as well. the reason i don't use the DataService is because i do not create one unique DataService instance per client. the DataServiceFactory has a maximum number of DataService instances that can be created. this means that many clients can share the same DataService instance. this is where the Connection object comes into play.
I would contend that you have achieved nothing here that could not be achieved just as easily with modification or replacement of a LockManager class that does not implement any particular interface.i created the LockManager interface to make it easy for its underlying implementation to be changed with minimal impact on the system. the LockManagerImpl is not tied to the system in any way, can be swapped out any time with another implementation and represents a generic way of dealing with locks.
Those were the only parts I had something sensible to say about. Well, something to say about, sensible or not The rest looked top notch to me.Should I assume that the only parts you commented about are the parts you had beef with or was that you limit?
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
It is clear how it works, but it still seems to be an entire layer that could be cut out without significant functionality or flexibility loss.
You could simply pass the right DataClient in as a constructor argument.
I agree with the necessity of a ClientModel class, but does it need to be a full-blown observable?
There is a profound difference between application development and framework development.
Why is that a good idea?
Excellent. Be sure to put a sentence or two in your design documentation, so the assessor can see you have thought about these matters.
What are you trying to achieve? Are you trying to limit the number of remote objects you have to create because they are rather heavyweight?
I would contend that you have achieved nothing here that could not be achieved just as easily with modification or replacement of a LockManager class that does not implement any particular interface.
SCJP, SCJD, SCWCD<br />"Meekness is not weakness, but power under control"
SCJP, SCJD, SCWCD<br />"Meekness is not weakness, but power under control"
quote:
--------------------------------------------------------------------------------
You could simply pass the right DataClient in as a constructor argument.
--------------------------------------------------------------------------------
My controller class, is aware of the fact that it has an instance of the business object and nothing else. The controller retrieves the connection mode and parameters (data name, host name or port), from the GUI and passes this information on to the business object. I reckon that the businesss should be in charge of either creating the next link in the pipeline or passing control over to an object that will. My controller class' main responsibility is to handle communications between the view and the model of the GUI. In my case the client can disconnect and reconnect from the application without restarting the application. Selecting a reconnect menu option will redisplay the original, modal, ConnectionDialog. This is one of the main reasons why I can't instatiate the right objects and glue them together at startup. My spcification says, "The user must be able to select the operating mode, although it is acceptable that the program stay in one mode once it has started up". I opted to give the user the option to disconnect from or reconnect to either a local or remote connection.
SCJP, SCJD, SCWCD<br />"Meekness is not weakness, but power under control"
Poop goes in a willow feeder. Wipe with this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|