• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Distribution of the packages

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, for your reference, I put all classes related to GUI in the same package.
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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,
 
author and jackaroo
Posts: 12200
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic