EASY-TO-USE TYPE OF COMPILE-TIME DEPENDENCY INJECTION METHOD AND DEVICE IN THE JAVA PLATFORM

Disclosed is an easy-to-use type of a compile-time dependency injection method in a JAVA platform and a device thereof. According to an exemplary embodiment, there is provided a method for automatically generating a code which injects an object for a target code at the time of compiling in a JAVA fr...

Full description

Saved in:
Bibliographic Details
Main Author JANG, SEONG HWAN
Format Patent
LanguageEnglish
Korean
Published 25.03.2019
Subjects
Online AccessGet full text

Cover

Loading…
More Information
Summary:Disclosed is an easy-to-use type of a compile-time dependency injection method in a JAVA platform and a device thereof. According to an exemplary embodiment, there is provided a method for automatically generating a code which injects an object for a target code at the time of compiling in a JAVA framework executing environment. The method includes the following steps of: determining whether a target code is a code related with a dependency injection function; generating a provider code of the target code which generates an object and returns the generated object to the target code based on the determination result; and generating an injector code including a dependency object injection code which injects at least one dependency object corresponding to at least one dependency injection indicator included in the target code into at least one dependency field of an object generated by the provider code based on the determination result. The provider code calls the dependency object injection code. 자바 플랫폼에서 사용하기 쉬운 형태의 컴파일 시점 의존성 주입 방법 및 장치가 개시된다. 본 발명의 일 실시예에 따르면, 자바 프레임워크 실행 환경에서, 타겟 코드에 대한 객체를 주입하는 코드를 컴파일 시점에 자동으로 생성하는 방법에 있어서, 타겟 코드가 의존성 주입(Dependency injection)기능과 관련된 코드인지 여부를 결정하는 단계; 상기 결정 결과에 기초하여, 객체를 생성하고, 상기 타겟 코드에 생성된 객체를 리턴(return)하는 상기 타겟 코드의 프로바이더(provider) 코드를 생성하는 단계; 및 상기 결정 결과에 기초하여, 타겟 코드에 포함된 적어도 하나의 의존성 주입 표시자에 대응되는 의존성 객체를 상기 프로바이더 코드에 의해 생성된 객체의 의존성 필드에 주입하는 의존성 객체 주입 코드를 포함하는 인젝터(injector) 코드를 생성하는 단계; 를 포함하고, 상기 프로바이더 코드는 상기 의존성 객체 주입 코드를 호출하는, 타겟 코드에 대한 객체를 주입하는 코드를 컴파일 시점에 자동으로 생성하는 방법이 제공될 수 있다.
Bibliography:Application Number: KR20170118708