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

Design_PatternsThere 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

September 25, 2020

2020 Guide to Outsourcing in Eastern & Central Europe

Key Advantages to Outsourcing in Eastern & Central Europe 

 

September 18, 2020

Spotlight on Colombia: Thriving Software Development Outsourcing Industry

I’ve been to Colombia four times on business trips – twice as a client, working on projects with there; and most recently, after joining the company myself, introducing a new client to the...

July 29, 2020

Spotlight on Costa Rica: Central America's Calling Card

When it comes to work/life balance, Costa Rica gets it right. In this beautiful and peaceful country, a “work hard and play hard” approach to life is the perfect mix. If you’re heading over on a...

Whitepapers

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. 

September 17, 2019

What CTOs Need to Tell CFOs About Software Development Outsourcing

Alignment between your company’s CFO and IT strategy is significant to outsourcing software development

Tech leaders and CFOs need to speak the same language when selecting a software outsourcing...

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