Photo by Joseph Barrientos on Unsplash

Blindly separating into small services and believe that will provide the code to be loosely coupled and easier maintained and deployed is a delusion.

It might give you delusion that it brings those benefits at first, but when business requirements changes, you might see the changes will cross cut the services as they are actually just indirectly tightly coupled.

The well designed boundaries and coordination between etc. services with the hard work to deal with current business requirements and also prepare for the future by considering the cost between creating boundary vs delay decision (since over-engineering can cost more)

These considerations and leverages should be the factors driving architects to making decision on the architectural styles, principle and decisions.

Photo by veeterzy on Unsplash


Be able to treat objects with whole-part relationship uniformly.

We might face nested classes hierarchies that are hard for the clients to do some unify operation on them such as iterating them as the sub tress are not in the same pattern.

Composite Pattern comes to the rescue by allowing…

Photo by Marc Schulte on Unsplash


Since language like Java might have different data structure for users to do iterations, such as ArrayList, Array, HashList etc. And the methods exposed from those data structure objects can be different and because of some reasons we can change the existing code to unify them.

Iterator Pattern indicates that…

Photo by Siyuan on Unsplash

What is software architecture?

Software architecture consists of four parts:

  • System structure (architecture styles): like monolithic or microservices.
  • Architecture characteristics: Including availability, reliability, testability, scalability, fault tolerance… etc.
  • Architecture decisions: The rules (disciplines) defining how the system should be constructed, example will be which layers can access which layer. (Variance model should be created to assess cases that can not follow the rules)
  • Design Principles: Soft guidlines created for the team to decide what to do in certain scenarios, as the hard diciplines (decisions) can not be defined for every cases. Example of a principle (guidline) might be dev team should leverage asynchronous messaging between services.
Photo by Artur Aldyrkhanov on Unsplash


Sometime we need to generate an object conditionally, for example as a pizza store, we need to create a lot of different pizzas, the procedure of creating a type of pizza can be complex.

And to follow Single responsibility and Open close principles, we know that we should keep this…

Photo by Diana Polekhina on Unsplash


Decorator pattern complies with the open close principle, which suggests open to extension but close to modification, and decoration this word already imply that we do it by adding decorations (addon layers) on top of a core (object to be decorated).

When to use it

It introduces loosely couple design but also introduce some…

Photo by Kelly Sikkema on Unsplash


Interface Segregation Principle (ISP) suggests that the client (dependent client modules) classes should not be able to access the methods / states that the class that they are depending on (composition / inheritance).

Usually this happens when we design a class / interface with a big scope (class explosion) and the changes of that class will cause the client (dependent client modules) classes needed to be re-deployed and re-compiled.

Photo by Ryan on Unsplash


As an engineer we build out features of a software but to ensure the feature works well we need to do testing to ensure the quality.

Unit tests are written by the engineers mostly that written out the function, class etc.

Photo by Umberto on Unsplash


Domain Driven Principle is a powerful principle aiming to solve problem for a project related to a complex domain, it advocates how engineers communicate with domain experts and how to embody the domain knowledge into the software.

DDD works very well with onion architecture that emphasis on making use business…

Tak Yu Chan

Graduate Software Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store