Insights | The 5 Ways to Improve Your Software Quality: Design Patterns

The 5 Ways to Improve Your Software Quality: Design Patterns

By Andy Hilliard | January 21, 2014

There are five ways to improve software quality, and this post focuses on design patterns.

A design pattern simply takes the solution from a previous problem and applies the concepts from that solution to solve a new problem.

 

I recently moved into a new house, and in my new home office, there is area section of floor made of rough stone, which once was under a wood stove. I thought this area would be an ideal place for bookcases, except the rough surface was too uneven. I came up with numerous ideas to try and fix this, including ones that required putty and sand, but none of my ideas were as fool-proof as what a carpenter finally suggested. The carpenter explained how to plane wood and utilize shims to solve my problem.

He had a design pattern – a proven process that had solved many other other construction problems. (And you can see my now stable bookcases behind me in our recent software outsourcing videos).

Programmers face similar situations. Problems arise, and if the programmers have never experienced that specific problem before, they might try something akin to my putty-and-sand idea. In the 1990s a group of programmers (called The Gang of 4) recognized this kind of situation and wrote a book about the commonly repeated patterns of object-oriented programming (Java, C++, etc.). They developed a problem-solving catalog for programmers that detailed existing design patterns and the circumstances in which they would want to use those patterns. The Gang of 4 also divulged the consequences of using certain patterns and what limitations they might experience later.

There are three patterns most often used in object-oriented programming.

Publish-Subscribe Pattern

The first is the observer pattern, which is also known as the publish-subscribe pattern.This is a behavioral pattern that watches for changes in one part of the application and then communicates those changes to other objects within the program. This is a dynamic pattern that notifies other systems or objects when changes occur. For example, this is the pattern responsible for updating schedules in response to changes in a “date” field. The observer pattern is looking for behavior in that field and prompts other objects in the code to use that new date.

Factory Pattern

The second type of pattern commonly used in object-oriented programming is the factory pattern. This is considered a creational pattern, because it eliminates the need to write code for each different object that needs to be created. For example, factory patterns are used to create the dialog boxes in Windows and Mac OS. The code in the factory pattern runs a test to determine if it’s running on Windows or running on a Mac. Depending on the answer, it creates the appropriate box in the appropriate way. The pattern simplifies the code, because the pattern creates the dialog boxes in the unique way necessary, without the need to write code for every type of box.

Structural Pattern

This pattern helps organize objects in the code and is especially helpful with combining objects into larger structures.

Professional programmers are expected to know and use design patterns. There are several design pattern resources available that can help programmers develop solutions to new problems – there is no need to try putty and sand. Software developers who use design patterns as part of their organization’s culture greatly enhance the shared knowledge within their software development group, and the quality of the software they develop.

When evaluating a software development service company, ask them about their use of design patterns when developing software for their clients. IT’s one of the things we look for when assessing our global partners.

More from Accelerance

November 17, 2020

GET DISRUPTIVE or GET DISRUPTED: THE OUTSOURCING INNOVATION IMPERATIVE

Outsourcing has long been equated with farming out back-office or non-core business functions – a routine tactical role. But the ever-more relentless pace of technology change has promoted...

October 21, 2020

Spotlight on Ukraine: Software Development in Lviv, the Silicon Valley of Eastern Europe

Almost every city with a solid tech scene draws comparisons with Silicon Valley. The iconic California region is synonymous with a mature software industry, tech innovation and growth, a superior...

October 15, 2020

Spotlight on Hungary: The Swiss Watchmakers of Software Development

It’s not a word I often use, but the new outsourcing partner I came to visit in Budapest could definitely be described as boutique. In total, they have less than 50 software developers (the largest...

Whitepapers

September 25, 2020

2020 Guide to Outsourcing in Eastern & Central Europe

Learn About the Key Advantages to Outsourcing in Eastern & Central Europe:

August 15, 2020

2020 Guide to Software Outsourcing Rates

Gain insight into the latest rates for software development outsourcing resources with our proprietary benchmarking guide that offers:

July 27, 2020

2020 Guide to Software Outsourcing in Latin America

Qualified software engineering teams are not easily found. 

How can we help you succeed?

We make outsourcing successful with innovative partner selection services and tailor-made consulting solutions to ensure your desired outcomes.

Let’s Get Started