4.6 Algorithms


4.6 Algorithms

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.




Object-Oriented Programming(c) From Problem Solving to Java
Object-Oriented Programming (From Problem Solving to JAVA) (Charles River Media Programming)
ISBN: 1584502878
EAN: 2147483647
Year: 2005
Pages: 184

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net