You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directmemory.apache.org by Simone Tripodi <si...@apache.org> on 2012/02/14 23:03:43 UTC

fluent APIs

Hi again,

sorry for bugging but I have to take advantage the pet is sleeping,
before she wakes up and I have to get out :P

I see that the purpose of some classes is having fluent APIs - which I
*adore* - anyway in the current codebase there are some points of
improvements...

For example: {{Every.seconds(10)}} is not really "sexy", I use to
import static methods to have a functional-alike look in my Java code,
so I propose modifying some APIs to have:

+--------+
import static Every.every;
...
every( 10 ).seconds();
+--------+

that looks more fluent "every then seconds" instead of "every seconds 10"...

WDYT? It is a trivial improvement but in my short experience sexy APIs
attract people... :P

TIA,
-Simo

http://people.apache.org/~simonetripodi/
http://simonetripodi.livejournal.com/
http://twitter.com/simonetripodi
http://www.99soft.org/

Re: fluent APIs

Posted by "Raffaele P. Guidi" <ra...@gmail.com>.
+1
Il giorno 15/feb/2012 09:45, "Maurizio Cucchiara" <mc...@apache.org>
ha scritto:

> Sounds good :)
>
> Twitter     :http://www.twitter.com/m_cucchiara
> G+          :https://plus.google.com/107903711540963855921
> Linkedin    :http://www.linkedin.com/in/mauriziocucchiara
>
> Maurizio Cucchiara
>
>
>
> On 14 February 2012 23:03, Simone Tripodi <si...@apache.org>
> wrote:
> > Hi again,
> >
> > sorry for bugging but I have to take advantage the pet is sleeping,
> > before she wakes up and I have to get out :P
> >
> > I see that the purpose of some classes is having fluent APIs - which I
> > *adore* - anyway in the current codebase there are some points of
> > improvements...
> >
> > For example: {{Every.seconds(10)}} is not really "sexy", I use to
> > import static methods to have a functional-alike look in my Java code,
> > so I propose modifying some APIs to have:
> >
> > +--------+
> > import static Every.every;
> > ...
> > every( 10 ).seconds();
> > +--------+
> >
> > that looks more fluent "every then seconds" instead of "every seconds
> 10"...
> >
> > WDYT? It is a trivial improvement but in my short experience sexy APIs
> > attract people... :P
> >
> > TIA,
> > -Simo
> >
> > http://people.apache.org/~simonetripodi/
> > http://simonetripodi.livejournal.com/
> > http://twitter.com/simonetripodi
> > http://www.99soft.org/
>

Re: fluent APIs

Posted by Maurizio Cucchiara <mc...@apache.org>.
Sounds good :)

Twitter     :http://www.twitter.com/m_cucchiara
G+          :https://plus.google.com/107903711540963855921
Linkedin    :http://www.linkedin.com/in/mauriziocucchiara

Maurizio Cucchiara



On 14 February 2012 23:03, Simone Tripodi <si...@apache.org> wrote:
> Hi again,
>
> sorry for bugging but I have to take advantage the pet is sleeping,
> before she wakes up and I have to get out :P
>
> I see that the purpose of some classes is having fluent APIs - which I
> *adore* - anyway in the current codebase there are some points of
> improvements...
>
> For example: {{Every.seconds(10)}} is not really "sexy", I use to
> import static methods to have a functional-alike look in my Java code,
> so I propose modifying some APIs to have:
>
> +--------+
> import static Every.every;
> ...
> every( 10 ).seconds();
> +--------+
>
> that looks more fluent "every then seconds" instead of "every seconds 10"...
>
> WDYT? It is a trivial improvement but in my short experience sexy APIs
> attract people... :P
>
> TIA,
> -Simo
>
> http://people.apache.org/~simonetripodi/
> http://simonetripodi.livejournal.com/
> http://twitter.com/simonetripodi
> http://www.99soft.org/