Posts

Showing posts from February, 2024

C# | Design Patterns

Image
Design patterns provide general solutions or a flexible way to solve common design problems. This article introduces design patterns and how design patterns are implemented in C# and .NET. Before starting with design patterns in .NET, let's understand the meaning of design patterns and why they are useful in software architecture and programming. What are Design Patterns in Software Development? Design Patterns in the object-oriented world are a reusable solution to common software design problems that repeatedly occur in real-world application development. It is a template or description of how to solve problems that can be used in many situations. " A pattern is a recurring solution to a problem in a context. " " Each pattern describes a problem that occurs over and over again in our environment and then describes the core of the solution to that problem in such a way that you can use this solution a million times over without ever doing it the same way twice. ...

C# | SOLID Principles

Image
  SOLID stands for: S = Single Responsibility Principle O = Open/Closed Principle L = Liskov Substitution Principle I = Interface Segregation Principle D = Dependency Inversion Principle Solid Principles Single Responsibility Principle Each software module should have one and only one reason to change. The Single Responsibility Principle is the first principle of SOLID principles. It is the fundamental principle of object-oriented programming that determines how we should design classes. The Single Responsibility Principle states that: Each software module should have one and only one reason to change. In other words, a class should have only one responsibility and therefore it should have only one reason to change its code. If a class has more than one responsibility, then there will be more than one reason to change the class (code). Now, the question is what is responsibility? An application can have many functionalities (features). For example, an online e-commerce application ...