So, nice… 😉
So, I’ll be putting out some examples – simple and to the point… Hopefully 😉
With that in mind, compare this ‘todo’ application implementation done with Hamlet to your favorite framework:
When composing your server apps with OWIN there are many options. OWIN spec is very flexible and it doesn’t force you into particular application architecture (this is a good thing). So, using standard OWIN middleware components to compose your application is pretty easy and straightforward.
I prefer to clearly (at the assembly level) separate middleware from the server and the application. That makes it easier to work with for a bigger team, and when potentially, application teams are not the same as server and/or middleware team. Organizing your application in this way could look something like this, starting with middleware components project:
and then application is configured and ran like this:
So, having this in place, application developers – potentially different team(s) then middleware team – would write:
which models application interface as resources, and exposes them via standard HTTP verbs…
If you prefer CQRS – you can have middleware dispatch to handlers and then write your applications something like this:
Bottom line, OWIN is awesome.
But, the interface for the user of this api in that case would look like this:[gist https://gist.github.com/d7a8a81781ae580310de /]
but I didn’t want that. I wanted this:[gist https://gist.github.com/6daa7b382ffb9594e0d4 /]
Turned out to be easy to add a wrapper on top of the explicitly named api:[gist https://gist.github.com/0d17b68356bcecf5cad5 /]
type Tree =
| Node of Tree * Tree
it takes some time to get used to – but F# syntax is just beautiful…
Below are the details about a very simple CI setup, the one that simply checks GitHub for changes to ‘master’ and if
there were any, runs FAKE build script.
First FAKE script:
The only part that should be interesting (the rest is standard FAKE) is conditional dependency for ‘Default’ task.
It depends on returned value from a custom FAKE task that checks if there are changes on GitHub.
Here is the custom task:
That is all – “simple” is the keyword 🙂 – here is the screenshot of it running:
Till next time…