JavaBean?
특정한 정보 (id, password, name, job...)등을 가지고 있는 클래스를 표현하는 하나의 규칙이고, 데이터를 표현하기 위한 목적을 지니고 있음. 이 규칙을 지닌 클래스를 Java Bean 이라고 함.
Java Compiler (javac)로 컴파일 된 코드는 Java Reflection을 통해 그 데이터가 추출된다.
JavaBean 이 따라야하는 규약들은:
- Public no-argument constructor: Allows easy instantiation.
- Public Getter and setter methods: Standardized access to properties.
- Serialization: Enables saving and restoring object state.
- Private fields: Promotes encapsulation.
이 있다.