Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>These pros and cons are based on my work with spring. It may be slightly different for other containers.</p> <p>XML</p> <p>pro</p> <ul> <li>flexible</li> <li>more powerful than annotations in some areas</li> <li>very explicit modelling of the dependencies of your classes</li> </ul> <p>con</p> <ul> <li>verbose</li> <li>difficulties with refactoring</li> <li>switching between several files</li> </ul> <p>Annotations</p> <p>pro</p> <ul> <li>less file switching</li> <li>auto configuration for simple wirings</li> <li>less verbose than xml</li> </ul> <p>con</p> <ul> <li>more deployment specific data in your code (usually you can override this with xml configs)</li> <li>xml is almopst(?) always needed, at least to set up the annonation based config</li> <li>annotation magic may lead to confusion when searching for the class that is used as dependency</li> </ul> <p>Code </p> <p>pro</p> <ul> <li>Can take advantage of strongly-typed languages (e.g. C#, Java)</li> <li>Some compile-time checking (can't statically check dependencies, though)</li> <li>Can take advantage of DSLs (e.g. Binsor, Fluent interfaces)</li> <li>Less verbose than XML (e.g. you don't need to always specify the whole assembly qualified name (when talking .net))</li> </ul> <p>con</p> <ul> <li>wiring via code may lead to complex wirings </li> <li>hard dependencies to IOC container in the codebase</li> </ul> <p>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.</p> <p>[EDIT: I have borrowed Mauschs code PROs]</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload