Is there a pattern for initializing objects created via a DI container

Any place where you need a run-time value to construct a particular dependency, Abstract Factory is the solution. Having Initialize methods on the interfaces smells of a Leaky Abstraction. In your case I would say that you should model the IMyIntf interface on how you need to use it – not how you intent to … Read more

Ioc/DI – Why do I have to reference all layers/assemblies in application’s entry point?

If I wasn’t using a DI container, I wouldn’t have to reference EntityFramework library in my MVC3 app, only my business layer which would reference my DAL/Repo layer. Yes, that’s exactly the situation DI works so hard to avoid 🙂 With tightly coupled code, each library may only have a few references, but these again … Read more

What is a JavaBean exactly?

A JavaBean is just a standard All properties are private (use getters/setters) A public no-argument constructor Implements Serializable. That’s it. It’s just a convention. Lots of libraries depend on it though. With respect to Serializable, from the API documentation: Serializability of a class is enabled by the class implementing the java.io.Serializable interface. Classes that do … Read more