Last updated by admin
5 years ago
Advanced Topics
Grails Artifacts
Grails takes the separation of concerns approach splitting a Grails application in three layers or tiers:- web tier: presentation logic resides here. Artifacts are:
- views
- controllers
- page flows
- models
- command objects
- validators
- business logic tier: business logic controlled by a middle tier that supports transactional demarcation. Artifacts are:
- domain classes
- services
- persistence tier: operates within the transactional boundries of the business tier and is also controlled by a middle tier, deals with persistence details. Artifacts are:
- domain class persistence methods
- data sources
- ORM tool sessions and factories.
Injection behavior
Whenever injection of beans is supported the default behaviour is injection by name.CountryService countryService
boolean byName = false
def messageSource
boolean available = true
Configurational properties
When property names are reserved for the configuration of specific artifacts in Grails other properties with the same name but not the same type are ignored.class SomeService {
boolean transactional = false
String transactional = "false" // this property is ignored for configurational purposes.
}