文档介绍:Topics on Design
Wesley Bao
Trend Micro Incorporated
Nov 22, 2004
Agenda
Who cares about design
What makes a good design
Selected OOD guidelines
Ideas on formalizing the heuristics (to enable tools to audit design quality besides code quality)
Q & A
Design? Who cares?
Customer? Your boss? No, they want product quality (and time to market). Design quality is another story.
Developers care, new hires care. Look out! Is your project in debt? Are your windows broken?
Non-survival? Priority matters
For developers, language syntax, IDE, compiler and debugger usage, Platform API are survival knowledge.
Design experience is value-addition. Congratulations, you are not worrying about survival but are looking for nice-to-have knowledge
Push to tool/language level
Purify, Quantify etc (code quality)
GC obsoletes some resource managerment patterns
Any tool to audit or even help to improve design quality? Automated smell recognition & refactoring is a nice will
What we have now:
IDE supported refactorings
CheckStyle, PatternTesting, lint
Patterns repository, pattern weaver, CG
Cont.
MVC, AOP, frameworks, containers (these mandate some architectural design)
AOP promotes SoC, Java promotes OOP
Tools can check . name convention, method length, occurance of global/public data, goto, switch, possible resource leak, duplicated or similar code block… lots of smells
Tools can help to ensure (audit) design style integrity, can help to transfer design knowledge to new teammates
A lot of possibilities
What is/isn’t design for?
You want to know how to do the right thing? Please turn to a lecture on analysis (. on OOA).
You want to do the things right? Yes, besides process, design matters.
What makes a good design
Less duplication
Easier to understand
Easier to change (if necessary)
Less coding
Natural and elegant
Efficient
It’s not all about classes
Logical view: classes, namespaces, packages…
Physical view: header files, source files…
Just break functionality