concept convention in category .net

appears as: conventions, convention, convention
Dependency Injection in .NET

This is an excerpt from Manning's book Dependency Injection in .NET.

An increasingly popular architectural model is the concept of Convention over Configuration. Instead of writing and maintaining a lot of configuration code, you can agree on conventions that affect the code base.

Figure 13.3. Conceptually different configuration options. CODE AS CONFIGURATION is strongly typed and tends to be explicit. XML, on the other hand, is late bound, but still explicit. AUTO-REGISTRATION instead relies on conventions that can be both strongly typed and more loosely defined.

Notice that we use the normal Resolve method, but that we request IEnumerable <IIngredient>. Autofac interprets this as a convention and gives us all the IIngredient components it has.