• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

NX: RemoteMode

 
Maria Lepschy
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 319
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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.
 
Maria Lepschy
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, Jacques.
Regards,
Maria
 
George Marinkovich
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



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 ]
 
Maria Lepschy
Ranch Hand
Posts: 78
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi George,
Thank you very much!I will move 2 classes from remote in the gui package.
Regards,
Maria
 
Jacques Bosch
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic