API / Apache Grails Interview questions
What is the difference between static and dynamic scaffolding in Grails?
Both generate a working CRUD interface from a domain class, but they differ in whether that generated code is written to disk as real, editable source files, or produced purely in memory at request time.
| Dynamic scaffolding | Static (generated) scaffolding |
| No files written to the project | Real controller and GSP files generated via CLI command |
| Generated fresh at runtime on each request | Fixed once generated, until manually edited |
| Great for quick prototyping and demos | Great once the generated behavior needs customization |
| No source to review or version-control | Ordinary source files, reviewable and version-controlled like any other code |
A common workflow is starting with dynamic scaffolding to get an instant working interface while a domain model is still being iterated on, then switching to static scaffolding once the model stabilizes and the generated controller/views need real customization beyond what the generic CRUD pattern produces on its own.
More Related questions...