Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a .NET IoC that prefers convention over configuration?

Simply put, if you had to use a IoC/DI container, thats easy to deploy (not a big fan of using config/xml file for everything), stable, good documentation and supports .net, which one would it be?

It could just be me but too many xml files like one for the app, a few for ORM, a few for another component kinda gets overwhelming at times. Also, the way I see it, if there is one way of doing things (convention) lesser the chances of messing things up.

Looking forward at your suggestions and if possible experiences. My main concern is maintainability and ease of deployment.

like image 407
Perpetualcoder Avatar asked Jan 15 '09 20:01

Perpetualcoder


People also ask

Why convention over configuration?

Convention over configuration is a software development approach geared toward developing programs according to typical programming conventions, versus programmer defined configurations. It enables quick and simple software creation while maintaining base software requirements.

What is convention over configuration principle?

Convention over configuration (also known as coding by convention) is a software design paradigm used by software frameworks that attempts to decrease the number of decisions that a developer using the framework is required to make without necessarily losing flexibility and don't repeat yourself (DRY) principles.

What is CoC in Rails?

Convention over configuration is one of the pillars of Ruby on Rails. It brings "default structures for web pages, databases, and web services". Inspired by this, Sensio Framework is launched as a PHP MVC framework that adopts CoC . This is later renamed to Symfony.

What is convention over configuration in Maven?

Maven uses Convention over Configuration, which means developers are not required to create build process themselves. Developers do not have to mention each and every configuration detail. Maven provides sensible default behavior for projects. When a Maven project is created, Maven creates default project structure.


2 Answers

I think you'll will find this feature in most of the containers out there. Take a look at this blog post. It's slightly aged but it will give you an idea. By now the active containers probably have better support.

like image 53
Cristian Libardo Avatar answered Oct 21 '22 15:10

Cristian Libardo


I use Ninject and StructureMap -- both allow you to wire up your configuration without XML.

Not to be shamelessly promoting my site but I wrote a tutorial on using Ninject available here.

like image 38
Ryan Lanciaux Avatar answered Oct 21 '22 14:10

Ryan Lanciaux