Object-oriented programming
is the methodology of choice for "programming in the large" — building large scale software packages that are robust and maintainable, easy to extend and to enhance. C++ is the language of choice for large scale software engineering: it is not a pure OO language but a hybrid that also supports generic programming and structured programming (it is definitely a better C, although its complexity makes writing reliable compilers hard). OO techniques are most applicable when the problem to be solved can be represented by entities (objects) that have internal state, specified behavior, and distinct identity. In the case of XSPEC many of the components of the problem domain have clear "object" nature: Spectra to be analyzed and models to be fitted are obvious examples, but so is, for example, the more abstract notion of a "command" which will create a plot on the screen or the printer.
|