Design Pattern vs Architecture Pattern

Reinaldo Riant
Ruang Aldo
Published in
5 min readJan 18, 2021
Photo by Pascal Larocque

Design Pattern and Architecture Pattern. What’s the difference between them?

This time I will discuss a knowledge that is often misunderstood by most programmers. We start by understanding the design pattern and architecture pattern.

Design Pattern

When we create software or application projects, some of the developers have problems with the same things over and over to do coding. So, we need a design pattern to solve that.

Then what is a design pattern and why is a solution offered?

The design pattern is a solution design for solving common problems in software or application development.

If we take the reference from Wikipedia :

Design pattern is a general, reusable solution to a commonly occurring problem within a given context in software design.

Like a blueprint that we can change to troubleshoot on our code. The pattern itself is a way to design a class and how the interaction will occur between
classes so that our class wake can be more elegant and reusable.

When we use the design pattern itself also depends on the conditions experienced, so it depends on the problem we have met when we do development. And for the implementation stage, the design pattern is only efficient if the developer has run into problems before. In case we do the trial and error process in software development.

The benefits of Design Pattern as following :

  • The line of codes is more structured, neat, and easy to read and implement. So that other developers can reuse it sometime.
  • We can give our project to other developers to continue, which is the condition of the developer must know about the design patterns currently in use.
  • We can solve software development problems commonly.
  • Enhance time efficiency in development software.
Design Patterns: Elements of Reusable Object-Oriented Software and other

Quoting from a book initiated by Gang of four entitled Design Patterns: Elements of Reusable Object-Oriented Software and others, there are 25 patterns that we can learn. It is divided into Three Parts :

  1. Structural Design Pattern provides a way to create structures from a class or object (Example: Adapter, Composite, Flyweight, Proxy, Facade, Bridge, Decorator)
  2. Creational Design Pattern provides a way to instantiate objects for a specific of situations (Example: Singletone, Factory, Abstract Factory, Builder, Prototype)
  3. Behavioral Design Pattern provides a way to communicate between an object with a class (Example: Mediator, Chain of Responsibility, Observer, Strategy, Command, State, Visitor)

if we describe it like this :

Types of design pattern

Well, now we’ve learned about design patterns. Besides design patterns, there are also those the name is architecture Pattern, you know. Let’s learn!

Architecture Pattern

Next, we continue with the architecture pattern. What is that?

The architecture pattern is an explanation abstract about how to applications structure that we will make.

If we take the reference from Wikipedia :

An architectural pattern is a general, reusable solution to a commonly occurring problem in software architecture within a given context.

Architecture pattern is very similar to design patterns but has a comprehensive scope. These are patterns for the overall layout of your application or applications. They all have advantages and disadvantages.

Many architectural patterns exist out there, you can see the list on Wikipedia. Some of them and maybe not a stranger to us are:

  1. Layered pattern
  2. Client-server pattern
  3. Naked Object pattern
  4. Peer-to-peer pattern
  5. Model-view-controller(MVC)
  6. Presentation-abstraction-control(PAC)
  7. Model-view-presenter(MVP)
  8. Model-view-viewmodel(MVVM) pattern
MVC, MVP, and MVVM

In Android development, we aren’t familiar with MVC, MVP, and MVVM. These architects have the same purpose. So the code can be simple with ease tested. It makes application to be flexible enough for further development. So that we don’t go too far, we will start this discussion in the next article 😉.

Design Pattern vs Architecture Pattern

After we read it all and get confused, what’s the difference between them?

Ultimately, the differences between design and architecture patterns reflect their different uses. Architecture represents scaffolding, the frameworks that everything else sits upon. Design patterns represent a way to structure classes to solve common problems. While both are designed to add clarity and understanding, they operate at different levels of abstraction.

Architects must have both kinds of patterns at their disposal: design patterns to build the best internal structure, and architectural patterns to help define and maintain the underlying scaffolding of the application.

Design patterns are usually associated with code level commonalities. It provides various schemes for refining and building smaller subsystems. It is usually influenced by programming language. Some patterns pale into insignificance due to language paradigms. Design patterns are medium-scale tactics that flesh out some of the structure and behavior of entities and their relationships.

While architectural patterns are seen as commonality at a higher level than design patterns. Architectural patterns are high-level strategies that concern large-scale components, the global properties, and the mechanisms of a system.

So there are architecture patterns and there are design patterns and both of them are different.

As always, I would love to hear your thoughts on this matter :) and feel free to discuss and hope you can give me feedback bellow on this article, please reach me out at reinaldoriant@gmail.com 😉

--

--

Reinaldo Riant
Ruang Aldo

a good man who interest with software development