13 Aralık 2014 Cumartesi

Unit Of Work

The Unit of Work pattern is designed to maintain a list of business objects that have been changed by a business transaction, whether by adding, removing, or updating. The Unit of Work then coordinates the persistence of the changes and any concurrency problems flagged. The benefit of utilizing the Unit of Work in your DAL is to ensure data integrity; if an issue arises partway through persisting a series of business objects as part of a transaction, all changes should be rolled back to ensure that the data remains in a valid state.

8 Aralık 2014 Pazartesi

A quick start to Design Patterns with example

It’s all well and good to talk about how great patterns and principles are, but it’s important to see them in action. With this in mind, this section examines how a simple piece of ASP.NET code that you have probably seen countless times before can be improved with the use of patterns and design principles.

Design Patterns Groups

Twenty-three design patterns are featured in the GoF design patterns book, falling within one of three subgroups: Creational, Structural, or Behavioral. This section will take a quick look at each group and the patterns within. Throughout this book, you will examine the patterns that are useful for ASP.NET development.

7 Aralık 2014 Pazar

The S.O.L.I.D Design Princibles

The S.O.L.I.D. design principles are a collection of best practices for object-oriented design. All of the Gang of Four design patterns adhere to these principles in one form or another. The term S.O.L.I.D. comes from the initial letter of each of the five principles that were collected in the book Agile Principles, Patterns, and Practices in C# by Robert C. Martin, or Uncle Bob to his friends. The following sections look at each one in turn.

Design Princibles

Design principles form the foundations that design patterns are built upon. They are more fundamental than design patterns. When you follow proven design principles, your code base becomes infinitely more flexible and adaptable to change, as well as more maintainable. I will briefly introduce you to some of the more widely known design principles and a series of principles known as the S.O.L.I.D. principles.

How to choose and apply a Design Pattern

You can choose from many design patterns, so how do you identify which one is appropriate for your problem? To know which design pattern to use and how to apply the solution template to your specific problem, it’s important to understand these guidelines.