Configuration styles
Almost all IoC containers allow you to choose either code or file-based (XML) configuration for declaring dependencies. Although they serve the same purpose, you might feel confused as to which option is best for the given scenario.Â
For instance, file-based (mainly XML) configuration is appropriate for the applications that need deployment to multiple environments. On the other hand, there are specific scenarios where code-based configuration is chosen over file-based configuration. Identifying the difference between these two will help you choose which one is right for you.
File-based (XML) versus code-based configuration
The benefit of XML-based configuration is that you can alter dependencies without recompiling, building, and deploying the application code. This sounds useful in a situation where you need to swap the dependencies of the same type. But again, is this really what you are looking for? In other words, if you do not have the requirements for changing the...