This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
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:My architecture(Please review and give me some suggestion)

 
HaoZhe Xu
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[code]:
Starter.class - include main method, start the server or client(2 mode)
[code\suncertify]:
Client.class - invoked by Starter, has a ClientGUI object which is
displayed on the screen, get the mode String from Starter,
set different DB Accessor implementantion to the ClientGUI
according to the mode
ClientGUI.class - Client GUI, has a interface object DBAccessor, which will
be pointed to an implementantion of DBAccessor given by
Client.class
Server.class - Server class, has GUI, allow the user specify the path of
the database file.
ClientTableModel.class - Client table model
[code\suncertify\db]:
DBMain.class - interface which defined basic database accessing methods
Data.class - fully implemented DBMain interface for local database file
accessing
DBAccessor.class - interface defined basic database accessing methods that
is used in the assignment
DBLocalAccessor.class - class implements DBAccessor, it has a Data object
used to access local database
DBRemoteAccessor.class - class implements DBAccessor, it has a
DBRemoteOperationItf object used to access the
remote database by using RMI
DBRemoteOperationItf.class - interface defined remote operation
DBRemoteOperationImpl.class - class implements DBRemoteOperationItf
RecordNotFoundException.class
DuplicateKeyException.class
I think that's all, is it messy? is there anything wrong or not properly yet? Give me some suggestion about it, and I still don't know where to place the Stub and Skeleton class?
Thanks a lot.
 
Jay Bromley
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HaoZhe,
While like most things in the SCJD there aren't necessarily right/wrong answers, but rather answers that are more or less well justified, I think I could make a couple of comments about your package structure.
The number of classes in the assignment is not great, but I am still dividing my packages along functional lines. So, I have
  • suncertify/db - classes for the database server, DB, Data, DataIO, DataSchema
  • suncertify/services - business layer classes, basically just the interface with book, unbook, and search, and the implementing class
  • suncertify/gui - GUI classes, including the AppLauncher
  • suncertify/rmi - RMI related classes (and stubs)
  • suncertify/util - miscellaneous helper classes (this may be integrated into the other packages and go away)


  • Of course, your mileage may vary.
    One note, you mention skeletons, but remember, if you are using Java 2 1.4 the skeletons are no longer needed, just the stubs.
    Hope that helps, regards,
    Jay
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic