When developing a new RESTful application, I generally:
- Define tests
- Define routes [ e.g.: RESTful CRUD; namespaced on
/api/users
] - Define models [ e.g.: "Users" ]
- Define forms [ e.g.: in JavaScript (AngularJS), HTML5 and CSS ]
Currently thinking about throwing an API explorer into the mix… which would be another bit of double-typing.
The best way I can think of for moving forward is:
- Define new schema once; using JSON-schema notation
- Engineer a code-generator to generate tests; and some random data with correct types for input
- Develop a code-generator to create RESTful routes from JSON schema
- Utilise something like metawidget to generate frontend forms from decoupled backend
Is this the best way of encouraging DRY; is there a better/alternate way you can think of / industry best practise?