aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Packages dependency problem 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 "Packages dependency problem" Watch "Packages dependency problem" New topic
Author

Packages dependency problem

Gabriel Vargas
Ranch Hand

Joined: May 16, 2007
Posts: 145
Hi ranchers,

I implement mvc in my assigment, i have a services layer than is my model a controller class than manages interaction between gui and model and gui classes than have a reference to the controller. I have a trouble because i declared my controller in middleware package and gui classes in gui package, but both packages depends on each other (i pass my classes through a metrics program and this inform about the double dependency between gui and middelware packages).

In some other threads i read than gui classes no need to have a reference to the controller making a lose coupling between gui and controller (but i don't know how do this) and searching an example of mvc i found the strategy pattern implemented in the controller declared for the gui but model, view and controller classes are declared in the same package. It is a good design?, how i can change my implementation to resolve package dependency?

Thanks to all.


Gabriel Vargas
SCJP, SCJD, now studying for SCWCD and working to be a better person
John Stone
Ranch Hand

Joined: May 04, 2007
Posts: 332
How about putting your controller to gui package?


BTW: What is the name of sotware you used? I'd like to try it too.
Gabriel Vargas
Ranch Hand

Joined: May 16, 2007
Posts: 145
Hi John,

I create and put my controller interface in the gui package and conserve my controller impl in my middleware package, it is a good approach?. I develop my project with netbeans and the plugin is for eclipse so i have my project now for eclipse and netbeans.

Eclipse metrics

Also i see my statistics at

Locmetrics

because discussion in this thread:

Number of classes/interfaces

Some advice about this topic is appreciated. Thanks.
John Stone
Ranch Hand

Joined: May 04, 2007
Posts: 332
Why does your gui packagae depend on middlerware package? Your gui should use only Controller interface.

(I have both in gui package.)
Gabriel Vargas
Ranch Hand

Joined: May 16, 2007
Posts: 145
Hi john.


Why does your gui packagae depend on middlerware package? Your gui should use only Controller interface.

(I have both in gui package.)


I put mi controller interface in gui package and controller implementation in middleware package because gui only have user interface classes and middleware have integration classes like the controller implementation, before i haven't this interface , i have only the implementation but i think is necesary to decoupling packages.
[ August 30, 2007: Message edited by: Gabriel Vargas ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Packages dependency problem