Gene Therapy 基因治疗 复旦大学分子医学教育部重点实验室 复旦大学出生缺陷研究中心 复旦大学儿童发育与疾病转化医学研究中心 马端.
On to Object Design 徐迎晓 [email protected] 复旦大学软件学院 2005.11.
-
Upload
marylou-owen -
Category
Documents
-
view
309 -
download
0
Transcript of On to Object Design 徐迎晓 [email protected] 复旦大学软件学院 2005.11.
![Page 2: On to Object Design 徐迎晓 xuyingxiao@126.com 复旦大学软件学院 2005.11.](https://reader033.fdocument.pub/reader033/viewer/2022061406/56649eaa5503460f94bb0198/html5/thumbnails/2.jpg)
OutlineAgile Modeling and UML
UML Case Tools
Limit time spent drawing
Dynamic and Static Models
CRC Cards
![Page 3: On to Object Design 徐迎晓 xuyingxiao@126.com 复旦大学软件学院 2005.11.](https://reader033.fdocument.pub/reader033/viewer/2022061406/56649eaa5503460f94bb0198/html5/thumbnails/3.jpg)
Agile Modeling and UMLTwo of the aims of Agile modeling:Reduce drawing overheadModel to understand and communicate
This is a change from a view of modeling as documentation. In a era of rapid change, documentation tends to have minimal value.
![Page 4: On to Object Design 徐迎晓 xuyingxiao@126.com 复旦大学软件学院 2005.11.](https://reader033.fdocument.pub/reader033/viewer/2022061406/56649eaa5503460f94bb0198/html5/thumbnails/4.jpg)
More Agile PrinciplesModeling with others
Create several models in parallel
Use temporary models such as diagrams on white boards
Digital photographs of white boards can be shared on a wiki. (See www.twiki.org)
![Page 5: On to Object Design 徐迎晓 xuyingxiao@126.com 复旦大学软件学院 2005.11.](https://reader033.fdocument.pub/reader033/viewer/2022061406/56649eaa5503460f94bb0198/html5/thumbnails/5.jpg)
Fig. 14.1
![Page 6: On to Object Design 徐迎晓 xuyingxiao@126.com 复旦大学软件学院 2005.11.](https://reader033.fdocument.pub/reader033/viewer/2022061406/56649eaa5503460f94bb0198/html5/thumbnails/6.jpg)
OutlineAgile Modeling and UML
UML Case Tools
Limit time spent drawing
Dynamic and Static Models
CRC Cards
![Page 7: On to Object Design 徐迎晓 xuyingxiao@126.com 复旦大学软件学院 2005.11.](https://reader033.fdocument.pub/reader033/viewer/2022061406/56649eaa5503460f94bb0198/html5/thumbnails/7.jpg)
UML Case ToolsYou can also do agile modeling with UML case tools like Rational Rose, or one that comes with a popular IDE such as Eclipse or Visual Studio.
Choose a tool that can read your code and reverse engineer it to create diagrams from your code.
Switch back and forth from diagramming to reverse engineering.
![Page 8: On to Object Design 徐迎晓 xuyingxiao@126.com 复旦大学软件学院 2005.11.](https://reader033.fdocument.pub/reader033/viewer/2022061406/56649eaa5503460f94bb0198/html5/thumbnails/8.jpg)
OutlineAgile Modeling and UML
UML Case Tools
Limit time spent drawing
Dynamic and Static Models
CRC Cards
![Page 9: On to Object Design 徐迎晓 xuyingxiao@126.com 复旦大学软件学院 2005.11.](https://reader033.fdocument.pub/reader033/viewer/2022061406/56649eaa5503460f94bb0198/html5/thumbnails/9.jpg)
Limit time spent drawingA few hours or at most one day of diagramming should do most of the work for a three week iteration.
Occasional short sessions of modeling during the iteration can clarify any concepts that still need to be understood.
![Page 10: On to Object Design 徐迎晓 xuyingxiao@126.com 复旦大学软件学院 2005.11.](https://reader033.fdocument.pub/reader033/viewer/2022061406/56649eaa5503460f94bb0198/html5/thumbnails/10.jpg)
OutlineAgile Modeling and UML
UML Case Tools
Limit time spent drawing
Dynamic and Static Models
CRC Cards
![Page 11: On to Object Design 徐迎晓 xuyingxiao@126.com 复旦大学软件学院 2005.11.](https://reader033.fdocument.pub/reader033/viewer/2022061406/56649eaa5503460f94bb0198/html5/thumbnails/11.jpg)
Dynamic and Static Models
Dynamic models such as interaction diagrams (sequence or communication diagrams) help design logic, code behavior, and method bodies.
Static Models such as class diagrams help define packages, class names, attributes, and method signatures.
Switch back and forth during modeling sessions.
![Page 12: On to Object Design 徐迎晓 xuyingxiao@126.com 复旦大学软件学院 2005.11.](https://reader033.fdocument.pub/reader033/viewer/2022061406/56649eaa5503460f94bb0198/html5/thumbnails/12.jpg)
Dynamic ModelsMost of the challenging, interesting, and useful design work comes during dynamic modeling. The interaction diagrams are typically where we apply design patterns such as the GRASP patterns.
If the most important skill in object design is assigning behavior to objects, this is when it usually takes place.
![Page 13: On to Object Design 徐迎晓 xuyingxiao@126.com 复旦大学软件学院 2005.11.](https://reader033.fdocument.pub/reader033/viewer/2022061406/56649eaa5503460f94bb0198/html5/thumbnails/13.jpg)
Dynamic Models (continued)
Dynamic UML models include sequence, communication, state machine and deployment diagrams.
![Page 14: On to Object Design 徐迎晓 xuyingxiao@126.com 复旦大学软件学院 2005.11.](https://reader033.fdocument.pub/reader033/viewer/2022061406/56649eaa5503460f94bb0198/html5/thumbnails/14.jpg)
Static ModelsIf behavior is designed during dynamic modeling, it is the static models, such as the class diagrams, which give the overall structure to our software, and allow us to divide the work into manageable and maintainable chunks.
Static UML models include class, package, and deployment diagrams.
![Page 15: On to Object Design 徐迎晓 xuyingxiao@126.com 复旦大学软件学院 2005.11.](https://reader033.fdocument.pub/reader033/viewer/2022061406/56649eaa5503460f94bb0198/html5/thumbnails/15.jpg)
Design Skill, not UML skillUML is only an ancillary tool to object design. The real skill is the design, not the diagramming.
Seeking a software design job because you are good at making UML diagrams is like seeking a career as a novelist because you have good penmanship.
![Page 16: On to Object Design 徐迎晓 xuyingxiao@126.com 复旦大学软件学院 2005.11.](https://reader033.fdocument.pub/reader033/viewer/2022061406/56649eaa5503460f94bb0198/html5/thumbnails/16.jpg)
OutlineAgile Modeling and UML
UML Case Tools
Limit time spent drawing
Dynamic and Static Models
CRC Cards
![Page 17: On to Object Design 徐迎晓 xuyingxiao@126.com 复旦大学软件学院 2005.11.](https://reader033.fdocument.pub/reader033/viewer/2022061406/56649eaa5503460f94bb0198/html5/thumbnails/17.jpg)
CRC CardsAn alternative to UML Object Design is the Class, Responsibility, Collaboration cards popularized by Kent Beck in eXtreme Programming.
There are some brief examples in the text, but you should get a book on eXtreme Programming or go to a Web site if you are interested.
![Page 18: On to Object Design 徐迎晓 xuyingxiao@126.com 复旦大学软件学院 2005.11.](https://reader033.fdocument.pub/reader033/viewer/2022061406/56649eaa5503460f94bb0198/html5/thumbnails/18.jpg)
Fig. 14.2
![Page 19: On to Object Design 徐迎晓 xuyingxiao@126.com 复旦大学软件学院 2005.11.](https://reader033.fdocument.pub/reader033/viewer/2022061406/56649eaa5503460f94bb0198/html5/thumbnails/19.jpg)
Fig. 14.3