You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@juneau.apache.org by James Bognar <ja...@apache.org> on 2017/05/30 22:28:22 UTC

Fixes for Streams

FYI...

Here are the changes I'll be making to fix the remaining issues with
Streams...

1) Fix race condition in ClassMeta.
2) Fix QueryIfNE behavior on empty collections and arrays.
3) Add both 'name' and 'value' synonymous parameters to @BeanProperty,
@Query, etc...  so @BeanProperty("foo") and @BeanProperty(name="foo") means
the same thing.
4) I think I want to change the default value on @Query(value) to blank
with means use the bean property name.  Currently the default value is "*".
5) I'll add a PropertyNamerUnderscoreLC class that's the same as
PropertyNamerDashedLC but using underscores.
6) Fix how annotations on bean getters and setters are found to better
handle inherited methods.

Re: Fixes for Streams

Posted by Steve Blackmon <sb...@apache.org>.
Great I will try switching back to a model where the request pojos are
generated from jsonscema and the rest proxy annotation are on an interface
ratyher than the pojo class.

On Jun 2, 2017 3:21 PM, "James Bognar" <ja...@gmail.com> wrote:

> #6 is now also finished.
>
> On Thu, Jun 1, 2017 at 8:02 PM, James Bognar <ja...@salesforce.com>
> wrote:
>
> > #3 and #4 are now done.  I still have to work on #6.
> >
> > FYI Steve...one notable change:
> > The RestClientBuilder.plainTextParts() will ensure that query and form
> > data
> > parameters that are collections will be serialized to simple
> > comma-delimited lists.  This may eliminate your need for defining custom
> > PartSerializers.
> >
> > Also, if you use @Bean(propertyNamer=PropertyNamerULC.class) on your
> > request bean, you can probably eliminate the @BeanProperty(String)
> > annotations since it will use "underscore-lower-case" format for bean
> > property names.  For example, the property name for getUserId() would be
> > interpreted as "user_id".
> >
> > Also I've added skipIfEmpty() elements to the @Query/@FormData/@Header
> > annotations.  We could get rid of the separate
> > @QueryIfNE/@FormDataIfNE/@HeaderIfNE annotations.  Thoughts?
> >
> > The following javadocs are up-to-date on the latest changes.  Let me know
> > if anything doesn't make sense.
> > http://juneau.incubator.apache.org/site/apidocs/org/
> > apache/juneau/remoteable/Query.html
> > http://juneau.incubator.apache.org/site/apidocs/org/
> > apache/juneau/remoteable/FormData.html
> > http://juneau.incubator.apache.org/site/apidocs/org/
> > apache/juneau/remoteable/Header.html
> > http://juneau.incubator.apache.org/site/apidocs/org/
> > apache/juneau/remoteable/Path.html
> >
> >
> >
> > On Wed, May 31, 2017 at 11:07 AM, James Bognar <
> > james.bognar@salesforce.com>
> > wrote:
> >
> > > Day job calls me.  Here's what's delivered...
> > >
> > >
> > >    - #1
> > >    - #2
> > >    - #3 for @BeanProperty.  Still working on final design/behavior on
> > >    others.
> > >    - #5 (PropertyNamerULC)
> > >
> > > #6 requires more work.  I have to modify the guts of BeanMeta to better
> > > handle how annotations are handled on methods of subclasses.  That's
> > needed
> > > to fix the "duplicate query parameters" issue that Streams is seeing.
> > >
> > >
> > >
> > > On Tue, May 30, 2017 at 6:28 PM, James Bognar <ja...@apache.org>
> > > wrote:
> > >
> > >> FYI...
> > >>
> > >> Here are the changes I'll be making to fix the remaining issues with
> > >> Streams...
> > >>
> > >> 1) Fix race condition in ClassMeta.
> > >> 2) Fix QueryIfNE behavior on empty collections and arrays.
> > >> 3) Add both 'name' and 'value' synonymous parameters to @BeanProperty,
> > >> @Query, etc...  so @BeanProperty("foo") and @BeanProperty(name="foo")
> > >> means
> > >> the same thing.
> > >> 4) I think I want to change the default value on @Query(value) to
> blank
> > >> with means use the bean property name.  Currently the default value is
> > >> "*".
> > >> 5) I'll add a PropertyNamerUnderscoreLC class that's the same as
> > >> PropertyNamerDashedLC but using underscores.
> > >> 6) Fix how annotations on bean getters and setters are found to better
> > >> handle inherited methods.
> > >>
> > >
> > >
> > >
> > > --
> > > James Bognar
> > >
> >
> >
> >
> > --
> > James Bognar
> >
>

