On Friday, October 28, 2016 at 10:58:34 PM UTC+1, Rupert Smith wrote:
>
> For example, if a user account must have an email address associated with 
> it, if there is validation on the format of the email address and it cannot 
> be null, then there is not need to write a specific transactional end-point 
> to allow a user to update their email address, you can just let them modify 
> and save the account record and they can still only perform that operation 
> in a way that produces correct data.
>
> I take your point though about being able to hook into changes relating to 
> specific events.
>

I inadvertently picked an example with the email address that shows why you 
want to hook into specific business events, because in this case you might 
want to send a confirmation email with a link in it to confirm the address 
when the email address is changed. In that case I would not allow the email 
address to be set as part of a more generic 'save' endpoint, and add a new 
end-point for the change email address as its own operation. Its either 
that or add some code to detect the email change somehow - but I think you 
are right, it better to have an explicit endpoint for it, then very easy to 
hook into it as an 'event'. I like to start quickly by starting with the 
open and generic data modelling with CRUD over entities, and then refine 
things from there.

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to