Functional Decomposition
Introduction
- There are a variety of paradigms available for managing the
complexity of a program.
- An object oriented paradigm attempts to encapsulate actions and
attributes within familiar objects. You talk about the design in
terms of objects and their common activities and operations, and
common diagrams include object hierarchy diagrams, object interaction
diagrams, and sequence diagrams.
- Functional decomposition is another (simpler but less powerfull)
paradigm where the program is broken down into a series of defined
steps, and these steps are seperated into seperate modules. You talk
about the design in terms of functions and subroutines. Common
diagrams are flowcharts.
- Perl's functional decomposition tool is the subroutine, also
known as a function.
- To declare a function, use the following form:
sub subroutine_name {
statement;
statement;
statement;
}
Back to Syllabus
Previous: Introduction
Next: Function Global Scoping