What if your domain model could validate the UI for free?
gcanti.github.io
gcanti.github.io
Contracts.js is quite a different approach, maybe even to an orthogonal problem, but perhaps is more interesting: https://github.com/disnet/contracts.js
Looks like there's a typo in the last example: you probably want to use the Struct param in the fetch function rather than explicitly creating a User.
Seems like the makings of something like Bootstrap for domain models here. Neat.
Good catch! thank you, I'll fix that asap.
As you've pointed out, I am excited by the opportunity to implement this cycle
Domain (tcomb.js) --> UI generation (React.js, with validated props)
^ |
| |
| |
+-------------------------- Input validation
Some example off the top of my head | T | input |
+----------+------------------------+
| Str, Num | textbox, textarea |
| enums | select, radio |
| struct | form |
| list(T) | table of T (recursion) |I switched my port of django.forms away from using my own DOM library to generating React components: https://github.com/insin/newforms
Then your domain modeling language will be as detailed and error prone as the UI designing language, and completely unsuitable for the task. As the article exemplifies.
Abstraction and detail are at odds against each other. You simply can not have both.
Also, why verify the domain description? You must check that the UI fits the problem, not a short description of it.