• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Distribution of the packages

 
Gerenne Vives
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello ,

I have a doubt about the distribution of the packages with respect to the server.

I explain us: I want to do a small interface graphic for the server. I have the distribution to the package to the following form:

-suncertify.db
-suncertify.gui
-suncertify.networked

My quiestion is , If I start the server on the one hand and on the other hand the client.I must put the classes of the server in packages differents from those from the client.

Thanks in advance.
 
Steve Taiwan
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, for your reference, I put all classes related to GUI in the same package.
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what about making packages suncertify.gui.client and suncertify.gui.server to contain code that's not shared between client and server?
 
Gerenne Vives
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
indeed , this is my question , that I don,t Know if is correct that I put the classes in the same packages if don't share code,
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Irene,

From the Sun Creating and Using Packages tutorial:
Definition: A package is a collection of related classes and interfaces providing access protection and namespace management.


Classes do not have to share code to belong in the same package. A package can be thought of as a logical grouping of classes - so I could decide that I might throw Sockets based code and RMI based code into my suncertify.network package, even though they do not share code. This can work well with a small project like the SCJD assignment.

For a larger assignment you might want to consider breaking down the package responsibilities further. So you might want to have suncertify.network.Sockets for pure Socket based code, and suncertify.network.RMI for RMI based code, and any common code (e.g. a Factory) in the common directory.

Regards, Andrew
 
Gerenne Vives
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok , this means that it isn,t problem to use the same packages for the server and for the client , always that these classes have a logical relation (bd , networked...)

Irene.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic