Skip to content

Instantly share code, notes, and snippets.

@VineetReynolds
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VineetReynolds/b6411cffcd1534f7d3ac to your computer and use it in GitHub Desktop.
Save VineetReynolds/b6411cffcd1534f7d3ac to your computer and use it in GitHub Desktop.
Reasons to not scaffold from a database
  • Lack of awareness of transactional context. Say you have entities A, B and C where only A and B are related to each other in the database schema. If your use case requires updates to all three entities, scaffolding will not generate code to update them. At best, the generated code will update A and B. Knowledge about C is simply not there in the database; it exists in the use-case.
  • Scaffolding for entities with composite keys can get complicated. In an ideal world, REST resources mapped to a database entity, are mapped using the primary key. Composite keys ensure complicated URLs. Matrix parameters are a solution, but some JS client frameworks do not even support this (remember, matrix parameters are just a design note, and not part of the HTTP 1.0 and 1.1 RFCs).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment