Software design patterns represent strategies for applying software design principles. In other words, a software design principle is a good idea and a software design pattern is the tool that you use to implement the good idea. (It’s the hammer.)

The idea behind software design patterns was originally promoted by the book Design
Patterns: Elements of Reusable Object-Oriented Software. (This book is known as the Gang of Four book.) This book has inspired many other books that describe software design patterns.

The Head First Design Pattern book provides a more user-friendly introduction to the design patterns from the Gang of Four book. The Head First Design book devotes chapters to 14 patterns with names like Observer, Fa├žade, Singleton, and Adaptor.

Another influential book on software design patterns is Martin Fowler’s book Patterns of Enterprise Application Architecture. This book has a companion website that lists the patterns from the book: www.martinfowler.com/eaaCatalog.

Software design patterns provide you with patterns for making your code more resilient to change. For example, in many places in this book, we take advantage of a software design pattern named the Repository pattern. Eric Evans, in his book Domain-Driven Design, describes the Repository pattern like this:

“A REPOSITORY represents all objects of a certain type as a conceptual set (usually emulated). It acts like a collection, except with more elaborate querying capability. Objects of the appropriate type are added and removed, and the machinery behind the REPOSITORY inserts them or deletes them from the database”.

According to Evans, one of the major benefits of the Repository pattern is that it enables you to “decouple application and domain design from persistence technology, multiple database strategies, or even multiple data sources.” In other words, the Repository pattern enables you to shield your application from changes in how you perform database access.

For example, we take advantage of the Repository pattern to isolate our blog application from a particular persistence technology. The blog application will be designed in such a way that we could switch between different data access technologies such as LINQ to SQL, the Entity Framework, or even NHibernate.

Source of Information : Sams ASP .NET MVC Framework Unleashed

0 comments


Subscribe to Developer Techno ?
Enter your email address:

Delivered by FeedBurner