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
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 ]
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
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.
posted 17 years ago
Thanks, for clearing my doubts. Now i'll not put effort on changing my design. regards -Manish
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