OO and Procedural
来源:互联网 发布:数据字典是用来定义 编辑:程序博客网 时间:2024/05/22 08:19
opposites! This exposes the fundamental dichotomy between objects and data structures:
Procedural code (code using data structures) makes it easy to add new functions without
changing the existing data structures. OO code, on the other hand, makes it easy to add
new classes without changing existing functions.
The complement is also true:
Procedural code makes it hard to add new data structures because all the functions must
change. OO code makes it hard to add new functions because all the classes must change.
So, the things that are hard for OO are easy for procedures, and the things that are
hard for procedures are easy for OO!
Objects expose behavior and hide data. This makes it easy to add new kinds of objects
without changing existing behaviors. It also makes it hard to add new behaviors to existing
objects. Data structures expose data and have no significant behavior. This makes it easy to
add new behaviors to existing data structures but makes it hard to add new data structures
to existing functions.
In any given system we will sometimes want the flexibility to add new data types, and
so we prefer objects for that part of the system. Other times we will want the flexibility to
add new behaviors, and so in that part of the system we prefer data types and procedures.
Good software developers understand these issues without prejudice and choose the
approach that is best for the job at hand.
- OO and Procedural
- Procedural modeling and texture
- Chapter 3 Procedural Statements and Routines
- NOTE:Architecture and OO
- Abap OO and .Net OO [1]
- What is the difference between procedural and nonprocedural language?
- [gdc07]Rendering Architecture and Real-time Procedural Shading & Texturing Techniques
- ABAP OO interface and event
- Shapes-Procedural
- Shapes-Procedural
- Design Smells And OO Design Principles
- Lesson1---Foundations of java and oo programming
- OO
- oo
- oo
- oo
- OO
- OO
- Java深入 - Java Socket和NIO
- Linux服务器编程之:truncate()函数+案例说明
- Java集合框架的知识总结(1)
- 【转】数学专业的数学与计算机专业的数学的比较
- Distributed transactions with multiple databases, Spring Boot, Spring Data JPA and Atomikos
- OO and Procedural
- HDU 5007 Post Robot(字符串寻找)
- HDU 1089 A+B for Input-Output Practice (I)
- SVN服务器客户端搭建版本控制
- 连连看
- hdu 5012 Dice 2014 ACM/ICPC Asia Regional Xi'an Online bfs
- MCMC(Markov Chain Monte Carlo) and Gibbs Sampling
- 并发工具类(三)控制并发线程数的Semaphore
- hdu 5007 Post Robot 水题