Category: Asp .Net

Showing all posts with category Asp .Net

2025-04-17 06:22:28

SOLID Principles in c#

The five SOLID principles are as follows: 

  • S: Single Responsibility Principle (SRP) 
  • O: Open-Closed Principle (OCP) 
  • L: Liskov Substitution Principle (LSP) 
  • I: Interface Segregation Principle (ISP) 
  • D: Dependency Inversion Principle (DIP) 

2025-04-17 06:56:07

Single Responsibility Principle - SOLID Principles in c#

Single Responsibility Principle states that classes should change for one reason. Thus, a class should have one duty. Multiple responsibilities make a class difficult to manage and test. Splitting the class into smaller, responsible classes is best. However, interface or abstract class is usually called single responsibility principle.

2025-04-17 11:22:01

Open/Closed Principle - SOLID Principles in c#

A class should be open for extension but closed for modification,  when new requirements are generated under the Open/Closed Principle. In other words, we should be able to extend class behaviour without changing it. This is possible with inheritance and interfaces.

2025-04-22 12:29:24

Design Patterns in Asp.Net

Design patterns are reusable solutions to common problems in software design. Their help makes code clean, maintainable, and scalable. Design patterns fall into three categories:

  • Creational Patterns
  • Structural Patterns
  • Behavioral Patterns

2025-04-22 12:46:24

Factory Pattern - Design Pattern

Problem: Creating objects directly can lead to tight coupling between client code and concrete classes, making it hard to adapt to changes or extend the system with new classes. 

Solution: The Factory Pattern solves this by providing an interface to create objects without exposing their concrete implementations

How: The Factory Pattern defines a factory class or method responsible for creating objects. Clients request objects from the factory using a common interface, allowing them to work with abstract types while leaving the concrete object creation to the factory.