Dr. Dobb's is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.


Channels ▼
RSS

Design

The Value of Pattern Implementations


Why Bother?

The main benefits of pattern implementation use can be summarized as:

  • Increased productivity accelerates the building and testing of software, and ease of use for beginners.
  • Improved software governance enforces architectural, design, and coding standards, and increased quality. Higher quality end products due to a higher level of consistency. Greater leverage of expert skills within the development organization.
  • Architecture simplification provides both a vocabulary and set of widgets used to design and implement a solution, and automates how you deal with complexity.

With a pattern implementation, the key idea is that we've codified and automated a best practice. When it comes time to use the pattern implementation, we're able to perform the work much faster than if we were doing it manually. The pattern implementations can be used to generate both the code (and related artifacts that comprise the solution) as well as the artifacts used to test the solution. We always have to pay some price to develop the asset initially. However, if we use the asset many times, we save each time we use the automation, versus performing the task manually.

The use of pattern implementations also lets those new to the team use the asset without necessarily having the experience or knowledge required to actually create the pattern. They just need to know how to use the resulting asset, which of course, represents the best practices. As such, they are able to operate at a much higher level than if they were forced to struggle ahead on their own.

As team sizes increase and members of the team specialize, we often find it challenging to ensure that those implementing the architecture and design stay true to the intentions of the architects and designers. An additional challenge here is that team members often may not be colocated, but distributed around the globe.

To address this issue, you can leverage pattern implementations in two ways:

  • To transform the design into the desired code artifacts. In this way, little is left open to interpretation, manual error, or undesired/unintentional creativity.
  • To transform the code artifacts into design elements. In this way, you can reconcile the current code artifacts with what was specified in the design.

Governance also involves determining and managing the relationship between requirements and the solution that is built to meet those requirements. You should be able to trace all code back to requirements. We call this concept "traceability," and it is used to manage both what code is written in the first place as well as to assist us when it comes time to determine the impact of change.

To support traceability within the model, you can add connections that show the relationship between the elements in the design and the requirements. The pattern implementations are able to mimic this behavior—so that as we apply the patterns in the solution, they automatically create traceability links between model elements that were the input to the pattern and those artifacts that end up being generated.

Because of these links, you can show how the elements of the solution map back to requirements. If those requirements change, you can answer the question, "What is the impact of the change?" If you need to change the code, you can answer the question, "Why is this coded to behave this way?"

Regardless of how fast you build your solutions, all is lost if the quality is not at an acceptable level. The first way pattern implementations can assist here is obvious—the pattern implementation is an embodiment of our best practice solution. By using the pattern, the generated output is the best that you can generate and should meet quality requirements.

There are also less obvious ways that pattern implementations can improve the quality of solutions. For instance, if an error in a pattern is found, you can update the pattern implementation and reapply the pattern. Reapplication means that you just rerun the pattern and have it regenerate output that contains the fix. If you had performed the work manually, you would have to manually fix the code in each place where the error occurred. And since you would be performing that work manually, odds are that you would introduce a new defect somewhere in the updated code.

When we codify our best practices in the pattern implementation, we are implicitly stating that we are working with experts to create a representation of the best practice. If we left this work to be done manually, it might be performed by a group of people with varying skill levels. That we are able to replicate the work of the most skilled team members leads to a higher level of quality.


Related Reading


More Insights






Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

 
Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.