CDI developer all
Hi, I'm Hiromi Takahashi.
I work for Mitsubishi UFJ Information Technology.
Our company is in charge of Mitsubishi UFJ financial group system development, operation
and maintenance.
And then , I'm in charge of in-house Java framework.
Our Java framework depends heavily on Java SE and Java EE technologies.
I reviewed JSR365 (CDI2.0) Public Review .
I think it's great.
On the other hand, to make things even better, I would like to suggest the following:
・About CDI's goal in Java SE
What I think is great about CDI is its ability to inject to Java object
"transparently".
However, with the current spec of CDI, it requires some coding each time to get the
injected objects.
For example, in getNewInstance() method, I think it would be great if CDI could judge if
there was an injected field or not
(ie. if there is an injected field then CDI injects, and if not CDI just makes a new
instance.)
How we code would be even simpler and more beautiful.
This way, users can always generate instances in such standard method.
Also, it could be even better if CDI could act like below when using "new"
descriptor:
- If the class has injected field, then get the injected instances
- If the class has no injected field, then just simply get a new instance
In Java EE, these functions are the container's role and CDI may not have to be in
charge of them.
However, considering CDI may be used in Java SE, I think CDI needs to act like above in
the future.
Best regards.
##############################################################
Mitsubishi UFJ Information Technology,Ltd.
Management Information Systems Platforms Department.
Hiromi Takahashi
tel:+81-3-5859-1525
mail:hiromi_18_takahashi(a)mufg.jp
##############################################################