MVC Push:
This is where the framework creates context objects what are "pushed" or made available to the templating language like JSP's allowing them either via tags or scripting to get their values and dislay them on the page. Struts and Expresso a good examples of this. In Expresso you create Output objects that are made just for rendering the View
MVC Pull:
This is where you have one or a few objects that are made available to all templates. The big difference is the java developer does not need to create any sort of output object, they just make backend model objects available to the View templetes. WebWork and Maverick are a good example of this, they a provide accessor methods(getters) in their Action classes that allow the View to "pull" whatever they like as long as they know of the API for that Action.
参考文档:
http://www.theserverside.com/patterns/thread.tss?thread_id=22143
本文探讨了MVC架构中Push和Pull两种不同的实现方式。Push模式下,框架创建上下文对象并将其提供给模板语言,如Struts和Expresso。而Pull模式则通过提供对后端模型对象的直接访问来允许视图模板获取所需数据,如WebWork和Maverick。
356

被折叠的 条评论
为什么被折叠?



