Monday, December 10, 2007

Object-oriented design

The goal of object-oriented design is not only to reduce dependency, but also to remove ambiguity.For example, using DataSet as a universal data transfer object definitely reduces dependency, but increases ambiguity a lot, requiring you to understand the non-documented contract of what data should be in the data set and what do they represent. By using strongly-typed objects you document the contract and reduce ambiguity.

Here is the strong point of the strongly typed languages vs. dynamic languages. The contracts in the strongly typed languages are usually more pronounced. Unit tests can compensate for the missing contract details but cannot themselves become a part of the object contract.

Monday, December 03, 2007