Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Packages dependency problem

 
Gabriel Vargas
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
John Stone
Ranch Hand
Posts: 332
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 332
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic