关于task flow和object scope

来源:互联网 发布:大数据英语怎么说 编辑:程序博客网 时间:2024/06/06 10:08

我们在设计开发一个新的页面的时候,managed bean选择何种scope更适合业务逻辑?何种scope下managed bean中的变量会随着页面一起刷新?希望下面的这段话能给你点启示。

 

When determining what scope to use for variables within a task flow, you should use any of the scope options other than application or session scope. These two scopes will persist objects in memory beyond the life of the task flow and therefore compromise the encapsulation and reusable aspects of a task flow. In addition, application and session scopes may keep objects in memory longer than needed, causing unneeded overhead. 

When you need to pass data values between activities within a task flow, you should use page flow scope. View scope is recommended for variables that are needed only within the current view activity, not across view activities. Request scope should be used when the scope does not need to persist longer than the current request. It is the only scope that should be used to store UI component information. Lastly, backing bean scope must be used for backing beans in your task flow if there is a possibility that your task flow will appear in two region components or declarative components on the same page and you would like to achieve region instance isolations.


原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 小孩子戒奶奶涨怎么办 孩子总打别人怎么办 儿童在学校打人怎么办 两岁儿童打人怎么办 孩子哭闹要东西怎么办 高中孩子爱打架怎么办 宝宝性格太弱怎么办 宝宝太老实了怎么办 一岁多宝宝爱打人怎么办 一岁半宝宝爱打人怎么办 两岁半宝宝喜欢打人怎么办 孩子总是挨欺负怎么办 一年级孩子爱打架怎么办 孩子没规矩家长怎么办 小朋友在幼儿园打人怎么办 幼儿园小朋友喜欢打人怎么办 三周岁宝宝爱哭怎么办 2周岁宝宝爱哭怎么办 一个月宝宝爱哭怎么办 2岁宝宝爱哭怎么办 三岁小朋友打人怎么办 一岁半小朋友喜欢打人怎么办 爷爷偏心我该怎么办 冲动型学生老师怎么办 两个宝宝争东西怎么办 2周岁宝宝打人怎么办 小孩幼儿园被打怎么办 小孩喝了润滑油怎么办 孩子被打了怎么办 宝宝吃了指甲油怎么办 孩子掉了深海怎么办 小孩打了别人怎么办 两岁宝宝爱咬人怎么办 孩子上学老打人怎么办 孩子上学爱说话怎么办 孩子抢玩具打人怎么办 生气就像打人怎么办 小孩总喜欢打人怎么办 小孩性格好翘怎么办 一岁小宝宝打人怎么办 小孩子老喜欢打人怎么办