MVC

Very good morning sir

i have big confusion in MVC architecture. I have got different views from my seniors .But they dn't match with each other.

My question is

"

1) Should there one controller behind each view(jsp) ?

2) Should there be only single controller behind all views?

3) Should there be more then >1 controller in your MVC project.?

4) Should we try to use maximum or minimum number of Controllers?

As in the following site

http://www.javaworld.com/javaworld/jw-10-1996/jw-10-howto.html

they have shown that we can have any number of controllers.

but this is not matched with many other sites.

"

Thanx in advance

[715 byte] By [chahalkhushwindera] at [2007-11-27 2:55:17]
# 1
http://java.sun.com/developer/technicalArticles/javase/mvc/
java_2006a at 2007-7-12 3:31:54 > top of Java-index,Java Essentials,Java Programming...
# 2

thanx for your link sir.

I have read this and it has clarify my doubts.

But i have still a question in my mind

"

should each view has its individual controller or there should be only single controller in whole application?

"

Please answer this.

thanx.

chahalkhushwindera at 2007-7-12 3:31:54 > top of Java-index,Java Essentials,Java Programming...
# 3

as far as i know you have different mvc interpretations that statisy your own needs

In web applications:

struts uses (an mvc web application), one main controller (a filter servlet) that handles the specific controllers + their views.

these specific controllers do their own things, the filter controller sends the user to the right view after the controller is done working.

So both are right, you have 1 main controller to do the navigation between the specific controllers and the specific views.

For example this main controller reads an xml file where specific url's or actions are mapped to the controller and view.

But it may also be possible to have multiple controllers and multiple views (to one action), although I personally do not prefer that.

How it works with offline applications I do not know specifically, but I assume this works a bit the same, since you don't throw everything in one class

radicjesa at 2007-7-12 3:31:54 > top of Java-index,Java Essentials,Java Programming...
# 4
thanx for replyi will see if anybody else reply me so that i can conclude
chahalkhushwindera at 2007-7-12 3:31:54 > top of Java-index,Java Essentials,Java Programming...