XX 建模练习
Source
Forest应用: XX1-Forest应用.pdf
1、用例图
2、活动图
3、领域模型
4、状态图
5、系统顺序图
6、操作协议
Contract CO1: chooseSpecies
- Operation: chooseSpecies(species)
- Cross References: Use Cases: Plant Tree
- Preconditions: none
- Postconditions:
- a A Planting instance p was created (instance creation).
- b Attributes of p were initialized.
- c p.species became species (attribute modification).
Contract CO2: setTime
- Operation: setTime(duration)
- Cross References: Use Cases: Plant Tree
- Preconditions: There is a Planting underway.
- Postconditions:
- a p.duration became duration (attribute modification).
Contract CO3: plantTree
- Operation: plantTree()
- Cross References: Use Cases: Plant Tree
- Preconditions: There is a Planting underway.
- Postconditions:
- a p was associated with a User (association formed).
Contract CO4: addTag
- Operation: addTag(tag)
- Cross References: Use Cases: Plant Tree
- Preconditions: There is a Planting associated with a User underway.
- Postconditions:
- a p.tag became tag (attribute modification).
Contract CO5: completePlanting
- Operation: completePlanting()
- Cross References: Use Cases: Plant Tree
- Preconditions: There is a Planting associated with a User underway.
- Postconditions:
- a p.isComplete became true (association formed).