What is a modern application? How can you define a modern design? Given the pace of changes in technology, the term modern can be hard to define. Every day, new technologies are built, patterns are designed, and recommended practices are refined or changed. Given the dynamic nature of software development, it is easier to understand what is a bad design.
A bad design exhibits many characteristics that you want to avoid in the software that you build. Let's review some of the characteristics of what contributes to bad design and some design techniques that you can use to avoid them.
Symptoms of a bad design
On the first release of an application, programmers have a clear view of what the software is and how it is built. If they need to make a change, it is often easy for them because of their familiarity with the code. As time goes by and multiple programmers start making changes, new additions, and updates, the application starts to deteriorate. Why does this happen? Why
does software degrade over time? There can be many reasons and sometimes this degradation can be difficult to avoid, but you should focus on creating a good design that is harder to break over time.
If your application exhibits one of the following symptoms, you are probably facing bad design:
The application is hard to change because a single change can trigger a cascade of multiple changes. With rigid designs, what appears to be a simple change can convert to a complex project that is difficult to estimate. The more modules that are affected by a
change, the more rigid the design.
Changes cause the system to break in many places when a single change is made. These parts have no conceptual relationship with the area that was changed. Fixing one problem can cause new problems.
A design is immobile when it contains parts that might be reusable, but the effort to separate them from the original system are too great. The application is too tangled to reuse parts of it.
When you are doing a change in an application, you have two options: preserving the design or “hack” and break the design. Viscosity makes it harder to follow the design preserving method. Over time, developers tend to start doing “hacks” more frequently to the application because of a lack of understanding and time pressures.
Software design is essentially a creative process. But sometimes, a design contains elements that are not currently useful. Anticipating requirements might seem like a good thing, but if this code is not carefully planned, it converts into source with complexities that
do not add benefit.
The design contains repeated structures that can be unified under a single reusable component. Sometimes programmers use a “copy-paste” approach for coding, which can lead to redundant code that makes it difficult to do changes and correct bugs.
The design and the code are hard to read and understand. It does not express its purpose correctly.
In the following sections, you learn techniques that can help you to create modern designs that attempt to avoid these problems. When you read these sections, keep in mind the bad design symptoms that are described here and discover how these preferred practices can help you avoid them.