| Data Acquisition and Online Analysis at the NSCL | ||
|---|---|---|
| Prev | Chapter 5. Best Practices for Building Software | Next |
The basic goals of this section are to invest effort up-front to make life easier down the road. We want to make our life and the lives of the users of our software easy. If we do that we'll be more willing to maintain our software, and our users will be able to turn their attention to the work our software is supposed to enable, rather than wrestling with some of the issues we will describe. We will achieve these goals by attempting to apply a few basic principles and techniques to all phases and areas of our software work.
Isolating Changability. This is really the principle from which all others will flow. We want the things that are most likely to change to be well and truly isolated from the things that we believe will not change. In this way, change when it does occur will be easier to handle.
The open-closed principle. The open closed principle states that software should be open for extension, but closed for modification. This means that we must provide ways for our users and ourselves to add functionality to our systems without changing the underlying core of the software. This too makes change easier to manage by providing us with a stable base on which to build the software for any given experiment. We don't have to worry that we or our users will break something that already works, because our systems will be closed for change. We don't have to worry that we or our users will not be able to meet the needs of a specific experiment because our systems will be open for extension
Separation of responsibilities/concerns. I'd like to go beyond the normal software meaning of this... that software concerns should be well isolated into independent separable modules. This principle should also apply to the manner in which we make our software available. We want to be responsible for our device, and our piece of the experiment. We want this because we understand it and the software that supports it better than anyone else. We want the user to be responsible only for the differences between our device and their needs. Those are issues they understand. We don't want or need them to be modifying our software modules directly. Our technique to achieve this will be software patterns that implement the Open Closed principle.
Plan for Recovery From Mistakes. We are all human. We all make mistakes. Some mistakes are trivial, others are large. We must build and maintain our software in a manner that allows us to recover from the big mistakes.