Last updated by admin 4 years ago
???????????? {excerpt:hidden=true}Advanced Topics{excerpt}
Grails?????? {excerpt:hidden=true}Grails Artifacts{excerpt}
{excerpt:hidden=true} Grails takes the separation of concerns approach splitting a Grails application in three layers or tiers:{excerpt}Grails??Grails?????????3????????????????????????????: {excerpt:hidden=true}- 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.
- web?: ?????????????????????????????????:
- ?????????: ?????????????????????????????????????????????????:
- ???????
- ????
- ????: ????????????????????????????????????????????????????????????:
- ??????? ???????
- ??????
- ORM ???????????????
???????????? {excerpt:hidden=true}Injection behavior{excerpt}
{excerpt:hidden=true} Whenever injection of beans is supported the default behaviour is injection by type.{excerpt}beans???????????????????????????????????????????????????CountryService countryService
boolean byName = true
boolean available = true
???????? {excerpt:hidden=true}Configurational properties{excerpt}
{excerpt:hidden=true} 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.{excerpt}Grails??????????????????????????????????????????????????????class SomeService {
boolean transactional = false
String transactional = "false" // ????????????????????????
}


