Object Oriented Design
Redesign Home Design Problem Scripting Compatibility
Patterns

Coding Idioms

Classes

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.


It's often stated that OO programs have by definition to use "inheritance", whereby one kind of object obtains functionality either from a simpler base object or from an interface that adapts it for additional uses, or both. One of the main benefits of inheritance is programming at a higher level of abstraction - being able in some sense to treat different but related objects the same way (an analogy might be that inheriting a new interface is like adding a Firewire card to your computer. It can now talk to different devices).

A common feature of Object-Oriented Design is the Model-View-Controller arrangement, where the parts of the program that deal with the problem domain (Model), the display (View), and the user input (Controller) are written in independent sections of the program that communicate through well defined interfaces. XSPEC12 follows this philosophy of design which is a commonly used architecture for GUI driven software. You'll see the words "Model," "View," and "Control" in the headings of some of the other pages on this site.

Design Patterns have been described by their proponents as "elements of reusable software". They do not consist of code fragments, but rather techniques for writing code to solve common problems that crop up in object oriented software engineering (example: how to turn different strings into different objects from a class hierarchy). The use of patterns in XSPEC12 is documented on separate pages.

[Redesign Home]
[Design]
[Problem]
[Scripting]
[Compatibility]

Xspec Xspec Home Page


HEASARC Home | Observatories | Archive | Calibration | Software | Tools | Students/Teachers/Public

Last modified: Wednesday, 02-Mar-2011 11:09:04 EST

HEASARC Staff Scientist Position - Applications are now being accepted for a Staff Scientist with significant experience and interest in the technical aspects of astrophysics research, to work in the High Energy Astrophysics Science Archive Research Center (HEASARC) at NASA Goddard Space Flight Center (GSFC) in Greenbelt, MD. Refer to the AAS Job register for full details.