After lots of year working with NHibernate I started to think that probably the whole concept of ORM can be considered an Antipattern. Some people prefer a “classic” approach to the problem, data is the key concept and most of the logic is inside a storage based on Relational Model. Is this wrong? Absolutely not, [...]

Continue reading about Square peg in a round Hole

One of the interesting ideas found in Radical and other implementations of DDD architectures, is implementing properties of Domain objects in a slightly different way from the standard, using something like a dictionary to store values of properties. When we want to implement a property for a Domain class you usually end up with similar [...]

Continue reading about Leverage the concept of “state” of your entities

Some days ago I blogged about an implementation of persistent cache component based on Managed Esent and PersistentDictionary. This component is injected into other components thanks to Inversion of Control and it is a Singleton object. Being a singleton is a requisite because it permits to different dependent objects to share the same cache, moreover [...]

Continue reading about Lifecycle of singleton objects

In a previous post I dealt on how to write an AutoMockingContainer that is able to resolve a mock for unregistered objects. The goal was to be able to circumvent the problem of service locator. Figure 1: During a test, the real container of the service locator is substituted with an AutoMocking container. This is [...]

Continue reading about Mock, Service Locator and Automocking Container to the rescue

I know, service locator is an antipattern, but sometimes, when you begin to refactor existing code written with no IoC in mind, service locator can help you a little bit in restructuring your code. A service locator pattern work this way: you have some static or gloablly avaliable class named: ServiceLocator or IoC, and every [...]

Continue reading about Mock, Service Locator, Automocking container and the hard life of testers