Architecture and patterns

http://dotnetcodr.com/architecture-and-patterns/

Architecture and patterns

Read more of this post

SOLID design principles in .NET: the Open-Closed Principle

http://dotnetcodr.com/2013/08/15/solid-design-principles-in-net-the-open-closed-principle/

Introduction

Now it’s time to move to the letter ‘O’ which stands for the Open-Closed Principle (OCP). OCP states that classes should be open for extension and closed for modification. You should be able to add new features and extend a class without changing its internal behaviour. You can always add new behaviour to a class in the future. At the same time you should not have to recompile your application just to make room for new things. The main goal of the principle is to avoid breaking changes in an existing class as it can introduce bugs and errors in other parts of your application.

How is this even possible? The key to success is identifying the areas in your domain that are likely to change and programming to abstractions. Separate out behaviour into abstractions: interfaces and abstract classes. There’s then no limit to the variety of implementations that the dependent class can accept.

Read more of this post

Simplifying the Liskov Substitution Principle of SOLID in C#

http://www.infragistics.com/community/blogs/dhananjay_kumar/archive/2015/06/30/simplifying-the-liskov-substitution-principle-of-solid-in-c.aspx

The Liskov Substitution Principle says that the object of a derived class should be able to replace an object of the base class without bringing any errors in the system or modifying the behavior of the base class.

In short: if S is subset of T, an object of T could be replaced by object of S without impacting the program and bringing any error in the system. Let’s say you have a class Rectangle and another class Square. Square is as Rectangle, or in other words, it inherits the Rectangle class. So as the Liskov Substitution principle states, we should able to replace object of Rectangle by the object of Square without bringing any undesirable change or error in the system.

Read more of this post

Implementing the Repository and Unit of Work Patterns in an ASP.NET MVC Application

http://www.asp.net/mvc/tutorials/getting-started-with-ef-5-using-mvc-4/implementing-the-repository-and-unit-of-work-patterns-in-an-asp-net-mvc-application

An arguable discussion

Repositories On Top UnitOfWork Are Not a Good Idea

http://www.wekeroad.com/2014/03/04/repositories-and-unitofwork-are-not-a-good-idea/

Repository_pattern_diagram