例如,以创建功能需求(如为企业内的应用程序对用户访问进行重新验证)为例。
As an example, consider common capability needs such as user access revalidation for applications within an enterprise.
在分析阶段,我们的用例实现只包括分析类及分析对象,它们能组装成不同的UML图如类图和交互图。
In analysis, our use case realization contains only analysis classes and objects, which may populate various UML diagrams such as class diagrams and interaction diagrams.
系统:处理参与者生成的事件;在某些用例中(如本文中的用例)可能需要与其他系统进行通信,因此要使用系统接口。
The system: Processes events generated by the Actor; in some use cases, such as this one, the system may need to communicate with other systems and so use a system Interface.
如您所见,第一步是创建一个新的工作目录,然后把样例代码文件解压缩到这个新目录中。
As you can see, the first step is to create a new work directory and then decompress the sample code file into this new directory.
我们在用例分析(详见参考资料)的过程中完成了这项工作。 我们使用不同的用例来生成解决方案概要图表,如图1 所示。
We did this activity during the use case analysis (see Resources); we now derive the Solution Overview Diagram using the different use cases, as shown in Figure 1.
对于样例应用程序,该属性已得到设置,如清单3中的第一行所示。
For the sample application, this property is already set as shown in the first line of Listing 3.
用例经常过于照字面转换为技术构件(如流和服务),从而会导致系统设计不佳,无法提供SOA的优势。
Use cases are often too literally translated into technical artifacts (such as flows and services), which leads to poorly designed systems that don't deliver the benefits of SOA.
该例中的数据模型是根据清单1模式定义的一个如清单2所示的实例。
In this case the data model is an instance like Listing 2 based on the schema in Listing 1.
但是,为了减少样例应用程序要求使用的附加软件包的数目,我启动了自己的mvc模式,如清单7所示。
But, to reduce the number of extra packages the sample application requires, I roll my own MVC pattern, shown in Listing 7.
如早先提到的,从与用户的交互那里重新获得的用例的事件流不太可能完整。
As noted earlier, the use case's flows of events retrieved from interaction with the users are unlikely to be complete.
第一步(如果尚未这样做)是将可从下载部分获得的样例代码文件解压缩,如清单5所示。
The first step (if you haven't already done so) is to decompress the sample code file available in the Download section, as shown in Listing 5.
下载部分提供了一个样例端点文件,如清单6所示。
See the sample endpoint file provided for download, and shown in Listing 6.
如您所知,样例流程是一个长期流程,就是说,可能有多个实例运行在生产服务器上。
As you know, the sample process is a long-run process, which means there may be many instances running on the production server.
结果产生的系统用例模型如图13所示,并且包括已确定的所有用例。
The resulting System Use Case model is shown in Figure 13, and includes all the use cases identified.
如前面的用例中所描述的(请参见上下文部分),这种新的目标系统通常可以满足附加的业务需求,如提供单个版本的真实数据和附加的认识。
As described in the use cases (see Context), this new target system often meets additional business requirements such as providing the single version of the truth and additional insight.
又以诗歌为例,诗歌,如音乐,乃一民族之精神生活之至高表现形式;美国诗人所作之诗,余所铭记而未忘者,唯一首而已,此诗勘称真正之诗也。
Of poetry again, which, like music, is the highest expression of spiritual life in a nation, I also know only one poem written by an American poet which can be truly called a real poem.
测试用例通常存在于开发人员的脑子里,但实现起来有不同的方式,如打印语句、调试器表达式、测试脚本。
Developers often have tests cases in mind, but they realize them in many different ways: print statements, debugger expression, test scripts.
清单5中的朋友脚本的样例输出如 清单6 所示。
Sample output from the friends script in Listing 5 is shown in Listing 6.
对于上述样例应用程序,新捆绑包清单如清单6所示。
For the sample application described above, the new bundle manifest would look like Listing 6.
当然,这种灵活意味着我必须为删除单词编写至少两个测试用例,如清单10所示。
Of course, being so flexible means that I must write at least two test cases for removing a word, as shown in Listing 10.
让我们用一个普通样例类(如清单3所示)来建模用户。
Let's take a sample trivial class for modeling users, as shown in Listing 3.
在该文件的顶部,有一个数组中包含了样例所使用的名称、用户ID和电话号码,如清单1所示。
At the top of this file there is an array containing the names, user IDs, and phone Numbers that are used in the sample as shown in listing 1.
最后如清单7所示,您能实现对代码块进行异常处理的传统用例。
Finally, you can implement the traditional use case for exception handling over a block of code as shown in Listing 7.
对于这个博客样例,应用程序清单文件看起来如清单10所示。
For the blog sample, the application manifest looks like Listing 10.
如这个图所示,鼓励使用碳排放量小的交通工具能够从总体上影响样例人群的总体碳排放。
As evidenced from the data shown in the figure, encouraging the use of less carbon-heavy modes of transportation can have the overall effect of decreasing a sample population's overall footprint.
要理解双重检查锁定习语是从哪里起源的,就必须理解通用单例创建习语,如清单1中的阐释?
To understand where the double-checked locking idiom originated, you must understand the common singleton creation idiom, which is illustrated in Listing 1.
系统用例提及屏幕和报告,如“UI23安全性登录屏幕”和“UI89登记摘要报告”。
The system use case makes references to screens and reports, such as "UI23 Security Login Screen" and "UI89 Enrollment Summary Report."
在这里,可以使用一个测试用例作为单个参数(如清单2中所示)对AmbulantPlayer_gtk进行直接调用。
From there, it is a straightforward call to AmbulantPlayer_gtk with a test case as a single argument as in Listing 2.
接下来,我更新清单4中的测试用例来验证是否抛出了一个ConstraintsViolatedException,如清单8所示。
Next, I update the test case from Listing 4 to verify that a ConstraintsViolatedException is thrown, as shown in Listing 8.
对于清单5中的样例,日志文件中的一行(如清单2所示)将作为传递到map方法中的输入Text对象。
For the sample in Listing 5, a single line from the log file (as seen in Listing 2) will be the input Text object that is passed into the map method.
应用推荐