DCSIMG
Design Patterns - Gil Fink's Blog

Gil Fink's Blog

Fink about IT

News

Microsoft MVP

My Facebook Profile My Twitter Profile My Linkedin Profile

Locations of visitors to this page

Creative Commons License

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.
© Copyright 2013 Gil Fink

Hebrew Articles

Index Pages

My OSS Projects

English Articles

Browse by Tags

All Tags » Design Patterns (RSS)
Repository and Unit of Work T4 Template for Entity Framework
Repository and Unit of Work T4 Template for Entity Framework Two weeks ago I wrote the Revisiting the Repository and Unit of Work Patterns with Entity Framework post. One thing that I thought would be nice was to have an automatic code generation that will help me to build these patterns without sweating. So I sat down and created a T4 Template to auto generate the same patterns that I showed in the post. The Code One thing to understand is that the provided T4 Template isn’t bullet proof and errors...
Eager Loading with Repository Pattern and Entity Framework
Eager Loading with Repository Pattern and Entity Framework One question that I received yesterday after I published the Revisiting the Repository and Unit of Work Patterns with Entity Framework post was how to include the eager loading ability of Entity Framework . This post is offering a solution. Revisiting Eager Loading and Lazy Loading Lazy loading is a design pattern that is commonly used to defer initialization of an object up until it is needed by the program. The gains of using the pattern...
Revisiting the Repository and Unit of Work Patterns with Entity Framework
Revisiting the Repository and Unit of Work Patterns with Entity Framework In the past I wrote two posts about the Repository and the Unit of Work patterns ( here and here ). Today I want to show a better and less naive solution for imposing the Unit of Work and the Repository patterns with Entity Framework . Revisiting The Repositoy Implementation In the Repository pattern, I added to the interface two new methods for adding and removing an entity: public interface IRepository<T> where T :...
Cache Retrieval Pattern
Cache Retrieval Pattern In my previous post I wrote about cache layer and its position in every application. In this post I’m going to explain what is the cache retrieval pattern and show an example of how to implement it. Cache Retrieval Pattern When we implement a cache layer we need a strategy in order to retrieve cached items. The cache retrieval pattern is very simple and can be imposed into any application very fast. So how does it work? The business logic component will use the cache API in...
Cache Layer
Cache Layer Lately I found myself in some architecture consulting sessions at some customers. In every one of those customers I found myself explaining how to implement a cache layer in order to decrease the amount of round trips to the database and for better scalability. In this post I’ll try to explain in high level how to build a cache layer . Deciding to Build a Cache Layer Every application that performance is important to its developers and managers must contain some sort of caching . The...
Using Unit of Work Pattern with Entity Framework
Using Unit of Work Pattern with Entity Framework In a previous post I explained how to create a simple repository on top of Entity Framework . In this post I’ll explain the Unit of Work pattern and how we can use it with our data access layer. What is Unit of Work Pattern? In his famous and developer must read book “ Patterns of Enterprise Application Architecture ”, Martin Fowler defines the Unit of Work as “Maintains a list of objects affected by a business transaction and coordinates the writing...
Using Repository Pattern with Entity Framework
Using Repository Pattern with Entity Framework One of the tools for reaching for persistence ignorance is to build a facade between the data access layer and your business logic. Such facade will prevent the knowledge of how the data access is working and with which technology. That abstraction can be achieved by using the Repository Pattern . In the post I’ll show how you can use the Repository Pattern in order to make an abstraction layer on top of Entity Framework . The Repository Interface When...
Applying Strategy Pattern Instead of Using Switch Statements
Applying Strategy Pattern Instead of Using Switch Statements Once in a while I’m stumbling on switch statements during a Code Review session. Whenever this is happening my first reaction is to understand why did the developer use it. Since using switch statement sometime implies spaghetti code and also can get very crowded (in case statements of course) in this post I’m going to show an alternative method that I prefer to use. Alternative Method for Switch Statements Whenever you start to use a switch...
Do We Need Design Patterns?
Do We Need Design Patterns? In the previous week I have been asked “do we really need design patterns when we write code?”. Since one of the first things that I wrote in my blog was a design patterns series you probably would think that I answered SURE! or other absolute answer. That isn’t the case. The question was raised since I saw that a developer tried to enforce a design pattern (abstract factory) that wasn’t needed in some place in the code. What I really believe in is that design patterns...
My Next Month Courses Schedule
My Next Month Courses Schedule Next month I’m scheduled for the following courses: ADO.NET Entity Framework   Scheduled for 16.6 Advanced ASP.NET 3.5 Scheduled for 14.6 Design Patterns Scheduled for 11.6 If you want to participate in one of those courses or more details, you can contact E4D in the following ways: Contact Form in the this link Call Michal - 054-5612259 Call Oranit - 03-6325707 See you there.
The Benefits of Building a Layered Application
The Benefits of Building a Layered Application During the last two weeks I’m consulting at a customer that built a very simple application very badly. One of the problems that I found was the lack of layers separation which made the application very tangled. One example for that is the calling of stored procedures from UI user controls. I talked to the managers about that issue and explained the benefits of building a layered application . This post will explore those benefits. Layered Application...
E4D Learning
E4D Learning In the last two weeks I ’m working in E4D Solutions as a senior consultant and as a .NET instructor. As part of my position I’m instructing the following courses: Enterprise Development – ADO.NET Entity Framework Enterprise Library 4.1 General – ADO.NET Data Services Design Patterns ASP.NET – ASP.NET MVC Framework ASP.NET Dynamic Data If you are interested in one of those courses you can contact E4D in the following link . I’ll be happy to see you in the next course.
Farewell Design Patterns Series
Farewell Design Patterns Series Today I finished my series in the subject of design patterns . It was an intensive and satisfying writing and I hope that you will find the series helpful and use it. You can read all the series in the following links: Structural patterns Decorator pattern Proxy pattern Facade pattern Adapter pattern Composite pattern Bridge pattern Flyweight pattern Creational patterns Singleton pattern Abstract Factory pattern Prototype pattern Factory Method pattern Builder pattern...
Interpreter Pattern
This is the last post in the series of design patterns. The post describe the interpreter design pattern and shows an example in C#....
Observer Pattern
The post describe one of the most commonly used design pattern - the observer pattern. ...
More Posts Next page »