MVC 的 Pull 和 Push 类型的区别

来源:互联网 发布:淘宝店标图片免费下载 编辑:程序博客网 时间:2024/05/16 08:01

 

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

原创粉丝点击