MVC中Push与Pull模式

In case of Push-MVC the data (Model) is constructed and given to the view layer by the Controllers by putting it in the scoped variables like request or session. Typical example is Spring MVC and Struts1. Pull-MVC on the other hand puts the model data typically constructed in Controllers are kept in a common place i.e. in actions, which then gets rendered by view layer.
Now from our Action Controller we can receive the bean object and will get the values but in the front controller where the bean object[or model] is actually generated set the value in their resperctive field by using request.getParameter(param) or request.getParameterValues(param) methods internally.. So this can be considered as PULL.
So as per my thinking we can say that These framework can use two layers namely PULL layers used by end programmer and PUSH layers used by framework base classes.
push到可以response相对应,pull也可以说request相对应
MVC中的Push与Pull模式
本文探讨了MVC架构中Push与Pull两种数据传递模式的区别。Push模式下,控制器构造模型并将其放置于作用域变量中供视图层使用;而Pull模式则将模型数据置于公共位置,由视图层获取。文章还详细解释了这两种模式的具体实现方式。
1264

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



