The Unit of Work pattern is a really useful pattern that I really haven’t given a lot of thought to for some reason. Generally it just seems to need very little attention. I guess frameworks around us shield us from it… But I guess it the more you learn, the more you think of, and the more time you spend working on things that you previously never invested much thought in.
Anyhow, recently, working with Entity Framework (yes…it is another EF post…) I realized that this pattern is really key to a lot of things, and it isn’t always that easy to implement. So I decided to Google it and borrow heavily from some smarter person than me who had already built a nice solution for it. Unfortunately, all the information I found regarding UoW and EF was overly simplified, and generally based around abstracting away EF in a single repository.
More...
Ok, so first of all, it has been a VERY long and VERY quite period on my blog. I guess that is just the way it is, sometimes life just takes up too much time to be able to blog to the extent I want to. On the other hand, I have been very busy with some cool projects, including some cool technologies, so it is all good I guess.
Now back from the dead I hope that my blogging will pick up, and this is the first in a series of blog posts about things I have figured out during my silent months. I know that Entity Framework is far from what I normally blog about, but it is still something I use, and something I spent some times getting my head around. Understanding EF as such isn’t that hard, the hard part was getting it to work in a fashion that suited me, and one of the things I don’t like is just adding a gazillion repositories on top of EF and be done with it. And I don’t like stepping 15 levels into my objects, lazy loading things as I go along. And I want things to be as DRY as possible. So I prefer having more “emancipated” objects. I want my objects to have freedom to do what they need to do. This makes the programming so much simpler and easier to follow… But it also requires some features like DI… And on top of that, being a bit paranoid, I prefer abstracting away my ORM as much as possible…
So this post is about how I have decided to use EF in my current projects, and I would love any feedback you got…
More...