Architecture Style
The architectural style is a very specific solution to a particular software that focuses on how to organize the code efficiently created for the software.
It is the granularity of the highest level that focuses on creating the layers, high-level modules, and communication/interaction between the various modules in the software.
The architectural pattern is the description of relationship types and elements along with a set of constraints to implementing a software system. The patterns are usually reusable solutions for common problems or models.
Examples of Architectural styles
- Layered Architecture
- Component-based
- Monolithic
- Microservice
- Event-driven
- Publish-subscribe
- Client-server
- Service-oriented
Architecture Pattern
A pattern is a recurring solution to a recurring problem. In the case of Architectural Patterns, they solve the problems related to the Architectural Style.
Architectural Patterns have an extensive impact on the code base, most often impacting the whole application either horizontally (ie. how to structure the code inside a layer) or vertically (ie. how a request is processed from the outer layers into the inner layers and back). Examples of Architectural Patterns:
- Three-tier
- Model-View-Controller
- Model-View-ViewModel
Design Pattern
Design patterns are usually associated with code-level commonalities. It provides various schemes for refining and building smaller subsystems. 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 mechanisms of a system.
Below are the few use cases where we can think of design patterns
- How can I avoid expensive operations for each request which is common for all (maybe a Singleton pattern?)
- How to instantiate an object when we only know what type needs to be instantiated at run time (maybe a Factory Class?)
- How to make an object behave differently according to its state (maybe a state machine, or a Strategy Pattern?)
Creational, Structural and Behavioural Patterns will come under design patterns. You can read more about design patterns here
Conclusion:
- The architectural style is the application design at a high level of abstraction to 1000 feet view of Application
- Architecture patterns talk about the high-level components and communication between the components in the application
- Design pattern talks about the classes, objects, and relationships between the classes
Happy Coding 🙂
Before you go…
If you found this helpful please share it on Twitter, Facebook, LinkedIn, and your favorite forums. Big thanks for reading!
References:
Originally published at http://learninghubspot.com on June 17, 2019.