Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with packaging a client-server application! 1

Status
Not open for further replies.

frag

Programmer
Dec 7, 2000
321
0
0
GB
Hi!

I have a problem with packaging a client-server appliciation.
Actually I never have used packaging yet (except in some webapplications).

Here is my problem:
I would guess that the client and the server would get a different 'package-path' in their source files. But some source files are used by both server and client. Which package do they belong to? Can I assign them to both parts?

Any help appreciated!

Cheers

frag

patrick.metz@epost.de
 
Not sure what your question means. If you are referring to the package for your classes:
Code:
package com.frag.util ;
public class myclass{…}
then you definitely want a class to be in only one package. Your method of deployment can vary but you only want a class to belong to a single package.


-pete
 
You could think about having three packages - one for the client, one for the server, and one which holds 'common' classes. Then deploy the common package alongside the client and server packages (assuming they are on different boxes) ...
 
@palbano:
I know how to put a class in a package, but thanks anyway. :)

@sedj:
That tip was what I was looking for. Thank you very much. Do you want to become my personal trainer? ;-) Three of my problems solved in a row... which gives you another star!

Cheers

frag

patrick.metz@epost.de
 
I'd also strongly recommend sedj's approach. I had to a similar stuff a year back and this is what I did:
I divided the application into several modules, each representing a solid functionality that can be exposed to the outside world on its own without any dependency on other modules. Then, I segregated the sources for each module under three packages: client, common and server.
For client side deployment: client + common packages of all modules
For server side deployment: server + common packages of all modules.

Hope this helps.


Ganesh
If you find my post really helpful, please record it by clicking the purple star below.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top