About Question com.enthuware.ets.scwcd.v5.2.516 :

Moderator: admin

Post Reply
mroger
Posts: 5
Joined: Fri Apr 01, 2016 1:42 pm
Contact:

About Question com.enthuware.ets.scwcd.v5.2.516 :

Post by mroger »

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.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

Re: About Question com.enthuware.ets.scwcd.v5.2.516 :

Post by himaiMinh »

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.

mroger
Posts: 5
Joined: Fri Apr 01, 2016 1:42 pm
Contact:

Re: About Question com.enthuware.ets.scwcd.v5.2.516 :

Post by mroger »

Hi, thanks for your reply! :)

Ok, I understand what you said.

But the statement:
"central controller" : Applies to both MVC and Front Controller.
means that when we have only one controller (servlet), we have MVC or Front Controller applied.

"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.

himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

Re: About Question com.enthuware.ets.scwcd.v5.2.516 :

Post by himaiMinh »

Yes. The central controller is the single location where all requests and responses are handled.
According to Charles Lyon's study guide p. 632:
MVC 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.
On p. 633
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.
Other reference:
http://www.oracle.com/technetwork/java/ ... 35648.html

mroger
Posts: 5
Joined: Fri Apr 01, 2016 1:42 pm
Contact:

Re: About Question com.enthuware.ets.scwcd.v5.2.516 :

Post by mroger »

Thank you for your reply and for the link! :)

It was really helpful to read about the Filter Controller Strategy.

Regards,
Marcos.

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question com.enthuware.ets.scwcd.v5.2.516 :

Post by admin »

Thank you, himai :)
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests