Re: Do supported operations of a class always expect instances of the class?

Hi Tom,

thank you for providing your perspective. I suspected that my
assumption about hydra:expects wasn't valid in all cases, but it's
good to have your concrete examples that show cases in which the
assumption doesn't hold.

- Jindřich

-- 
Jindřich Mynarz
http://mynarz.net/#jindrich

On Tue, Jun 17, 2014 at 10:32 AM, Tomasz Pluskiewicz <tomasz@t-code.pl> wrote:
> Hi Jindřich
>
> On Tue, Jun 17, 2014 at 9:49 AM, Jindřich Mynarz
> <mynarzjindrich@gmail.com> wrote:
>> Hi,
>>
>> if a hydra:Class supports a hydra:Operation, does it mean that the
>> operation hydra:expects an instance of the class? Has the description
>> of supported operation always the following shape?
>>
>> :Class hydra:supportedOperation [ hydra:expects :Class ] .
>>
>
> I think that would be unnecessary and too rigid. Consider an example
> of collections, to which you can post new members
>
> :Collection hydra:supportedOperation [ hydra:method "POST" ;
> hydra:expects :CollectionElement ] .
>
> That's just off the top of my head but very common.
>
>>
>> And analogously for class instances:
>>
>> :instance hydra:operation [ hydra:expects :instance ] .
>>
>
> With instances the first thing I can think of is a more RPC style API,
> where you post commands (think CQRS)
>
> :instance a :User ; hydra:operation [ hydra:method "POST" ;
> hydra:expects :ChangePasswordCommand ] .
>
> Regards,
> Tom
>
>>
>> - Jindřich
>>
>> --
>> Jindřich Mynarz
>> http://mynarz.net/#jindrich
>>
>>
>

Received on Tuesday, 17 June 2014 08:41:42 UTC