Re: Fixes for Streams

Posted by James Bognar <ja...@gmail.com>.
#6 is now also finished.

On Thu, Jun 1, 2017 at 8:02 PM, James Bognar <ja...@salesforce.com>
wrote:

> #3 and #4 are now done.  I still have to work on #6.
>
> FYI Steve...one notable change:
> The RestClientBuilder.plainTextParts() will ensure that query and form
> data
> parameters that are collections will be serialized to simple
> comma-delimited lists.  This may eliminate your need for defining custom
> PartSerializers.
>
> Also, if you use @Bean(propertyNamer=PropertyNamerULC.class) on your
> request bean, you can probably eliminate the @BeanProperty(String)
> annotations since it will use "underscore-lower-case" format for bean
> property names.  For example, the property name for getUserId() would be
> interpreted as "user_id".
>
> Also I've added skipIfEmpty() elements to the @Query/@FormData/@Header
> annotations.  We could get rid of the separate
> @QueryIfNE/@FormDataIfNE/@HeaderIfNE annotations.  Thoughts?
>
> The following javadocs are up-to-date on the latest changes.  Let me know
> if anything doesn't make sense.
> http://juneau.incubator.apache.org/site/apidocs/org/
> apache/juneau/remoteable/Query.html
> http://juneau.incubator.apache.org/site/apidocs/org/
> apache/juneau/remoteable/FormData.html
> http://juneau.incubator.apache.org/site/apidocs/org/
> apache/juneau/remoteable/Header.html
> http://juneau.incubator.apache.org/site/apidocs/org/
> apache/juneau/remoteable/Path.html
>
>
>
> On Wed, May 31, 2017 at 11:07 AM, James Bognar <
> james.bognar@salesforce.com>
> wrote:
>
> > Day job calls me.  Here's what's delivered...
> >
> >
> >    - #1
> >    - #2
> >    - #3 for @BeanProperty.  Still working on final design/behavior on
> >    others.
> >    - #5 (PropertyNamerULC)
> >
> > #6 requires more work.  I have to modify the guts of BeanMeta to better
> > handle how annotations are handled on methods of subclasses.  That's
> needed
> > to fix the "duplicate query parameters" issue that Streams is seeing.
> >
> >
> >
> > On Tue, May 30, 2017 at 6:28 PM, James Bognar <ja...@apache.org>
> > wrote:
> >
> >> FYI...
> >>
> >> Here are the changes I'll be making to fix the remaining issues with
> >> Streams...
> >>
> >> 1) Fix race condition in ClassMeta.
> >> 2) Fix QueryIfNE behavior on empty collections and arrays.
> >> 3) Add both 'name' and 'value' synonymous parameters to @BeanProperty,
> >> @Query, etc...  so @BeanProperty("foo") and @BeanProperty(name="foo")
> >> means
> >> the same thing.
> >> 4) I think I want to change the default value on @Query(value) to blank
> >> with means use the bean property name.  Currently the default value is
> >> "*".
> >> 5) I'll add a PropertyNamerUnderscoreLC class that's the same as
> >> PropertyNamerDashedLC but using underscores.
> >> 6) Fix how annotations on bean getters and setters are found to better
> >> handle inherited methods.
> >>
> >
> >
> >
> > --
> > James Bognar
> >
>
>
>
> --
> James Bognar
>

Re: Fixes for Streams

Posted by James Bognar <ja...@salesforce.com>.
#3 and #4 are now done.  I still have to work on #6.

