`
boogie
  • 浏览: 235965 次
  • 性别: Icon_minigender_1
  • 来自: 宁波
社区版块
存档分类
最新评论

The main advantage of using the Spring DSL

阅读更多

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 
        } 
}
 
分享到:
评论

相关推荐

    Beginning Spring Boot 2 Applications and Microservices with the Spring Framework

    The main goal of Spring Boot is to quickly create Spring-based applications without requiring the developers to write the same boilerplate configuration again and again. In recent years, the ...

    解决 Can not find the main class. Program will exit. 难题

    在IT领域,尤其是在Java编程中,遇到“Can not find the main class. Program will exit.”这一错误信息是非常常见的问题。这通常意味着编译器或运行环境无法识别并定位到程序的主类,即包含main方法的类,从而导致...

    Beginning-Spring-Boot-2.pdf

    The main goal of Spring Boot is to quickly create Spring-based applications without requiring the developers to write the same boilerplate configuration again and again. In recent years, the ...

    Spring Boot Messaging

    In addition, you’ll discover the new Spring Integration DSL and use it with Spring Cloud Stream to build integration solutions using every enterprise integration pattern. Finally, you’ll see Spring...

    could not find the main class,program will exit

    ### "Could Not Find the Main Class, Program Will Exit" 错误解析及解决方法 在Java编程过程中,我们经常会在开发环境中遇到各种各样的错误提示,其中“Could not find the main class, program will exit”是一...

    The Art of Linux Kernel Design

    Using the 0.11 edition source code as a representation of the Linux basic design, the book illustrates the real states of an operating system in actual operations. It provides a complete, systematic ...

    Characterizing the Torque Lookup Table of an IPM Machine for Automotive

    With the output torque to be the main control target, various control algorithms are developed that aim to achieve high torque accuracy while maximizing the machine energy efficiency. Most of such ...

    Spring 5 Design Patterns

    You will understand the Dependency Injection pattern which is the main principle behind the decoupling process that Spring does, thus making it easier to manage your code. With practical examples, ...

    The Elements of Statistical Learning data Mining,Inference,and Prediction

    Here is a summary of the main changes: 1On the Web, this quote has been widely attributed to both Deming and Robert W. Hayden; however Professor Hayden told us that he can claim no credit for this ...

    The foundations of behavioral economic analysis.pdf

    This is the first definitive introduction to ... the main topics are soft paternalism, and choice-based measures of welfare. Finally, Part IX gives an abbreviated taster course in neuroeconomics.

    Building Microservices with Spring.epub

    You will understand the dependency injection pattern, which is the main principle behind the decoupling process of the Spring Framework and makes it easier to manage your code. Then, you will learn ...

    Mastering.Cross-Platform.Development.with.Xamarin.2016.3.pdf

    The main goal of this book is to equip you with the required know-how to successfully analyze, develop, and manage Xamarin cross-platform projects using the most efficient, robust, and scalable ...

    spring-boot-reference.pdf

    13.2.2. Using Spring Boot without the Parent POM 13.2.3. Using the Spring Boot Maven Plugin 13.3. Gradle 13.4. Ant 13.5. Starters 14. Structuring Your Code 14.1. Using the “default” Package 14.2. ...

    同态加密算法Fully Homomorphic Encryption over the Integers

    The main appeal of our scheme is the conceptual simplicity. We reduce the security of our scheme to finding an approximate integer gcd – i.e., given a list of integers that are near-multiples of a ...

    SpringSource CoreSpring认证考试题库.docx

    题目:Which of the following scenarios requires you to instantiate an ApplicationContext using the `new' keyword? A. Running your Spring application inside a JUnit test (using SpringJUnit4ClassRunner...

    A Unified Framework for the Study of Anti-Windup Designs

    We present a unified framework for the study of linear time-invariant (LTI) systems subject to ... The main result is the unification of existing schemes for AWBT compensation under a general framework.

    The face of the future.

    LG Red, the main color, symbolizes friendliness, and also gives a strong impression of LG's commitment to be the best. LG Grey represents technology and reliability.Brand Identity Learn about the ...

Global site tag (gtag.js) - Google Analytics