Outline
!
Science & Engineering & Art
!
Problem & Solution
!
Indirection
!
Manpower
!
Software Design Principles
!
And more …
Science & Engineering & Art
Art
Engineering Science
Science & Engineering & Art
Art
Engineering Science
Beauty
Truth
Benefit
Science & Engineering & Art
Art
Engineering Science
Beauty
Truth
For the benefit of people
Problem & Solution
Fundamental Theorem of
Software Engineering
!
We can solve any problem by
introducing an extra level of
indirection.
Andrew Koenig
C Traps and Pitfalls
Accelerated C++
“Koenig lookup”
Indirection
!
All problems in computer science can be
solved by another level of indirection
Butler Lampson
!
… except for the problem of too many
layers of indirection
Kevlin Henney
!
Often deliberately mis-quoted with
“abstraction” substituted for “indirection”
What is indirection?
!
The ability to reference something using
a name, reference, or container instead of
the value itself
!
Manipulating a value through its memory
address
!
accessing a variable through the use of
a pointer
!
OOP makes use of indirection extensively
!
Dynamic dispatch (polymorphism)
!
If one woman can produce a
baby in nine months, then nine
women should be able to
produce a baby in one month.
Amdahl’s Law
!
Suppose 70% of the operations are
parallelizable
!"#
!!!
!
!!! !
!!!
!
! !!!!! !!
Brooks' Law
Adding manpower to a
late software project
makes it later
Frederick Brooks
(Intercommunication cost)
Do It Twice
!
No software succeeds at the first time
!
Software prototyping
!
Second-system effect
!
Tendency of small, elegant, and successful
systems to have elephantine, feature-laden
monstrosities as their successors
Zawinski’s Law
!
Every program attempts to expand until
it can read mail.
!
Those programs which cannot so expand
are replaced by ones which can.
Jamie Zawinski
Mozilla
XEmacs
!
Software bloat
!
Apple iTunes
!
Microsoft Windows
Software Design Principles
!
Open Close Principle
!
Dependency Inversion Principle
!
Interface Segregation Principle
!
Single Responsibility Principle
!
Liskov’s Substitution Principle
Open Close Principle
!
Software entities like classes, modules
and functions should be open for
extension but closed for modifications.
Dependency Inversion Principle
!
High-level modules should not depend on
low-level modules. Both should depend
on abstractions.
!
Abstractions should not depend on
details. Details should depend on
abstractions.
!
OOP
!
Is-a relation
!
Has-a relation
Interface Segregation Principle
!
Clients should not be forced to depend
upon interfaces that they dont use.
!
No fat interfaces
Single Responsibility Principle
!
A class should have only one reason to
change.
Liskov’s Substitution Principle
!
Derived types must be completely
substitutable for their base types.
Barbara Jane Liskov
!
Object-oriented design
!
Functional implementation
Software artifact
User
interface
Business
rules
Domain
models
Requirements
Design
Code
承上
!
需求分析和业务建模都是要描述客
!
用面向象的方法去分析与设计
!
用最合的方式去实现
!
言的表能力存在巨大差
!
要多学几门语
如何提高(
!
!
体会
!
感悟
如何提高(务实
!
努力融入到一个有模的目中
!
一定要做大的西
!
往往在最初
!
比如编译环境的搭建
!
学会搜索和独立思考
做些什
!
真正有价的是把几年的工作到几个月
而不是把几天的事情短到十五分
!
有意思的有技术难度的实际工程中不要指
望把已学到的西恰好用上去
!
能力
!
应变能力
!
清楚原理
!
融会
!
学会取舍
!
与人交流
我做过什么?
!
!
数据分析
!
验证码
!
子表格
!
面向特定群体的SNS
!
十年献礼工程
我在做什
!
程序言(理实现
!
数据密集型件系的自生成
!
子商中的服装自推荐
!
十年献礼工程
自动化
!
科技发展使生产过程自动化程度提高,使劳
动者的智能迅速提高,大大地改变了体力劳
劳动的比例使劳动向着智能
趋势发
!
智能机器代替了人的部分劳动使人
劳动方式正在经历着由机械自化走向智能
由局部自化走向大系管理和控制
化的根本性
!
科技革命推了生产规模的而推
的分工和作的广泛并使生社会化
的程度提高必然会致生
最后⋯⋯
!
ACM班是一个很好的平台
!
立品牌
!
源充足良好
!
因斯坦
!
心人的本身当始一切技
斗的主要目
!
心怎样组织人的劳动品分配这样
些尚未解决的重大问题用以保科学
思想的成果会造福于人而不致成为祸