Top-down design starts by decomposing project requirements into tasks, with an executive task that is responsible for meeting
all requirements for the application. It uses a number
of helper tasks that are each responsible for some partitioning of the requirements. Packages that grow out of top-down design
are seldom reusable as they focus on meeting requirements for this specific application.
Tasks are the major steps an implementation must carry out to complete its mission. These usually involve assembling inputs, carrying out a number of
computational steps, and displaying results. Each of these tasks are candidates to become packages.
We want each package to be cohesive, that is, focused on a single activity or a few intimately related activities. That means that
the abstraction the package implements is simple, even if the processing within the package is not.
Start a design by enumerating all major obligations of the application and:
-
Configure obligations into tasks. Each task becomes a candidate application-side package.
-
The first "Executive" task is responsible for all obligations and it carries them out with the help of lower-level tasks.
-
The text of each task-based package should make clear its responsiblities and actions.
-
You then start implementing small parts of a package, building many times as you proceed, to make sure that what you've done so far works
as you intend. Build small and often with enough testing to make you confident that what you've implemented works.
-
You may discover that as you begin implementating a package there are package tasks that could or should be implemented
as lower level packages, so the process becomes recursive.
-
Also, on rare occasions, you will find that the processing in a package is so small and simple that you may
decide to merge that with some other related package. Do this only if the merger results in a cohesive package.
-
Eventually this process may stall, and we then turn to bottom-up design to build solution-side packages.
We will start this process in class for the first couple of projects so you can see how this is done.