问题
From the wiki page about JSF I've learnt that it's considered as an MVP framework. But I cannot realy understand why.
Actully, beans do not contain a reference to View in themselves. There's also a data bidinig mechanism between Facelets and Managed beans.
So I would say that Managed Beans are more ViewModel
than Presenter
, as that Presenter
usually contain a View
interface in itself like in that example.
QUESTION: Why is JSF considered MVP but not MVVM framework?
回答1:
MVVM is mainly a desktop application oriented pattern. When considering MVVM in web application perspective, there would be a controller in the client side. JSF doesn't have such one. When still speaking about web applications, if you were using e.g. Spring MVC in server side with e.g. AngularJS or Node.js in client side, you may speak about MVVM.
来源:https://stackoverflow.com/questions/36580401/why-is-jsf-considered-mvp-but-not-mvvm-framework