天天看点

Top 10 Robustness Analysis Errors ---- 鲁棒图分析的10条忠告

      本文抄录自以下网址,若有侵权嫌疑,烦作者与本人联系,谢谢!

      http://www.drdobbs.com/184414712;jsessionid=2ATEOODLQZEMLQE1GHPCKHWATMY32JVN

      本文中文部分由本人翻译,若有错漏之处,欢迎读者指正,谢谢!

      Many of the students we've taught make a number of errors when they're doing robustness analysis for the first time. Our "top 10" list of solutions to common errors follows.

10. Don't violate the robustness diagram rules.

----不要违反鲁棒图的绘画原则

These rules are in place primarily to get your text into noun-verb-noun format and to help ensure that you don't start allocating behavior to objects before you have enough information to make good design decisions. (We'll talk more about behavior allocation in our upcoming article on sequence diagrams.) The rules about boundary objects are in place to ensure that you explicitly specify the boundaries of the system, outside of which reside the actors involved in your use cases.

9. Use robustness analysis to help you use a consistent format for your use case text.

----利用鲁棒图分析帮助您保持良好统一的用例描述格式

The boundary object-controller-entity object pattern tends to appear on lots of robustness diagrams. This pattern closely correlates with the subject-verb-object pattern of basic English sentences. You should use robustness analysis to make the text of your use cases stylistically consistent among themselves to the largest extent you can, which greatly improves their readability and maintainability.

8. Include alternate courses on robustness diagrams.

----在您的鲁棒图中包含备选事件流

You need to perform robustness analysis on all of your use case text, not just the basic courses. Much of the interesting behavior of a system occurs in the context of alternate courses, so it's important to analyze that behavior as part of your modeling efforts. Robustness analysis can also help you discover new alternate courses, especially when you draw controllers with labels such as Verify and Validate.

7. Use robustness analysis to ensure consistency between class names on class diagrams and in use case text.

----利用鲁棒图保证类图和用例图的类名之间的一致性

Specifying use case text in the context of the object model is the magic formula you need to build useful sequence diagrams. By naming your boundary objects and entity objects in your use cases, you take a healthy step toward getting your sequence diagrams off to a good start, by simply drawing those objects across the top of the sequence diagram for each use case.

6. Don't allocate behavior to classes on your robustness diagrams.

----不要给您的鲁棒图中的类添加任何方法行为

As we mentioned earlier, controllers serve as placeholders for functionality and system behavior. You should not start assigning methods to classes on a robustness diagram, because you're not likely to have enough information. Make decisions about behavior allocation using sequence diagrams.

5. Don't include too few or too many controllers.

----不要包含太多或者太少的控制者

We like to see between two and five controllers on a robustness diagram. If you only have one controller per use case, you're likely to have a lot of very small use cases, each of which don't really describe enough behavior. On the other hand, if you have more than 10 controllers on one diagram, you should consider splitting your use case up into more manageable chunks.

4. Don't take too much time trying to perfect robustness diagrams.

----不要试图使您的鲁棒图完美化而浪费太多的时间

The robustness diagram serves as a "booster-stage engine" that gets the process of driving use cases forward into an object-oriented design off the ground. Robustness analysis helps us discover objects, allocate attributes, and check the use case text for completeness and correctness. But once we've accomplished the overall mission, we don't need to maintain the work product. It's a means to an end, not an end in itself.

3. Don't try to do detailed design on robustness diagrams.

----不要在鲁棒图中体现任何详细设计的成分

 The concept of throwaway diagrams is useful in connection with preliminary design; it's not a useful concept when it comes to detailed design. Sequence diagrams are the appropriate place for detailed design. Robustness analysis should be a quick pass across all of the scenarios you're going to build, in order to provide maximum value to your project. If your preliminary design takes as long as detailed design, you'll lose the benefits of this quick sanity check.

2. Perform a visual trace between the use case text and the robustness diagram.

----在您的用例描述和鲁棒图之间保持可视化的跟踪

We strongly recommend that you have a peer review for all of your use case text and robustness diagrams, with each reviewer performing the finger trace technique that we described earlier. You should not consider your use case done until it passes the simple visual trace test. When you've reached the point where each of your use cases pass the test, the next step-drawing sequence diagrams-will be easier for you to perform than if you were starting from your use case text alone.

1. Update your static model.

----记得更新您的静态模型

You must update your domain model before you can consider yourself done with robustness analysis and ready to move on to interaction modeling using sequence diagrams. After all, you can't allocate behavior to classes that don't appear in your static model.

继续阅读