Architectural vs Design Patterns: Software Engineering
courtesy quotefancy

Architectural vs Design Patterns: Software Engineering

Software design patterns are some proven ways to solve a reoccurring problem faced by programmers. These are general solutions to general problems which have been proven from the experience of many programmers. There are a lot of benefits using these patterns including more convenient solution, more cleaner code and since these patterns are now become standard, Its very helpful to use these pattern terms while explaining ideas to someone else.

Before directly diving into software design patterns, we must have to understand the difference between software architecture and software design since these terms are closely related and often cause confusion.

In general (switch off your inner programmer for some time) the architecture and design both explains the 'idea' but Architecture focus on the abstract view of idea while Design focus on the implementation view of idea. A design is much more detailed than architecture. Architecture pictures the abstract view of the whole system while Design pictures the implementation of some specific concerned domain.

Suppose government wants to build a new city. First they will create a high level abstract diagram explaining where will be the housing area, where will be factory area, where parks should be located, where to locate grid systems, hospitals, schools, markets and so on. This is Architecture. Now after that they will create diagrams explaining how houses are built, how much maximum area a single house can have. How to build houses side by side. How much wider the school front would be. How many beds and rooms the hospital would have, etc etc. This is Design.

Now come back to programming, an Architecture explains components and their interaction while a design explains how each component is built or would be build. So there are architecture patterns and there are design patterns and both of them are different.

Architectural Patterns:

There are bunch of architectural patterns available and choice of one is solely depends on the nature of the given problem. Some famous patterns are:

  • Model View Controller
  • Model View Controller Service
  • Model View Presenter
  • Model View ViewModel
  • Multi tier
  • Micro services
  • Event Driven
  • Service Oriented

and much more...

Design Patterns:

There are famous 26 design patterns divided into three categories:

1- Creational Patterns:

Includes Abstract Factory, Builder, Factory Method, Object Pool, Prototype and Singleton pattern.

2- Structural Patterns:

Includes Adapter, Bridge, Composite, Decorator, Facade, Flyweight, Private Class Data and Proxy pattern.

3- Behavioral Patterns:

Includes Chain of responsibility, Command, Interpreter, Iterator, Mediator, Memento, Null Object, Observer, State, Strategy, Template method and Visitor pattern.

How to use these patterns?

The choice of relevant pattern depends upon problem and choosing right one requires experience. These patterns can be used in any field of computer science, from simple applications to AI based solutions, from Games to Business Intelligence, from embed systems to websites.

Although these patterns are very helpful, yet you have to be careful because choosing wrong one will actually makes your program a mess. Never try "must use this pattern" instead you should always think about your problem first and then think which pattern should be appropriate. There are no hard and fast rules about implementation so you can customized solution according to your need. These patterns should obey your program, not vice versa.

That is all for today, In later articles we would discuss these patterns one by one with very simple and understandable examples. Thanks for reading, please leave a comment in any case of question or suggestion. Happy coding !

Azhar Iqbal

Senior Software Engineer | Python | Node | Docker | AWS

5 年

Good Article

回复
Frans Lerato Kekana

System Engineer / Solutions Architect

6 年

Great explanation, Thanks

回复

要查看或添加评论,请登录

Muhammad Asher Toqeer的更多文章

  • Modern Java as Data-Oriented Language

    Modern Java as Data-Oriented Language

    Java, at its core, is an Object Oriented Language. But, Object Oriented Programming alone can't solve all of the…

  • Spring Framework Brief Overview

    Spring Framework Brief Overview

    History Spring is a framework for Java Enterprise Application Development. It started in 2003, at that time Java offers…

  • Java Modules Introduction

    Java Modules Introduction

    Classes are the basic unit of a program in Java. Packages are used to manage classes and modulesare used to manage…

  • Handling Mistakes as a Developer

    Handling Mistakes as a Developer

    This article is based on "A Pragmatic Philosophy" from the book: "The Pragmatic Programmer". Mistakes are Inevitable.

  • Java 8 Functional Programming Simplified

    Java 8 Functional Programming Simplified

    This article will explain Java 8 functional programming related concepts, i.e Lambda expressions, Functional…

  • 3 Years being a Software Engineer, Here are some things I have learned

    3 Years being a Software Engineer, Here are some things I have learned

    Life is a journey, so as your carrier and like every other journey, your carrier teaches you a lot of things. Here are…

    2 条评论
  • MVC and MVCS : Software Engineering

    MVC and MVCS : Software Engineering

    In previous article Architectural vs Design Patterns: Software Engineering we discussed in detail about what…

    2 条评论
  • Variable Names, Some tips

    Variable Names, Some tips

    Variables can be your best friend, or your worst enemy and that depends on You. If you are not careful and just…

    2 条评论
  • Meaningful Class Names

    Meaningful Class Names

    This article is about naming classes, mainly it is about "how to meaningfully name your classes" remember in…

    3 条评论
  • Function Names, do it right

    Function Names, do it right

    In programming, naming identifiers (class, method, variable names) is one of the most crucial part of writing code. If…

    7 条评论

社区洞察

其他会员也浏览了