Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Dependency Injection example without XML

Simplest example how can Spring Dependency example works. For all configuration are used annotations without any XML files.

Description

  • All configuration is in pooky.projects.AppConfig
  • This class need to be annotated with @Configuration
  • Annotation @ComponentScan will scan and register beans in pooky.projects.beans
  • To run example use Main.java

Interesting reading

Spring Depedency Injection and Beans

  • In Spring Component can have constructor, which include specific Bean and you don´t have to write @Autowired there
  • Otherwise you have to use @Autowired or other import annotation

More demos

About

Simplest example of dependency injection with Spring

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages