API / Apache Grails Interview questions
What is convention-over-configuration in Grails?
Convention-over-configuration means the framework infers behavior from naming and file placement instead of requiring explicit configuration for the common case — the developer only has to configure something when they want to deviate from the sensible default.
| Convention | What it means, with zero extra config |
| Class in grails-app/domain | It's a GORM-persisted entity with a real database table |
| BookController.show() | Reachable at /book/show |
| grails-app/views/book/show.gsp | Rendered automatically by BookController's show action |
| Class name ending in Service | Registered as a Spring bean, transactional by default |
The trade-off is one every convention-over-configuration framework makes: enormous productivity for applications that fit the conventions, and a learning curve around knowing exactly what's happening implicitly — a developer coming from a purely explicit, configuration-heavy framework has to learn Grails' specific conventions before the "magic" stops feeling like magic and starts feeling predictable.
More Related questions...