责任模式 Accountability 徐迎晓 复旦大学软件学院 xuyingxiao@126.com
责任模式 Accountability 徐迎晓 复旦大学软件学院 xuyingxiao@126.com
1 Party
1. Party
Example: .A telephone utility's customers may be individuals or businesses. Many aspects of dealing with customers are the same in which case they are treated as parties Where they differ they are treated through their subtype
Example: A telephone utility’s customers may be individuals or businesses. Many aspects of dealing with customers are the same, in which case they are treated as parties. Where they differ they are treated through their subtype
0.1 Telephone Numb 0.1 Person Address Organ ization 0.1 E-mail Address
0.1 Telephone Numbe Person 0.1 Address Organ ization 0.1 E-mail Address
Party Pattern An abstraction of people and organizational units Person Organization
Party Pattern
e Put any behaviror that is common to people and organizational units on Party, only put things particular to one or the other on the subtype e When you put behavior on the subtype think about whether it makes sense on the supertype
Put any behaviror that is common to people and organizational units on Party, only put things particular to one or the other on the subtype When you put behavior on the subtype, think about whether it makes sense on the supertype
When to use it . when you have people and organizations in your model and you see common behavior C when you don' t need to distinguish between people and organizations In this case it's useful just to define a party class and not to provide the subtypes
When to use it when you have people and organizations in your model and you see common behavior when you don’t need to distinguish between people and organizations. In this case it’s useful just to define a party class and not to provide the subtypes
Main Point e The main point of this pattern is to look for it to see if you have common behavior and if so to use the name Party for that supertype 9 The name has become quite widely used these days, so choosing that name helps in communication
Main Point The main point of this pattern is to look for it to see if you have common behavior, and if so to use the name Party for that supertype. The name has become quite widely used these days, so choosing that name helps in communication
2 Organization Hierarchy
2. Organization Hierarchy