File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes NX: RemoteMode Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "NX: RemoteMode" Watch "NX: RemoteMode" New topic
Author

NX: RemoteMode

Maria Lepschy
Ranch Hand

Joined: Jan 12, 2004
Posts: 78
Hi all,
I have following packages:
suncertify.db
suncertify.remote
suncertify.gui
If I want to start the server on a machine and the client on another machine, which packages I must have on the server machine and which on the client machine? I must have all packages on both machines?
It is allowed to call in remote package a class from gui package?
Regards,
Maria
Jacques Bosch
Ranch Hand

Joined: Dec 18, 2003
Posts: 319

I must have all packages on both machines?

Yes. In the same jar file.

It is allowed to call in remote package a class from gui package?

Yes.


Jacques<br />*******<br />MCP, SCJP, SCJD, SCWCD
Maria Lepschy
Ranch Hand

Joined: Jan 12, 2004
Posts: 78
Thank you, Jacques.
Regards,
Maria
George Marinkovich
Ranch Hand

Joined: Apr 15, 2003
Posts: 619
Hi Maria,
I agree with Jacques' first answer.
Originally posted by Maria Lepschy:
Hi all,
It is allowed to call in remote package a class from gui package?

My answer to the second question is probably no. Here's the reasoning: I imagine that you are importing classes from the remote package into the gui package. In other words, the gui package has a dependency on the remote package. I imagine your package structure looks like this (where arrows indicate the direction of the dependency):

This is good because you don't have any cyclical dependencies. If you allow remote to have a dependency on gui you will be introducing a cyclic dependency between the remote and gui packages. This is probably something you want to avoid. You don't want to end up with something like this:

from URL=http://www.onjava.com/pub/a/onjava/2004/01/21/jdepend.html]http://www.onjava.com/pub/a/onjava/2004/01/21/jdepend.html[/URL]

Cyclic dependencies have the following negative consequences for the system:
Diminish the ability to reason about components of the architecture in isolation.
Changes impact seemingly unrelated components of the architecture. This makes it difficult to accurately assess and manage the impact of changes to the system.
Separation of layers. Most architectural approaches recognize the advantages of layered architectures. Cyclic dependencies across layers couple the layers, defeating the purpose of layering.
Packages cooperating in a cycle must be released as an atomic unit.


Regards, George
SCJP, SCJD, SCWCD, SCBCD
alzamabar
Ranch Hand

Joined: Jul 24, 2002
Posts: 379



This is good because you don't have any cyclical dependencies. If you allow remote to have a dependency on gui you will be introducing a cyclic dependency between the remote and gui packages. This is probably something you want to avoid. You don't want to end up with something like this:


Does the MVC address this issue?
by having
db <----------- remote <--------- controller <------- GUI
The GUI is not coupled with the server, allowing for different frameworks to be used in order to access the db. If this is ok, MVC is already "natively" built into Swing, with the Event delegation model.
Could our friend define a suncertify.framework package which contains classes that handle GUI events? This way the framework will be coupled with the server, not the GUI.
[ March 08, 2004: Message edited by: Marco Tedone ]

Marco Tedone<br />SCJP1.4,SCJP5,SCBCD,SCWCD
Maria Lepschy
Ranch Hand

Joined: Jan 12, 2004
Posts: 78
Hi George,
Thank you very much!I will move 2 classes from remote in the gui package.
Regards,
Maria
Jacques Bosch
Ranch Hand

Joined: Dec 18, 2003
Posts: 319
Maria, George.
That's what happens when you try answer something an 60 seconds.

I agree with Jacques' first answer.

I.e. not with the second one.
I also agree with George. I incorrectly assumed that the question was, can a class from one package be called from another.
Sorry Maria.
Luckily we have George around.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: NX: RemoteMode