ITeye博客

The main advantage of using the Spring DSL

boogie · 2008-05-26 10:56 · Grails · Markdown

The main advantage of using the Spring DSL is that you can now mix logic in within your bean definitions, for example based on the environment :

import grails.util.*

beans {
	switch(GrailsUtil.environment) {
		case "production":
			myBean(my.company.MyBeanImpl) {
				bookService = ref("bookService")
			}
                break 
                case "development": 
                        myBean(my.company.mock.MockImpl) { 
                               bookService = ref("bookService") 
                        }
                break 
        } 
}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。