Feb 15, 2009

Programming Insights 3 - Make errors localisable by design

Errors may not be a huge problem is they cause not much harm (e. g. if they occur in a CMS for a web shopw) and if they are easy to fix. Most errors are easy to fix if the are localisable within a component. And if that component is rather small. Therefore one should design module systems where at the component boundaries there are strict checks. This makes errors localisable and easy to fix. So it is at development time less important to avoid them, so it is possible to develop much quicker. To achieve strict checks at component boundaries, the "surface" where two components touch should be small. So interfaces between components should have simple data structures and few methods. Taken to the extreme, each component has simply one method: "process this change object".

No comments:

Post a Comment