FYI Steve...one notable change:
The RestClientBuilder.plainTextParts() will ensure that query and form data
parameters that are collections will be serialized to simple
comma-delimited lists.  This may eliminate your need for defining custom
PartSerializers.

Also, if you use @Bean(propertyNamer=PropertyNamerULC.class) on your
request bean, you can probably eliminate the @BeanProperty(String)
annotations since it will use "underscore-lower-case" format for bean
property names.  For example, the property name for getUserId() would be
interpreted as "user_id".

Also I've added skipIfEmpty() elements to the @Query/@FormData/@Header
annotations.  We could get rid of the separate
@QueryIfNE/@FormDataIfNE/@HeaderIfNE annotations.  Thoughts?

The following javadocs are up-to-date on the latest changes.  Let me know
if anything doesn't make sense.
http://juneau.incubator.apache.org/site/apidocs/org/apache/juneau/remoteable/Query.html
http://juneau.incubator.apache.org/site/apidocs/org/apache/juneau/remoteable/FormData.html
http://juneau.incubator.apache.org/site/apidocs/org/apache/juneau/remoteable/Header.html
http://juneau.incubator.apache.org/site/apidocs/org/apache/juneau/remoteable/Path.html



On Wed, May 31, 2017 at 11:07 AM, James Bognar <ja...@salesforce.com>
wrote:

> Day job calls me.  Here's what's delivered...
>
>
>    - #1
>    - #2
>    - #3 for @BeanProperty.  Still working on final design/behavior on
>    others.
>    - #5 (PropertyNamerULC)
>
> #6 requires more work.  I have to modify the guts of BeanMeta to better
> handle how annotations are handled on methods of subclasses.  That's needed
> to fix the "duplicate query parameters" issue that Streams is seeing.
>
>
>
> On Tue, May 30, 2017 at 6:28 PM, James Bognar <ja...@apache.org>
> wrote:
>
>> FYI...
>>
>> Here are the changes I'll be making to fix the remaining issues with
>> Streams...
>>
>> 1) Fix race condition in ClassMeta.
>> 2) Fix QueryIfNE behavior on empty collections and arrays.
>> 3) Add both 'name' and 'value' synonymous parameters to @BeanProperty,
>> @Query, etc...  so @BeanProperty("foo") and @BeanProperty(name="foo")
>> means
>> the same thing.
>> 4) I think I want to change the default value on @Query(value) to blank
>> with means use the bean property name.  Currently the default value is
>> "*".
>> 5) I'll add a PropertyNamerUnderscoreLC class that's the same as
>> PropertyNamerDashedLC but using underscores.
>> 6) Fix how annotations on bean getters and setters are found to better
>> handle inherited methods.
>>
>
>
>
> --
> James Bognar
>



-- 
James Bognar

Re: Fixes for Streams

Posted by James Bognar <ja...@salesforce.com>.
Day job calls me.  Here's what's delivered...


   - #1
   - #2
   - #3 for @BeanProperty.  Still working on final design/behavior on
   others.
   - #5 (PropertyNamerULC)

#6 requires more work.  I have to modify the guts of BeanMeta to better
handle how annotations are handled on methods of subclasses.  That's needed
to fix the "duplicate query parameters" issue that Streams is seeing.



On Tue, May 30, 2017 at 6:28 PM, James Bognar <ja...@apache.org>
wrote:

> FYI...
>
> Here are the changes I'll be making to fix the remaining issues with
> Streams...
>
> 1) Fix race condition in ClassMeta.
> 2) Fix QueryIfNE behavior on empty collections and arrays.
> 3) Add both 'name' and 'value' synonymous parameters to @BeanProperty,
> @Query, etc...  so @BeanProperty("foo") and @BeanProperty(name="foo") means
> the same thing.
> 4) I think I want to change the default value on @Query(value) to blank
> with means use the bean property name.  Currently the default value is "*".
> 5) I'll add a PropertyNamerUnderscoreLC class that's the same as
> PropertyNamerDashedLC but using underscores.
> 6) Fix how annotations on bean getters and setters are found to better
> handle inherited methods.
>



-- 
James Bognar