jsr344-experts@javaserverfaces-spec-public.java.net

[jsr344-experts] [jsr-344-experts] FaceletFactory.createComponent(...) ?

From: Leonardo Uribe <lu4242_at_gmail.com>
Date: Tue, 12 Jun 2012 15:51:58 +0200

Hi

Checking some JSF 2.2 javadoc, I notice this method:

UIComponent FaceletFactory.createComponent(String taglibURI, String
tagName, Map<String,Object> attributes)

There is no javadoc, only a reference to this issue:

http://java.net/jira/browse/JAVASERVERFACES_SPEC_PUBLIC-599
Application.createComponent(): compcomp via namespace+compname

The issue is closed as fixed, but there is not any description at all.
This raises some questions?

1. Is that the right place to put that method? The description of
FaceletFactory says this:

".... FaceletFactory for producing Facelets relative to the context of
the underlying implementation. ..."

It does not have sense to me. If I want a way to create a component
using the namespace/compname or something like that, Isn't that
responsibility more related to the ViewDeclarationLanguage?

2. Why expose FaceletFactory? In my opinion, FaceletFactory is a
detail of facelets VDL implementation, right? The "power" to create
facelets is from facelets VDL. If that so, why don't include an
abstract class called

public abstract class
javax.faces.view.facelets.FaceletsViewDeclarationLanguage extends
javax.faces.view.ViewDeclarationLanguage

and add the methods that are now in FaceletFactory there? Maybe
createComponent(String taglibURI, String tagName, Map<String,Object>
attributes) qualify to be included directly in
ViewDeclarationLanguage.

3. JAVASERVERFACES_SPEC_PUBLIC-599 description says something like this:

>> I feel there is value in the ability to instantiate an EzComp object
>> in Java so that a component tree can be built in a backing bean (or
>> other Class). JSF must be doing this in the background through
>> Facelets, so providing this ability in Java should not be too difficult.

the problem here is it does not specify where and when the component
is created: inside a component "binding" property? in a
@PostConstruct? in an actionListener?. For each one there are
different considerations. Also, it is necessary to check that the
generated ids does not clash with other existing ones in the component
tree. I can see this is only the tip of the iceberg.

4. Is this topic really closed? Some months ago I sent a message with
this topic:

[jsr344-experts] JAVASERVERFACES_SPEC_PUBLIC-611 FIXED expose
FaceletFactory and Facelet classes

No response so far.

Suggestions are welcome.

regards,

Leonardo Uribe