• 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

coupling between client and server Packages.

 
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
In my design there are 3 packages..

suncertify.db
suncertify.client
suncertify.server


All the necessary classes for the rmi is in the suncertify.server package.
It works fine with the remote mode because of the dynamic code downloading.
Now if I try to connect through the local mode, my client requires the
suncertify.server package. so my client and server packages are tightly coupled
and this is because I've used a common interface (RemoteData which extends java.rmi.Remote)
for both modes.
or i can say that my client will not work without the server package.

Is this the right way to do that because now I feel that the client and
server pcakages should not be coupled in this way?
any suggestion will be appreciated.
Thank and regards
Manish Kumar
-----------------
-SCJP2
 
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Manish,
I guess it's all a matter of philosophy. No question if you can design an application with no dependencies that that's the way to go. However, that's almost never the case in the real world. I just imported both suncertify.db and suncertify.server and didn't worry about. If you think that it is important to decouple most of the client from those packages then you can probably use some sort of adapter class to do that. Of course the adapter will be dependant on those packages. You have to decide if it's worth the trouble.
Hope this helps,
Michael Morris
[ September 05, 2002: Message edited by: Michael Morris ]
 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My thought is that you should put everything associated with accessing the database into your db package. That includes your interface and both the local and remote implementations of that interface. This accomplishes several things:
1. You get the desired de-coupling between your client and server packages.
2. If you need to swap out the database, it's as simple as replacing the db package, it's all encapsulated into one package.
3. Reusability, your db access classes should be generic so that other applications could conceivably use those objects as well. The client and server packages are application-specific.
That's just my opinion, I could be wrong.
 
Manish Kumar
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks, for clearing my doubts. Now i'll not put effort on changing my design.
regards
-Manish
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

It works fine with the remote mode because of the dynamic code downloading.


This is the only statement that you made that worries me.
dynamic code downloading requires a Web Server, the assessors will not have a web server, and then you application will not work.
You need to include your stubs with the client jar file, instead of using codebase/dynamic code downloading.
Good Luck
Mark
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
do we need to make the stub class to be downloaded automically ( dynamic class downloading ) or just copy the stub class into the client ??
 
Ranch Hand
Posts: 162
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


do we need to make the stub class to be downloaded automically ( dynamic class downloading ) or just copy the stub class into the client ??


Some people copied it into the client. Or they just made the same db package available to client and server.
regards,
friso
 
reply
    Bookmark Topic Watch Topic
  • New Topic