Hi all. I've been a lurker on the list for a while and have been reading
and studying the spec like a mad man. If I go off the rails here feel free
to let me know. :)
The only thing I can think of as a possible issue with this is Web Bean
specialization? Static methods cannot be overridden and only hidden by
sub-classes and the declared type (any actual instance is ignored) is used
to resolve which static method is called. If you had a static
Foo#producerMethod and a specialization of a static MockFoo#producerMethod
Web Beans would have to know to call MockFoo.producerMethod and couldn't
rely on Foo.producerMethod to resolve polymorphically to the specialized
producer method.
I don't think it would be a problem that couldn't be overcome but it would
seem to complicate the specialization rules quite a bit.
On Fri, Nov 14, 2008 at 11:50 AM, Gavin King <gavin(a)hibernate.org> wrote:
---------- Forwarded message ----------
From: Gavin King <gavin(a)hibernate.org>
Date: Fri, Nov 14, 2008 at 12:50 PM
Subject: static producers
To: Java Community Process JSR #299 Expert List <JSR-299-EG(a)jcp.org>
Question:
should we allow producer methods and fields to be declared "static"?
This would mean that the Web Bean manager does not need to instantiate
an instance of the Web Bean that declares the producer method/field
when invoking the method/field.
I can't think of a good reason why *not*...
Furthermore, should we allow static observer and disposal methods?
Again, I can't quite think of a reason why *not*...
--
Gavin King
gavin.king(a)gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org
--
Gavin King
gavin.king(a)gmail.com
http://in.relation.to/Bloggers/Gavin
http://hibernate.org
http://seamframework.org
_______________________________________________
webbeans-dev mailing list
webbeans-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/webbeans-dev