How sw-fantastic/swdc-dependency works
Project type and purpose
• This is an open-source Java library implementing a lightweight, annotation-driven dependency-injection (DI) container that follows the javax.inject specification. It also provides AOP (Before/After/Around) hooks and an event-emitter subsystem.
File structure
• Top-level files: pom.xml (Maven build), jitpack.yml (JitPack config), README.md.
• src/main/java/org/swdc/dependency: core packages
• annotations: DI/AOP annotations (@Inject, @Singleton, @Aspect, etc.)
• parser: AnnotationDependencyParser, builds metadata from scanned classes
• registry: holds ComponentInfo, DependencyInfo, InterceptorInfo, DefaultDependencyRegisterContext
• scopes: SingletonDependencyScope, PrototypeDependencyScope
• interceptor: AspectHandler, InvocationPoint, ProcessPoint
• event: EventEmitter, EventHandler, Events
• application: AbstractApplication, SWApplication (optional bootstrapping)
• utils: ReflectionUtil, AnnotationUtil, LoggerProvider
• src/main/resources: logback.xml, native-image reflect config (Graal integration)
• src/test: tests covering annotation parsing, environment loading, registration, reflection utilities
README insights
• Focus is on lazy initialization (“initialize when first needed”) vs. Spring’s eager start
• Future plans: XML support, Graal native-image via GraalNativePlugin