On Tuesday, November 1, 2016 at 1:16:40 PM UTC, Kasey Speakman wrote:
>
>
> http://blog.ploeh.dk/2013/12/03/layers-onions-ports-adapters-its-all-the-same/
>

I agree with this. I was very happy to see in the first couple of 
paragraphs a description of what usually goes wrong in OO implementations - 
inverting the dependency between the data layer and the domain. This is the 
pattern I am currently using. 

http://blog.ploeh.dk/2016/03/18/functional-architecture-is-ports-and-adapters/
>

Was pretty interesting. I agree that somehow implementing in a functional 
way makes the layering seem less onerous. A case of serendipity that the 
awkwardness of IO in functional languages tends to make this pattern a 
natural one.

To some extent, this also applies to a UI in Elm. The 'domain' of a UI is 
related to but not identical to the domain of the services it consumes - 
but there is still a domain. In Elm we implement that with our model, use 
the type system to try and constrain it to dissallow illegal states, and 
generally provide a set of convenience functions for manipulating the model 
or extracting features of interest from it. The view is a port. The 
interface onto the service, with its HTTP endpoints and encoder/decoders is 
another port.

-- 
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 elm-discuss+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to