Hi, On 05.03.2010 15:08, Vidar Ramdal wrote: >>> On Fri, Mar 5, 2010 at 11:42 AM, Carsten Ziegeler <[email protected]> >>> wrote: >>>> ...We could make a general approach like (I couldn't make up could names >>>> for the interface and methods...) >>>> >>>> interface ResourceProcessor { >>>> >>>> Resource process(Resource); >>>> } >>>> >>>> so basically this works like kind of a filter which is able to >>>> substitute a resource with a completly different one - this could be >>>> used to change the resource type, the super resource type, metadata, >>>> different implementations of the adaptTo method etc. Everything is >>>> possible.... > >> On Fri, Mar 5, 2010 at 11:54 AM, Bertrand Delacretaz >>> I like the idea, we could call it ResourceFilter maybe? As you >>> indicate it's filtering the resource after it's loaded. >>> >>> It's a sharp knife though, could probably be abused in several ways - >>> but as all Sling components are replaceable anyway, it doesn't make >>> much of a difference. >>> >>> I'd say go for it, but watch out for which implementations we create ;-) > > On Fri, Mar 5, 2010 at 2:10 PM, Julian Sedding <[email protected]> wrote: >> I like the idea and implementing this in a generic fashion seems sensible to >> me. >> >> Regarding the naming, what about: >> >> interface ResourceDecoratorFilter { >> Resource decorate(Resource); >> } > > I really like this idea, I have been thinking about something similar: > A ResourceDecorator which would provide dynamic property values, like > a count of its child resources, or a sum of products in a shopping > basket.
I like the ResourceDecorator, too. > > The concept you guys come up with here looks really useful for this purpose. +1 Regards Felix >
