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…
Why Microservices (Intention)
One of the alternative is monolithic application
A change made to a small part of the application, requires the entire monolith to be rebuilt and deployed.
Will become harder to keep changes to affect only a single module.
What is a service
Although the some of the functionalities of these aws services, but actually the have different use cases.
Route 53 is a DNS web services, this aws service allows us to handle route failover and direct traffic base on the weight, geographic, latency etc.
The confusion comes from the similarity of…
Using REST API makes use of endpoints and each endpoint corresponding to a resource. It seems very simple, but it has multiple drawbacks, including:
Under-fetching: Single endpoint may not satisfy what the client needs, which you will need to call multiple endpoints to render the page (n + 1 problem)
Over-fetching: It is hard to flexibly choose what properties (data) you need from resources, the endpoint can give you more data than what you want.
Even you want to optimize the performance and get rid of the under/over fetching problem by creating a dedicating endpoint, it can lead to endpoint explosions at the end (too many endpoints) and hard to be maintained.
We already know that we are a craftsman, we are professionals, and we don’t just want our code to be working, we want people can easily understand it.
Readable code often means code that is easier to be maintained, let's talk about how to write readable code.
Code is like…
Composition obviously is about composing things, it is about composing a small thing from smaller things and from small things into a medium thing, etc.
This allows us to create reusable but decoupled code, which is much easier for us to scale the software, we can compose new stuff from…
Liskov's Substitution Principle reminds us if we are using inheritance correctly. It suggests that we should not always use inheritance and it also actually favour composition over inheritance.
A subtype should do what the parent does, if not then the subtype is actually getting something that it doesn’t need which means the inheritance is wrong.
If we have a parent class Animal which includes a method speak().
It kinda makes sense (depends on use cases) to have sub-classes like Dog, Cat etc. to inherit from it.
But how about Sea Urchins that don’t speak?
And what if there is a dog instance (variation) that can not speak?
The front end mainly focuses on the presentation logic, no matter the client is a web app, mobile app or desktop app, etc. According to which type of device we building the front end for, the presentation requirement can be different.
The backend is responsible to handle requests and persisting/retrieve…