Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

comment design please

 
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
 
ranger
Posts: 17346
11
Mac IntelliJ IDE 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
Posts: 17346
11
Mac IntelliJ IDE 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
 
After some pecan pie, you might want to cleanse your palatte with this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic