I believe that most IoC containers allow you to wire dependencies with XML configuration file. What are cons and pros for using configuration file vs. registering dependencies in code?
I believe that most IoC containers allow you to wire dependencies with XML configuration
Share
These pros and cons are based on my work with spring. It may be slightly different for other containers.
XML
pro
con
Annotations
pro
con
Code
pro
con
I am using a mix of XML+Annotation. Some things especially regarding database access are always configured via xml, while things like the controllers or services are mostly configured via annotations in the code.
[EDIT: I have borrowed Mauschs code PROs]