Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Client Server Packaging !

 
Vikas Sood
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI friends,
I am in the initial stages of my assignment and am a bit confused about the structure of client , server and db packages and also about the contents of client and server executable jar files.
I am thinking of putting the Data and support files along with db.db file in the db package and will include this package with both the client.jar and server .jar files along with the requisite client and server packages.
My structure is as follows:-
Client package contains:
DataClient
ServerPackage contains:
RemoteData (impl class)
RemoteDataService (remote interface)
db package contains:
Data
DataInfo
FieldInfo
DatabaseException
LockHandler
CriteriaFinder
db.db

Client.jar will have both the db and client package,while server.jar will have both the db and server package.Is this the right approach pls do send in ur inputs.
Thankx for reading this msg,
VikasSood
 
Pete Lyons
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vikas,
That looks fine. Just make sure your package names are all lowercase. Also, moving db.db up to the root directory would probably be simpler so you could hardcode a default location just using the filename as opposed a path which involves File.separator, and most java projects I've seen try to keep the source code isolated with the exception of package.html (thanks, Sun!). Finally, I would imagine the client jar would need the code in the server package as well, unless you're doing dynamic class loading, which I would not recommend.
Pete
 
Vikas Sood
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pete,
thankx for ur reply.
I was also thinking of puting my db.db file at a diffrent location than inside the db package,so as to make the db package more generic,and also as u have mentioned i can straight away choose the db file directly.
As for the package names they are all lowercase as u have also suggested.And my client .jar will also have the stub required for rmi.But there is another doubt in my mind that is the contents of my client.jar will then have three packages as:
a)client package containing client classes and gui.
b)server package containing stub classes.
c)db package containing db access classes.
apart from having the db.db ile at the root.

server.jar consistes of:
a)server package containing all the server specific classes including the skeleton classes.
b)db package containing db access classes.apart from having the db.db ile at the root.
Am i right with my presumptions or am i missing something.
Vikas
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic