Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: URLyBird - Client and Server GUI

 
Alexei Antipin
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my design the Server GUI acts as a back office and allows additional functionality comparing to client workplace. It was considered, that back office GUI must provide all the functionality of client and add features specific for administrative tasks, like adding new records and deleting records. Here is a comparative list of client and back office features:
FeatureClientBack Office (Server)
Record editingPartial, only "owner" fieldFull
Record addingNo Yes
Record deletingNo Yes
Searching Yes Yes
FiltersYes Yes
LegendYes Yes
Setup Yes Yes
It is clearly seen, that functionality in both modes is quite similar, and therefore it seems reasonable to have a common base for GUI in client and server mode. Application window for both modes is derived from MainFrame class and consist of central JTable (tableData), toolbar with a set of buttons, etc. All the components of MainFrame are made protected, so derived class could access and manipulate them. A special protected method ? jbInit ? allows derived classes to add its own controls to main frame. Protected method createTableModel allows creating different data models for dataTable.
Classes derived from MainFrame for client and back office modes ? ClientMainFrame and ServerMainFrame. They add specific for those modes controls in overridden jbInit method and install their own table models in overridden createTableModel method.
Creating of appropriate main frame complies with ?Factory? pattern.
How do you think, it this approach OK?
 
Bill Robertson
Ranch Hand
Posts: 234
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's up Alexi,

Creating of appropriate main frame complies with ?Factory? pattern.

Kinda, you are heading towards a Factory in which it hands out
you ClientMainFrame or ServerMainFrame.
But I am not comfortable with your approach. Especially if you Client
and Server class start to look the same - this should be you first hint that refactoring needs to take place. IMO, most of the projects
were designed around something similar to the following:
GUI -->GUI Controller-->Server-->Data class
Are you directly calling update, add, delete,..from your ClientMainFrame
and ServerMainFrame?
 
Jay Bromley
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Alexei,
It could be just me, but while your ideas for the server GUI sound great, I think they may be a little over the top for this assignment. First, the part about adding and deleting records is not specified by the assignment (or at least not by my assignment), and while it's not difficult, it's more work and there is no extra credit. Second, if a user wants to run a client on the machine where the server is running, why don't they just use the normal network client interface through a loopback? No additional code necessary, perhaps just a couple lines in your user's guide describing how to run a client on the server machine.
I think I know the feeling. WHen I finish this thing, I'll make a servlet or JSP web interface, then I'll replace the data layer with something using JDBC, then add an admin client to do the things you describe and ... good for learning in general, but too much for this assignment.
Regards,
Jay
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic