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 behaviorso 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 obviousthe 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.