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

comment design please

 
ralph michelsen
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello java developers
I'm aboute to submit my developer assignment, and I would very much like some comments on the design. Furthermore I have a couple of questions.
Packages:
scdeveloper.connection
* Connection <<interface>>: Factory - Network or local connection.
* Local: Makes lokal connection to database.
* Network: Makes network con. to database (RMI lookup).
* RMIRemote <<interface>>: implements Remote.
scdeveloper.data
* DataTransfer: Data carrier.
scdeveloper.db
* DataInfo: Provided by Sun
* FieldInfo: Provided by Sun
scdeveloper.exception
* DatabaseException: Provided by Sun
* ParentException: Handles all exceptions and messages to user.
scdeveloper.icons
* GetImage: Dummy class for retrieving images from jar file.
* This package holds alle images.
scdeveloper.local
* DataLocal: Modified Data class from Sun. New methods added - fx. findCriteria and so on... This class handles local connection.
scdeveloper.model
* BuildClientGUI: Builds main client gui
* BuildPanel: Helper class for building panels.
* ConnectionListener: Retrieves connection from connection interface according to user choice.
* FrameButtonListener: Listener for main client gui buttons.
* InitClient: Starts frame where user desides to connect local or network...
scdeveloper.ressoureces
* error.properties: Gets errormessages to errorpanel if error occurs.
* labels.properties: Gets all labels to client gui.
scdeveloper.rmiservice
* DataNetwork: Modified Data class from Sun. New methods added - fx. findCriteria and so on... This class handles network connection.
scdeveloper.server
* InitServer: Starts frame where user desides port number and placement of db.db
* RMIServer: Binds service (DataNetwork) to RMI registry.
scdeveloper.util
* DataLocking: Locks "write" to database both local and network. Static Singleton instance. Alle methods are Syncronized.
* Severity: Gets severity codes to indicate type of error.
* Utilities: getBundleText(...) gets alle text from bundles.
I have made two executable jar files: server.jar and client.jar.
These jar files both contain fx. FieldInfo and DataInfo in order to registre the RMI service (DataNetwork) and run the local service (DataLocal). This is not very good design is it? But is there any other way to design this. I mean I need these classes in both jar's!
Thank you...
Kind regards
Ralph Michelsen
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I question this: and it would relate to all your design and many many packages.

scdeveloper.connection
* Connection <<interface>>: Factory - Network or local connection.
* Local: Makes lokal connection to database.
* Network: Makes network con. to database (RMI lookup).
* RMIRemote <<interface>>: implements Remote.

Are you under the assumption that you need a Connection in local mode, like remote mode where you are connecting to a server? In local mode there is no server, so you will be using the data classes directly in your local, stand-alone mode.
Then I question how many packages you have and the reasoning behind it. In you model package you also have your GUI, when I hear model, I think of Model in MVC pattern. Or data for the GUI to show. The GUI itself is not a model.
While packaging is completely arbitrary, and up to the individual, making things easy for others is always the "Golden Rule" to use in your design. And I believe that this adds some complexity to another programmer that isn't needed.
In most submissions the packages are
suncertify/client
suncertify/db
suncertify/server
with maybe one or two other utility like packages.
I hope that helps and isn't too harsh here.
Mark
 
ralph michelsen
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey Mark
Thanks for your reply...
You are right, I don't need a local connection, and in fact I don't make one. If the user wants to access the local database all I do is make an instance of DataLocal (my local Data class). Connection <interface> should actually just seperate the local Data access from the RMI Data access.
Mark do you have any comments for my question regarding multible classes in the two jar files.
Sorry for my bad english, I'm from Denmark...
Regards Ralph
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will have to put the stubs and Data class into both jars. So multiple objects in the two jars is fine.
Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic