您的位置:首页 > 其它

WF4.0中的变量(variables)和参数(arguments)的区别

2016-08-01 11:12 274 查看

WF4.0中的变量(
variables
)和参数(
arguments
)的区别

学习.net中的
workflow
时被里面的变量和参数迷惑住了,今天看了本书《Beginning WF Windows Workflow in .NET 4.0》,里面的一段换讲的很通俗易懂。

原文拿来

If you think of your workflow as a class, variables are the class members. You can use them to store data that must be shared between activities. You can define the scope of a variable—either the entire workflow or just a specific activity (and its children). Arguments are similar to variables, but they are intended for passing data in or out of the workflow. You can think of them as method parameters.

译文(水平有限,仅供参考)

把工作流想象成一个类,变量
variables
就是类成员,你可以拿变量来存储数据以便在不同的活动中共享。你可以定义变量的作用范围,这个范围可以是整个工作流也可以是特指的一个活动(当然这个活动的子孙都可以访问这个变量)。而参数
arguments
虽然和变量有点相似,但是他更倾向于工作流对外的数据传入和传出,你可以吧参数想象成“工作流类”方法的参数。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  .net WF4-0