- Mastering Spring Boot 2.0
- Dinesh Rajput
- 186字
- 2021-06-25 21:29:14
Understanding auto-configuration
Spring Boot auto-configuration provides automatic configuration to your Spring application based on the modules and associated library dependencies of those modules that you have added. For instance, if you have added the embedded in-memory database H2 in your classpath, you are not required to manually configure any bean related to the database such as DataSource, JdbcTemplate, and so on. Spring Boot provides your H2 database with auto-configuration after adding dependency on the H2 database in your application's classpath.
Spring Boot provides the magic of autoconfiguration by extensive use of pre-written @Configuration classes for each module of Spring Framework. But these auto-configurations are activated based on:
- The contents of the classpath of your Spring application
- Properties you have set in the application
- Beans already defined in your application
The @Profile annotation of Spring Framework is an example of conditional configuration. Spring Boot takes this idea to the next level and provides a layer of auto-configuration on top of the traditional Spring Framework. That is why Spring Boot is not a separate framework by heart; it is Spring Framework.
@Profile is a special case of @Conditional.
- Excel 2013使用詳解
- Excel從小白到小能手
- Excel 2019應(yīng)用大全
- OpenCV Computer Vision Application Programming Cookbook Second Edition
- 金蝶KIS:財務(wù)軟件培訓(xùn)教程(第2版)
- Word-Excel-PowerPoint 2007三合一辦公應(yīng)用實戰(zhàn)從入門到精通(超值版)
- Word/Excel/ PPT 2010入門與提高
- Word綜合應(yīng)用簡明教程
- 非常Easy:Excel行政與文秘高效辦公
- Excel 2007表格·數(shù)據(jù)·圖表完全自學(xué)手冊
- Excel高手捷徑 一招鮮 吃遍天
- PPT職場利器:PPT商務(wù)應(yīng)用案例大全
- Word 2007辦公應(yīng)用融會貫通
- PowerShell for Office 365應(yīng)用實戰(zhàn)
- Office 2007案例教程