[jsr-314-open] getting behind CDI

Dan Allen dan.j.allen at gmail.com
Tue Dec 22 14:06:52 EST 2009


On Mon, Dec 21, 2009 at 3:24 AM, Ganesh <ganesh at j4fry.org> wrote:

> The most essential and basic feature I miss is the conversation scope which
> is covered by weldx. Spring is only making a promise for 3.1 here.
>

Actually, the conversation context is defined in the CDI specification,
making it a standard scope that's available with any CDI implementation.
It's not specific to Weld. However, Weld does add some features missing from
the standard conversation (admittedly, some pretty important features).


>
> Conversation delimiters are set programmatically in weldx which I consider
> not
> ideal. I'd wish having annotation/XML based navigation rules that cover
> conversations and contained beans. Maybe we can cover this feature in the
> future?
>

I recognize that it was a bit of a let down that JSF 2 didn't define a
conversation scope. But in the long run it was right to wait. The problem is
that Java EE has never had a way to define new scopes. You could layer a
framework over Java EE that did scoping, but the scope itself would never be
standard. We didn't want JSF taking on the responsibility, especially since
this feature was coming in CDI. But, the timing of the JSF 2 release made it
impossible to have conversation scope defined at the time.

Now, there is a way in the platform to define new scopes. CDI went ahead and
introduced the conversation scope, but stated explicitly that it is designed
for use with JSF. In the future, I forsee scopes being defined by the specs
in which they are used. So the conversation scope could be defined in the
JSF specification, or, at the very least, there should be controls defined
that manipulate the conversation scope. This integration would be along the
lines of the JSF - Bean Validation integration. The JSF spec could define
component tags / view metadata tags that control the boundaries of the
conversation, just like in Seam (and other such frameworks).

In summary, this is a developing story. Things will improve and mature. We
needed the scoping mechanism in CDI in order to define new scopes in the
platform (which frameworks like Spring are free to emulate). Then we can go
back and add controls in JSF to manipulate these scopes. And, tying into
what Jeremy and I were discussing, it's really important that we standardize
the scope annotations so that we can ensure maximum portability of beans
(even between the platform and frameworks like Spring that utilize these
declarations).

-Dan

p.s. Currently, you can control the CDI conversation using the standard Java
API or via an EL expression (if you name the built-in conversation bean).

-- 
Dan Allen
Senior Software Engineer, Red Hat | Author of Seam in Action
Registered Linux User #231597

http://mojavelinux.com
http://mojavelinux.com/seaminaction
http://www.google.com/profiles/dan.j.allen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jsr-314-open-mirror/attachments/20091222/e794338a/attachment.html 


More information about the jsr-314-open-mirror mailing list