Skip to content

Vadym-Lopatka/di-container

Repository files navigation

My implementation of a Dependency Injection Container
(yes, like that one we are used to using in Spring Framework)

Implemented annotations:

  • @Injection - inject a bean from a container to the field (similar to the @Autowired in Spring Framework)
  • @GetFromConfig - inject a value from a config file to the field (similar to the @Value in Spring Framework)
  • @Singleton - construct this bean as a singleton. Every time we inject this bean - the container will return the same instance (similar to the use of the @Service annotation in Spring Framework)

How to run

  1. Open terminal
  2. cd to ../di-container
  3. Execute ./gradlew run

Example usage To demonstrate the container's work I chose a starship area domain.
I want to simulate the working process of a cosmodrome that manages the launches of space rockets.

The service is going to perform the next steps:

1. Notify spaceports staff that we are performing launch
2. Security check that the launch will be safe
3. Execute launch
4. Define launch successfulness
5. Notify the command center about launch results

About

Dependency injection container written in Kotlin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages