There are two basic strategies to dealing with information processing and software design: the top-down and the bottom up approaches. These two paradigms are often used at the start of development to create domain models and plot the path of work to be done on a project. While they are often used concurrently, there are specific drawbacks and benefits to each, and balancing this is key to building a successful piece of software.
The top-down approach, also known as step-wise design, essentially breaks a system or model down into component sub-systems, each of which may further broken down further. However, no first-level system are defined – you won’t describe a for loop, or define the attributes of an object in the top-down approach. Systems end up as a series of ‘black boxes’; components that have specific inputs and outputs, but no definite internal structure.
- This approach lends itself to most projects, and doesn’t require a specific kind of team or breakdown
- It allows large teams to split themselves amongst subsystems
- Due to definite inputs and outputs of each subsystem, combining them is simplified
- It encourages object-oriented programming (OOP) via encapsulation
- It is still very successful for functional programming
- It works very well for small projects, by laying out specific ‘tasks’ to be done.
- Easy to maintain, because of this subsystem partitioning
Why Not Top-Down?
- It is difficult to guarantee that the initial design adequately models the desired system
- It is tougher to do testing, as a large portion of the design must be done first
- On a large projects, reduntant code may become an issue
If you know what Legos are, you know what bottom-up design is. It consists of defining and coding the very basic, definite parts of the system to be designed, then linking these parts together to form the whole.
- This approach allows teams to code functioning sub-systems quickly
- Testing can be done early and often, as first-level systems are defined first
- It encourages and leads to reusable code
- Pre-existing code is simpler to incorporate and test
Why Not Bottom-Up?
- Without some forethought, modules may be difficult to link together
- The resulting system may be tangled and difficult to maintain
- Without an overarching design, it can be difficult to define specific functionality for each module
So What Do I Use?
There is no definite answer to which approach is better. Large systems or projects with bigger teams may be very difficult to build using the bottom-up approach, but may still benefit from implementing some first-level systems for early testing. Small teams may find that though their pre-existing libraries enable them to rapidly build their system, describing the overall layout of the project helps them link those libraries together. By enumerating the trade-offs and benefits for your particular projects, you’ll better be able to decide which approach can help you.