Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

NX:My architecture(Please review and give me some suggestion)  RSS feed

HaoZhe Xu
Ranch Hand
Posts: 222
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Starter.class - include main method, start the server or client(2 mode)
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
Server.class - Server class, has GUI, allow the user specify the path of
the database file.
ClientTableModel.class - Client table model
DBMain.class - interface which defined basic database accessing methods
Data.class - fully implemented DBMain interface for local database file
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
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
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,
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!