Git Product home page Git Product logo

hello-service-auto-configuration's Introduction

Spring Custom Starter

Key takeaways

  • There are two phases of how Spring Boot configure beans for an application
    • 1st phase:
      • User annotated configuration will be given higher priority (those beans that are annotated in the application.)
      • Annotation: @ComponentScan
    • 2nd phase:
      • AutoConfiguration based on the included *-starter modules and also Spring Boot self opinionated configuration.
      • Annoatation: @AutoConfiguration
  • Various type of @Conditional annotations that determines whether the beans should be initialised.
    • The rest of the conditions wont be processed if the higher precedence conditional failed.
    • Eg.
      • @ConditionalOnClass
      • @ConditionalOnMissingBean
      • @ConditionalOnProperty
      • @ConditionalOnExpression
  • Introduction @ConfigurationProperties and @EnableConfigurationProperties on how to create beans based on properties in application properties.
  • spring.factories under resources/META-INF/spring.factories.
    • EnvironmentPostProcessor - post processing after the application context is loaded.
  • ApplicationEvent lifecycle.
  • Recommendation on fixing cyclic autoconfiguration problem
    • @AutoConfigureAfter and @AutoConfigureBefore
  • Create customize condition by extending Spring condition
    • Create new Annotation interface
    • and condition implementation.
  • Making use of -Ddebug to show the loaded beans upon starting of the application
    • or debug=true in the application.properties.

Improvement

  • Convert to SpringBoot 2.0 application as demostrated in the video.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.