chkal / mvc-spec-migration-test

0 stars 0 forks source link

MVC Controller classes are CDI beans #7

Closed chkal closed 9 years ago

chkal commented 9 years ago

Original issue MVC_SPEC-9 created by Santiago Pericas-Geertsen:

Unlike JAX-RS in which resource classes can be native, managed beans, EJBs or CDI beans, MVC should consider restricting controllers to be CDI beans only.

chkal commented 9 years ago

Comment by Manfred Riem:

Closing the loop on MVC_SPEC-9 with the following:

As CDI is an integral part of the JavaEE platform and as such is available for any specification, for our specification this means that our MVC controller classes will be CDI managed beans.

This will deliver us at minimum the following:

  1. Bean lifecycle management
  2. Bean scopes
  3. Dependency injection
  4. EL resolving

See https://java.net/projects/mvc-spec/lists/users/archive/2015-01/message/26 and also MVC_SPEC-1

chkal commented 9 years ago

Comment by Jozef Hartinger:

Is the resolution "CDI beans" or "CDI managed beans"? The discussion seems to cover the former while the resolution concludes the latter.

The difference is that CDI managed beans (http://docs.jboss.org/cdi/spec/1.2/cdi-spec.html#implementation) are just one type of CDI beans (others are session beans, producers, extension-provided beans).

chkal commented 9 years ago

Comment by Manfred Riem:

It is CDI beans. I used "managed" to indicate that the MVC runtime is not managing them, but CDI is. Unfortunately it seems your specification also has a meaning using that word ;)