-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
20250207/reflection api - 김대현 기술블로그 제출 #116
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
대현님 안녕하세요!
우선 리뷰가 늦어서 죄송합니다.
그래도 나름 심도 있는 내용을 다루는 글이라 흥미롭게 읽었네요�.
전반적으로 내용이 잘못 된 건 없는 것 같아요.
수고하셨습니다.
|
||
#### ⚙️ 이게 어떻게 가능한가? | ||
> | ||
자바로 작성된 프로그램은 먼저 **Java 컴파일러(javac)**에 의해 `.java` 소스 코드가 **바이트코드(`.class` 파일)**로 변환됩니다. 프로그램이 실행될 때, **JVM**은 이 `.class` 파일을 읽고, **클래스 로더(ClassLoader)**를 통해 메모리에 로드합니다. 이때 클래스의 메타데이터(필드, 메서드, 생성자 정보 등)가 **JVM의 메소드 영역(Method Area)**에 저장됩니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제가 알기로는 java8부터는 "메소드 영역"보다는 "메타스페이스" 라고 표현을 많이 하는 걸로 알고있습니다.
`Reflection API`는 이 메소드 영역에 저장된 클래스의 메타데이터에 접근하여, 런타임 시점에 클래스의 구조를 탐색하거나 객체를 생성할 수 있습니다.(**동적으로 접근/변경이 가능하다는 뜻**) 이를 통해 클래스 이름만으로도 필드, 메서드, 생성자와 같은 대부분의 정보를 가져올 수 있게됩니다. | ||
|
||
Spring에서는 DI, Proxy등에서 사용됩니다. | ||
아주 강력한 기능을 제공하지만 성능 저하나 보안 위협 등으로 인해 보통 프레임워크, 라이브러리 개발에서 사용합니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
성능저하나 보안 위협이 되는데 프레임워크나 라이브러리에서 사용한다는게 말이 좀 이상한거 같네요
그럼 프레임워크나 라이브러리를 사용하는 애플리케이션에서는 해당 문제를 앉고 간다는 식이 되니까요
차라리 이런 문구는 여기서 빼고 결론 부분에서 이러한 장점들로 프레임워크나 라이브러리에서 많이들 사용한다가 더 매끄러운거 같아요
수정 완료했습니다. |
20250207/reflection api - 김대현 기술블로그 제출