The basic definition of an algorithm is a detailed and precise description of the sequence of steps for the behavioral aspect of a problem solution. This algorithm is normally broken down into smaller tasks, each carried out by an object and defined in the classes. In the design phase of software development, the detailed design of the classes includes descriptions of these smaller algorithms.
In an object-oriented program, every object carries out some particular task. The collaboration of all the objects in a program will accomplish the complete solution to the problem. As mentioned in previous chapters, the overall design involves detailed design of the classes in the problem. The design of a class describes the data and the tasks that the objects of the class will carry out.
Because the class is the main decomposition unit in a program, the overall algorithm for a problem has been decomposed into smaller algorithms, each described in the design of the class. The algorithm of a class is further decomposed into each operation in the class. This is the second level of decomposition for algorithms.
In object-oriented design and programming, the algorithms are described at the level of the operation. At this level, traditional structured design and programming techniques can be applied.
Note | An algorithm is normally described in an informal notation, such as pseudo-code, a flowchart, or English. |