Closed eclipse-faces-bot closed 14 years ago
@glassfishrobot Commented Reported by @edburns
@glassfishrobot Commented @edburns said: up to p1 feature.
@glassfishrobot Commented @edburns said: I have asked Ryan Lubke of the Sun team to produce a proposal for this, based on Adam's content in this message.
@glassfishrobot Commented @edburns said: Created an attachment (id=2) source for proposal
@glassfishrobot Commented @edburns said: From Ryan Lubke:
AW> The faces-config.xml support for the decorator pattern is AW> one of my favorite features in JSF, and I like pushing AW> it at users whenever I get a chance. But it is a pain AW> using it, especially on objects with large APIs (like ViewHandler).
AW> I'd recommend we follow the lead of the Servlet API and AW> provide convenience classes for implementing the Decorator AW> pattern. (They were a bit more than convenience classes AW> for the Servlet API, but anyway...)
AW> This would make implementing the Decorator pattern much, AW> much simpler. It also makes it much more robust - as things AW> stand now, every time we add a method to any of these AW> decoratable APIs in a new version of JSF, all existing AW> Decorators will break!
Create wrapper classes for the following:
ViewHandlerWrapper
StateManagerWrapper
ResponseWriterWrapper
PropertyResolverWrapper
VariableResolverWrapper (this one was added more for balance)
These classes have a single constructor which takes an instance of the class they are designed to wrap.
The default behavior for the methods of each implementation call through to the wrapped instance
@glassfishrobot Commented @edburns said: take ownership
@glassfishrobot Commented @edburns said: I've resolved ViewHandler, StateManager, and ResponseWriter and left the EL bits until we have the EL alignment done.
@glassfishrobot Commented @edburns said: Prepare to delete "spec" subcomponent.
@glassfishrobot Commented @edburns said: Move all to 1.2
@glassfishrobot Commented @manfredriem said: Closing resolved issue out
@glassfishrobot Commented File: wrapper-src.zip Attached By: @edburns
@glassfishrobot Commented This issue was imported from java.net JIRA JAVASERVERFACES_SPEC_PUBLIC-15
@glassfishrobot Commented Marked as won't fix on Thursday, March 4th 2010, 6:09:29 am
AW> The faces-config.xml support for the decorator pattern is AW> one of my favorite features in JSF, and I like pushing AW> it at users whenever I get a chance. But it is a pain AW> using it, especially on objects with large APIs (like ViewHandler).
AW> I'd recommend we follow the lead of the Servlet API and AW> provide convenience classes for implementing the Decorator AW> pattern. (They were a bit more than convenience classes AW> for the Servlet API, but anyway...)
AW> This would make implementing the Decorator pattern much, AW> much simpler. It also makes it much more robust - as things AW> stand now, every time we add a method to any of these AW> decoratable APIs in a new version of JSF, all existing AW> Decorators will break!
AW> This would involve, as an extreme, adding the following ten AW> classes to JSF: AW> ApplicationFactoryWrapper AW> NavigationHandlerWrapper AW> ViewHandlerWrapper AW> StateManagerWrapper AW> FacesContextFactoryWrapper AW> ResponseWriterWrapper AW> PropertyResolverWrapper AW> VariableResolverWrapper AW> LifecycleFactoryWrapper AW> RenderKitFactoryWrapper
AW> But of that long list, only four are especially useful: AW> ViewHandlerWrapper AW> StateManagerWrapper AW> ResponseWriterWrapper AW> PropertyResolverWrapper
AW> The rest are either rather esoteric, or are wrappers for AW> single method APIs (where using a canned wrapper would AW> be even harder than writing the wrapper from scratch).
AW> BTW, I'm aware this nothing built-in about decorator support AW> for ResponseWriters. But we've found over the last few AW> years of using an analogous concept that decorating ResponseWriters AW> is very, very useful for things like:
AW> - Optimizing page content AW> - Catching common HTML errors AW> - Adding whitespace (the current RI pushes this task to each AW> renderer) AW> - Sliding in design-time hooks AW> - Adding comments to the page output (e.g., this content AW> was built by a UICommand with id='foo')
AW> ... all of which don't require bloating the base response writer AW> or adding any performance or output size overhead for users not AW> using the decorator. And we don't really need anything special AW> to support decorating ResponseWriters - that can be done in the AW> JSP page with some easy tags sliding inside of.
AW> This would be a very nice improvement in JSF 1.1, and I AW> don't think it's a huge amount of work, but I could AW> understand punting it to JSF 1.2.
Environment
Operating System: All Platform: Sun
Affected Versions
[1.2]