| picture take from google |
for example we make a house from the beginning. when the house left the door part, would the kit make a door from the start or would we buy the door ready from the store?
of course it's better for us to buy the finished one. Now, the process of making this house is analogous to a service, then to import the finished door, we use the dependency injector.
so, how is dependency injection in spring framework ? please see picture below.
i'm using example from previous blog post. in spring frame work you can use configuration to inject your model to your service or factory. we will practice more detail in next post.
this factory called Spring Container. this primary function is
- create and manage object (inversion of control)
- inject object dependencies (dependency injection)
- constructor injection
- setter injection
- auto-wiring annotation injection
Comments
Post a Comment