I share Dan's opinion that it makes sense to offer the functionality
via a utility of some sort (be it adaptTo or static methods or even
constructors ;)).

In the past that was also how the Sling API evolved. E.g. first there
was resource.adaptTo(ValueMap.class), then came
ResourceUtil.getValueMap(resource), which returns a modifiable empty
ValueMap even if resource == null. And finally, a lot later,
resource.getValueMap() was added, because ValueMaps are used a lot
when dealing with resources.

Regards
Julian


On Thu, Jun 7, 2018 at 4:08 PM, Daniel Klco <daniel.k...@gmail.com> wrote:
> On Thu, Jun 7, 2018 at 9:05 AM, Bertrand Delacretaz <bdelacre...@apache.org>
> wrote:
>
>> On Thu, Jun 7, 2018 at 3:00 PM, Jason E Bailey <j...@apache.org> wrote:
>> > ...I really don't think creating a dedicated bundle that consists of a
>> single class
>> > is really appropriate....
>>
>> That's not necessarily a problem, especially if it's meant to avoid
>> touching our api bundle, which we're always quite reluctant to touch
>> unless really needed.
>>
>
> I'm of the opinion that it could make sense to update the API to support
> streams, but I think first, we should have a stand-alone option. A) this
> will help evaluate the best approach for the eventual inclusion into the
> Sling API. B) This will also allow developers using older versions of the
> Sling API and underling implementations use Lamdba expressions immediately
> instead of having to update their stack to support the newest API (which
> often will not be possible for people running proprietary software such as
> AEM).
>
>
>>
>> And I suppose your code will have more than that class, in total, so
>> maybe you can (at least initially) put that utility class in your main
>> bundle if you have one? If you do this you can quietly work on that in
>> isolation, and once you have enough to demonstrate the whole thing we
>> can discuss how to best organize it.
>>
>
> I'd think you'd need at least the ResourceStream, an adapter factory and
> ideally the Predicates from your original project. Ideally, IMO this should
> be a "quick start" to using Streams with Sling.
>
>
>>
>> > ...I've come to realize that I'm doing an extremely poor job at
>> explaining
>> > the vision behind this and/or communicating the overall benefits...
>>
>> We're all busy, so maybe we're not paying enough attention...don't despair
>> ;-)
>>
>
> I for one am super excited for this. :-) Once the standalone bundle is
> ready, it'd be great to provide a few examples of pre and post code using
> the Resource Stream API.
>
>
>>
>> -Bertrand
>>

Reply via email to