- 18
- 0
- 约 5页
- 2017-09-29 发布于山西
- 举报
Software Design
What is a design, what is a good design
Basic design principles: loose coupling, high cohesion (Command-Query Separation), avoid duplication, design for change (Open-Closed Principle)
What is a design patterns and why
Basic design patterns: Adapter, Singleton, Iterator, Command, Factory Method
How each pattern is implemented
What is a design?
A plan or blueprint about how to build a software system.
A design identifies the major components and their interconnections
A design is an abstraction that describes overall structure of a system.
2、What is a good design?
A good design should be functionally correct,efficient,robust,simple,easy to understand,easy to maintain,easy to use,easy to extend.
A good design should avoid duplication, display high cohesion and loose coupling.
What are the Basic design principles
loose coupling:coupling refers to the degree to which different units depend on each other.Two classes are tightly coupled if they depend closely on many details of each other.
Loose coupling improves readability and maintainability
High Cohesion:
Cohesion refers to the number and diversity of tasks that a single unit is responsible for.
High Cohesion:Each unit should do one thing and do it well
High cohesion makes it easier to
Understand class and methods.reuse a class and method.give descriptive names to a class or method
High cohesion-method:
Command-Query Separation Principle: In general, a query method should not have side effects and a modifier method should not return any value.
avoid duplication:
two kinds of duplication:syntactic duplication semantic duplication
the problem duplication bring:1:waste of time 2:hard to maintain
design for changes:Try to anticipate what changes are likely to be made in the future.
Open-Closed Principle: Software entities should be open for extension, but closed for modification.(即:extend by adding new classes or extending without modifying existing classes,宁加勿改)
What is design patterns
您可能关注的文档
最近下载
- 一种连续性混杂型废塑料无害化热解处置系统及处置方法.pdf VIP
- 糖画介绍课件.pptx VIP
- 湘教版八年级地理下册6.1《 东北地区的地理位置与自然环境》优质教案.docx
- 变态心理学(新教材).pdf VIP
- 农村饮水安全项目社会稳定风险评估与风险防控技术研究报告.docx
- 高三数学三角函数一轮复习.doc VIP
- 施工现场管理机构设置及职责.docx VIP
- 全真派道士申请书.docx VIP
- Panasonic松下 洗衣机 XQG100-V198,XQG100-V19M,XQG100-V19S,XQG100-L186,XQG100-L187,XQG100-L18M,XQG100-L188,XQG100-L18R,XQG100-L18S,XQG100-L1KR,XQG100-3X0R,XQG100-L18T 用户手册.pdf
- 心理健康热线接听操作指南.docx VIP
原创力文档

文档评论(0)