Hi,
"central-controller": In MVC wouldn't we have several controllers? (When I read contral-controller, I understand that there is only one). Isn't that the main difference between MVC and Front Controller?
Nice mocks, BTW.
Thanks,
Marcos.
About Question com.enthuware.ets.scwcd.v5.2.516 :
Moderator: admin
-
- Posts: 5
- Joined: Fri Apr 01, 2016 1:42 pm
- Contact:
-
- Posts: 358
- Joined: Fri Nov 29, 2013 8:26 pm
- Contact:
Re: About Question com.enthuware.ets.scwcd.v5.2.516 :
MVC: when the model updates its data, the controller (eg servlet) will notify the view. Or, when the view updates its data, the controller notify the model.
Front controller: the front controller (eg servlet) dispatches requests to other resources (eg. other servlets or jsp), so that tasks can be delegated to other resources.
Front controller: the front controller (eg servlet) dispatches requests to other resources (eg. other servlets or jsp), so that tasks can be delegated to other resources.
-
- Posts: 5
- Joined: Fri Apr 01, 2016 1:42 pm
- Contact:
Re: About Question com.enthuware.ets.scwcd.v5.2.516 :
Hi, thanks for your reply!
Ok, I understand what you said.
But the statement:
"central-controller" isn't the same as one controller (servlet) that makes all the dispatches? In this case, MVC does not apply, does it?
Regards,
Marcos.
Ok, I understand what you said.
But the statement:
means that when we have only one controller (servlet), we have MVC or Front Controller applied."central controller" : Applies to both MVC and Front Controller.
"central-controller" isn't the same as one controller (servlet) that makes all the dispatches? In this case, MVC does not apply, does it?
Regards,
Marcos.
-
- Posts: 358
- Joined: Fri Nov 29, 2013 8:26 pm
- Contact:
Re: About Question com.enthuware.ets.scwcd.v5.2.516 :
Yes. The central controller is the single location where all requests and responses are handled.
According to Charles Lyon's study guide p. 632:
http://www.oracle.com/technetwork/java/ ... 35648.html
According to Charles Lyon's study guide p. 632:
On p. 633MVC pattern:
- an object model which represents a real-world construction. This is the model for the application...
- An AWT or Swing GUI to provide the user with interaction capabilities. This makes up the view....
- Listeners to provide a communications link between what the user does with the view, and how the model responds. This comprises the controller, which is a layer responsible for receiving events fired by the users' interaction with the view, and make changes to the model accordingly.
Other reference:Patterns for the presentation tier
Front controller
Some application are best maintained if they provide a common central gateway through which all requests and responses pass. Using a central component to handle all requests and responses provides a single location from which to control all logic decisions relating to security, content retrieval and view management. In this pattern, a single component knows as the front controller moderates all request and responses, either for one region of the site or for the entire site....
Since the front controller usually represents a logic processor, it is best implemented with a servlet. All URLs which this front controller is required to handle are mapped to this servlet in the deployment descriptor. The servlet may then delegate processing to other resources based on the format and validity of the request URI....
After reading these two paragraphs, in my opinion, the central controller is applied to MVC's listener and front controller.
http://www.oracle.com/technetwork/java/ ... 35648.html
-
- Posts: 5
- Joined: Fri Apr 01, 2016 1:42 pm
- Contact:
Re: About Question com.enthuware.ets.scwcd.v5.2.516 :
Thank you for your reply and for the link!
It was really helpful to read about the Filter Controller Strategy.
Regards,
Marcos.
It was really helpful to read about the Filter Controller Strategy.
Regards,
Marcos.
-
- Site Admin
- Posts: 10075
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question com.enthuware.ets.scwcd.v5.2.516 :
Thank you, himai
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 6 guests