• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

My Package Approach

 
Dan Burke
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, i'm nearly ready to submit. Approach to packages is quite simple.

I have 2 packages, 1 for the client and 1 for the database. Other ppl seem to have broken this up into network and business as well. My question to those of you who has is why? Whats wrong with my approach?

Dan
 
Eiji Seki
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, that may look odd, but it really depends on your design. You could end up with just two packages if the network part is encapsulated inside the data or business layers. Personally, I expect about 4 packages: business, gui, data and network.
 
Dan Burke
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Eiji.

I'm going to break up my packages..it does make sense.

On this topic though, I have a class that is needed in multiple packages. At the moment, ive gotten around this by:

- setting the package in the source code to package A
- compiling it
- changing the package in the source to package B and then compiling it again.

Is there a better way of doing this? i must be missing something
 
Eiji Seki
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hmm, this is very strange. You should never need to do something like that.
You have plenty of options instead:

1) Make sure the class is not a design problem.

2) Make sure you should not have one sepparate class for each package.

3) Make sure the class should not be in a separate package like suncertify.util or simply suncertify. This way every other package may reference it.
 
Dan Burke
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've changed the class so that it is in the suncertify package. It is a gui component, so the gui classes (which are in sub packages) now import the class.

thanks.
 
Eiji Seki
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hmm... so maybe the class should be in the gui package
something like this:

suncertify.gui
suncertify.gui.client
suncertify.gui.server
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic