CAP theorem is a concept that computer scientist Eric A. Brewer coined during a distributed computing talk in 2000. That’s why it’s also known as Brewer’s theorem. It states that a distributed system cannot have more than two of the following guarantees. ConsistencyHigh availabilityPartition tolerance A proof was published two years later by two MIT professors Nancy Lynch and Seth Gilbert. The term distributed system refers to a network that stores data on many physical or virtual machines (nodes) simultaneously. All cloud applications run on distributed networks; thus, a developer needs to understand how it works. A developer with a…
I am often asked where to start if you are learning design patterns. A Strategy pattern is a perfect way to start. It is probably the most straightforward pattern. If I think about it in only a few words, I would say that it is about using composition rather than inheritance. But, let’s consider the basic logic of the Strategy pattern. This behavior is typical in everyday programming that we do not even think about using this design pattern. When we implement an interface, we are already using the strategy pattern. The basic idea is that we are defining an…
Every junior developer faces the design patterns, and it seems to be a hard understandable thing at first glance. But! I’ll explain to you further in this article what they are, and you’ll get it. By using design patterns, your software development process will be much easier (and less painful). So, let’s start. What is a pattern? To figure out easily what is the design patterns let’s define what pattern is generally. A pattern is a repeatable element in various life spheres. It can be a sort of color combination, a shape of some object, or a mechanism. According to…
The last time we talked about software architecture, I introduced you to Layered Architecture. Today we will start with Clean architecture (also called Onion or Ports and adapters architecture) and more specifically domain-driven design. Clean architecture as a concept is significantly more complex than layered architecture. So I decided to split the article into two parts. In today’s article, I will try to explain the idea behind Domain-driven design simply. What is Domain-driven design? We need to understand domain-driven design because it lies in the center of Clean architecture (figuratively and literally). Domain-driven design has its technicalities (that we are…
Layered architecture is the first architectural pattern that we are going to explore. If you haven’t read my article about software architecture, I suggest you do it before continuing with this one. What is a layered architecture? Simply put, the layered architecture pattern’s main idea is to group and isolate system concerns while defining strict communication direction between them. Each group of related modules/classes we call layer. Different layers are encapsulated and depend on each other through abstraction and well-defined interfaces. Layers in this architecture pattern are stacked. The request direction is from the upper layers to the lower layers.…
In this series of posts, I will introduce you to the most popular software architecture types. But before we delve into the most common variants, let us talk about software architecture itself. What is software architecture? It is tough to write simply for such a complex topic as software architecture but let me try my best. A software system is made up of individual elements. Elements could be databases, application servers, message brokers, load balancers, etc. Each element has its properties and characteristics. Between these elements, there are relationships. The way we structure these elements and their relationships, we call…
Lazy loading is a very cool design pattern that is not often talked about. Many frameworks implement it without even telling us about it 😊. For example, .NET Entity Framework (all versions) support the pattern. But what is lazy loading? The idea behind the pattern is simple. By using lazy loading, we defer the initialization of objects (heavy ones) until we need them. That’s it. Let’s provide an example. We have a simple HR application. The application supports the tracking of employee records. Each record has standard fields like name, email, date of birth, and image (like a profile picture),…
In this article, I will try to explain simply what the SOLID principles are. Are they essential for building quality software, and should we follow them? By all means, principles in life are a good thing. They shape borders and do not let us make otherwise avoidable and stupid mistakes. By definition, principles are fundamental truth or proposition that servers as the foundation for a system of belief or behavior or a chain of reasoning. Yes, you can read it once again 😊. SOLID is an acronym. Each letter in SOLID stands for an object-oriented design principle. Initially, they were…