Posts

Showing posts with the label Design Pattern

Microservice Architecture - A brief overview

Image
During the early days of Software Development, barriers to entry in Programming languages were high and only people with PhD in Science and Mathematics could use those programming languages. In 1964, a general-purpose programming language BASIC was developed. It lowers the barrier so that non-PhD students from all departments can also write programs. As there was a rapid growth of computing applications in the 1960s, software became large and complex in 1972 which introduced the concepts of Modularity and Information hiding. Also, introduced the concept Separation of Concern, with the principal of decomposing a large, complex software system into “Loosely coupled, highly cohesive” modules which communicated via internal interfaces. In simple terms, “loosely coupled” means the dependency between modules should be very low and “highly cohesive” means that one module should focus on single or similar functionality. With the rise of the Internet and Web in the 1990s, software systems becam...

Circuit Breaker Pattern in Microservices

Image
 The circuit breaker pattern is a design pattern that falls under the sustainable design patterns category. It allows developers to prevent cascading failures in microservices architecture by invoking remote services through a proxy. Microservices architecture has become the new norm for large-scale applications. Because it has more advantages compared to traditional monolithic architecture. However, microservices also come with several challenges. One such challenge is preventing cascading failures. For example, network or service failure in one microservice can quickly cascade into other services and cause a system-wide failure. Why We Need Circuit Breaker Pattern? In a microservices architecture, services have to communicate with each other. Sometimes, there can be service failures, or it takes significant time to respond to requests due to network connectivity issues For example, assume that there are 2 microservices named catalog and orders . When the catalog service needs ...

SOLID Design Pattern Principles-C#

Here I would like to explain Solid Principles in C# Acronym for SOLID Principles are S-Single responsibility principle O-Open closed Principle L-Liskov substitution principle I-Interface segregation principle D-Dependency principle Single Responsibility principle This principal indicates that a entity or a class should have one and only one responsibility Ex: Customer class should contain information about real life customer. Add the properties and methods related to customer like Properties: customername,CustomerID..etc  Methods : InsertCustomer,UpdateCustomer,DeleteCustomer,Validate public class Customer { public string customerName { get; set; } public string customerID { get; set; } public void Insert() { //insert logic } public void Update() { //insert logic } public void Delete() { //Delete logic } public void Validate() { ...