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:

  1. Define new schema once; using JSON-schema notation
  2. Engineer a code-generator to generate tests; and some random data with correct types for input
  3. Develop a code-generator to create RESTful routes from JSON schema
  4. 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?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.