Peruse SICP 3 : Modularity, Objects, and State

Modularity, Objects, and State

Why name it as Modularity, objects and State?
Because the logic of their relationship, is that, the Modularity is purpose, the Objects is methodology, and the State is the key point of implement that is different from the previous way which is Procedures.

The preceding chapters introduced the basic elements from which programs are made. We saw how primitive procedures and primitive data are combined to construct compound entities, and we learned that abstraction is vital in helping us to cope with the complexity of large systems.

This is what we have already had, of which, abstraction for complexity of large systems.

But these tools are not sufficient for designing programs.

Problem comes, which is, not good for designing.
Why?

Effective program synthesis also requires organizational principles that can guide us in formulating the overall design of a program. In particular, we need strategies to help us structure large systems so that they will be modular, that is, so that they can be divided “naturally” into coherent parts that can be separately developed and maintained.

A better feature for a good design, which is, can be divided.

One powerful design strategy, which is particularly appropriate to the construction of programs for modeling physical systems, is to base the structure of our programs on the structure of the system being modeled.

Simulate the physical world. why physical world? Because it is already runnable.

For each object in the system, we construct a corresponding computational object. For each system action, we define a symbolic operation in our computational model. Our hope in using this strategy is that extending the model to accommodate new objects or new actions will require no strategic changes to the program, only the addition of the new symbolic analogs of those objects or actions. If we have been successful in our system organization, then to add a new feature or debug an old one we will have to work on only a localized part of the system.

To a large extent, then, the way we organize a large program is dictated by our perception of the system to be modeled. In this chapter we will investigate two prominent organizational strategies arising from two rather different “world views” of the structure of systems. The first organizational strategy concentrates on objects, viewing a large system as a collection of distinct objects whose behaviors may change over time. An alternative organizational strategy concentrates on the streams of information that flow in the system, much as an electrical engineer views a signal-processing system.

Both the object-based approach and the stream-processing approach raise significant linguistic issues in programming. With objects, we must be concerned with how a computational object can change and yet maintain its identity. This will force us to abandon our old substitution model of computation (section 1.1.5) in favor of a more mechanistic but less theoretically tractable environment model of computation. The difficulties of dealing with objects, change, and identity are a fundamental consequence of the need to grapple with time in our computational models. These difficulties become even greater when we allow the possibility of concurrent execution of programs. The stream approach can be most fully exploited when we decouple simulated time in our model from the order of the events that take place in the computer during evaluation. We will accomplish this using a technique known as delayed evaluation. {{footnotes}}

 
0
Kudos
 
0
Kudos

Now read this

Recreating SICP 1:从一个计算器开始

作者:何岩,禁止转载。 0.前言 # 你知道MIT计算机专业的第一门课是什么吗? 那就是SICP(Structure and Interpretation of Computer Programs) SICP被评为是一本神书。两位作者就像是炼金术士,将自己对计算机科学的真知灼见浓缩在不算厚的SICP之中。 虽然看上去SICP文字不多,但是信息量极大。很多我们常见的争论议题,例如面向对象和面向函数之争,SICP只需要几行文字就能点到本质。看完之后总有一种“... Continue →