Saturday, December 11, 2010

Project 11 – Problem Solving Techniques: Top-Down Design – Unitizing a Problem into Modules

Top-Down design in Programming:

Top-Down Design is a strategy of programming in which a programmer views the overall picture of the program, and then breaks down the system into the components that comprise the makeup of the system. These components are then broken down and refined into their base components

Top-Down Design is a strategy of programming in which a programmer views the bigger picture of the program, so that one can plan the modules that make up that program. This approach is also known as step-wise refinement. The main idea behind the approach is for the programmer (or programmers) to start with the full scope of the program. In essence, the programmers start with the end result of the programs function. From there, system into the components that comprise the makeup of the system and then breaking them down further until they have been refined into modules. This allows one to focus on a single module, rather than the whole program. With the Top-Down Design approach, it is best to break down the modules to their lowest form (or element). Modules that contain sub-modules should be broken down, so that there are no complex modules.

More often than not, there is more than a single programmer developing a system; so, by breaking this system down, each module can be divvied out to different individuals within the development team.

The benefit of breaking up the modules in such a way is to ensure that no one module is dependent on the other. If the output is an error, one can easily ascertain which module is causing the break, rather than having to rifle through complex integrated code.

Top-Down Design outside Programming:

With most processes that are designed to produce something, they in themselves (or at least those that are good) often times provide a way to correct problems that can appear within the process, or with the end result.

If one were to take Top-Down Design outside of the programming world and apply it to any other problem, it would work along the same way.

Imagine if you wanted to create a Thanksgiving dinner, the idea of creating the full dinner could be quite overwhelming.

Using the Top-Down Design approach:

  • Divide the dinner into courses:
    • 1st Course
    • Main Course
    • Sides
    • Desert
  • Break down what would be in each course:
    • 1st Course:
      • Devilled Eggs
      • Veggie Plate
      • Etc.
    • Main Course:
      • Turkey
      • Ham
      • Pot Roast
    • Sides:
      • Green Bean Casserole
      • Garlic Mashed Potatoes
      • Bread Rolls
      • Cornbread
      • Cranberry Sauce
      • Etc.
    • Desert:
      • Sweet Potato Pie
      • Cheese Cake
      • Pumpkin Pie
      • Pecan Pie (yes, I love pie)
      • Etc.

By breaking down the entire dinner (while adding in some of my favorites), one can now work on a portion of the dinner at a time. In many families, one person is responsible for either a single dish, or course. This is much like in programming, as it is easier to focus on a piece of the whole, as opposed to trying to accomplish the whole thing.

No comments:

Post a Comment