incubator-blur-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Williams <william...@gmail.com>
Subject Re: Blur Platform Argument Passing
Date Thu, 25 Sep 2014 14:07:42 GMT
On Thu, Sep 25, 2014 at 9:37 AM, Aaron McCurry <amccurry@gmail.com> wrote:
> Let me try an example:
>
> public class YourCommand extends Command implements IndexReadCommand<Long> {
>
> // Normal command logic here...
>
>   // Required by default.
>   public void setTable(String table) {...}
>
>   @OptionalArgument
>   public void setShard(String shard) {...}
> }
>
> I realized it's not that sexy but it should make it very easy for the
> platform to do argument checking at the controller (or even the client).
> Also removes the need to annotate all the arguments at the class level.
> Instead you can annotate/javadoc right on your command.
>
> Does this help?

Definitely, thanks.  This is far better than the Args approach.  So,
inside a command method (e.g. execute() ) you're guaranteed that
required props are set and you only need to check optionals?  I like
that we can fail client-side too, and that we can create constructors
with required stuffs to make it easier.  I like it.

Thanks,
--tim

Mime
View raw message