• 運沙

Modular Design in Programming


Note from Cornell

http://www.cs.cornell.edu/courses/cs312/2004fa/lectures/lecture26.htm

"It is practical to isolate modules as much as possible from each other. Many programming languages provide specific mechanisms that enforce, or at least encourage such strict isolation. There are several goals that can be achieved by isolating modules: (a) the source code can be maintained separately; (b) datastructures in one module can not be changed from the other module, or can only be changed in controlled ways; (c) if modules allow only for the minimum amount of interaction that is needed for the correct perfomance of their task, then changing the internal structure of modules becomes easier (we say that modules are loosely coupled).

Programmers control the interaction between a module and and its users by defining interfaces. Simply put, an interface is a contract, in which the module guarantees that it will implement all the advertised functionality, while the users guarantee that they will only rely on advertised functionality (and they will use the module only through the respective interface - this latter requirement is often automatically enforced by compilers)."


​運沙 / Wei / Dh722
1995
普度大学计算机科学系 / Purdue Univ. CS / パデュー大学 コンピュータ科学
南加州大学计算机游戏研发 / Univ of Southern California CS Game Dev / 南カリフォルニア大学 コンピュータ科学 ゲーム開発
I make my own toys.