Component base MVC framework and action based MVC

2019-03-30 21:56发布

Hi I have worked with JSF which is a component based MVC framework . I know a lot of web projects use Spring as their technology and Spring falls under the category "action based UI framework " . I want to know what is the difference here ? Which one is more advanced and gives more flexibility to the users ? Some pros and cons ?

1条回答
来,给爷笑一个
2楼-- · 2019-03-30 22:29

Component Based Web Framework is a way of implementing Web (HTTP) based applications similar to thick-client applications where user operates on GUI controls which fire actions as a result of events. Here views (web pages) are central piece of the application.

Action Based Web Framework puts emphasis on request-response nature of HTTP protocol, where requests represent actions to be performed (in general: request URI maps to operation, request parameters/body maps to operation arguments). Here views are just a way of rendering the results of operations/actions.

Both models have pros and cons. The former seems easier (especially if one has Swing background) but in the long term the req-res nature of HTTP comes in the way of programmer. The latter is more natural fit to HTTP and allows to write more testable code (controllers).

p.s. Java web apps went from MVC to Component based frameworks, or rather first there were Struts et al, and then JSF. In .NET world first there was ASP.NET and then ASP.NET MVC.

查看更多
登录 后发表回答