On 4/27/2016 11:36 PM, Lester Caine wrote:
> To add to your list ...
> https://www.phpdoc.org/docs/latest/guides/docblocks.html
> 
> The glossary entry is rather bare, but I would dispute THEIR statement -
> "but also influences the way the application behaves."
> 
> In my book, these comment blocks are 'annotation' is it's simplest form,
> and we add tags within that annotation to make particular details of
> that annotation both machine readable and humanly prominent. That some
> of these keys may be used to "influences the way the application
> behaves." is secondary?
> 

It is totally secondary but still possible, hence, stating it is
correct. A problem is the that attributes that were added via
annotations are per definition not guaranteed to be executed (influence
the way the application behaves) and are as such not a good fit for
design by contract, validation, nor security checks. However, "per
definition" does not mean that one is not allowed to model it in such a way.

On 4/27/2016 11:36 PM, Lester Caine wrote:
> My continuing irritation is that while subsets keep getting discussed as
> duplicate elements outside of the phpdoc wrapper, there is no provision
> for the annotations that would actually help data validation.
> 

Value objects are a better approach towards validation in the very core
than annotations could ever be.

Validation of user input should happen at the most outer layer to fail
early.

Validation of developers should happen via design by contract where we
currently only have assert() at our disposal.

-- 
Richard "Fleshgrinder" Fussenegger

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to