- Java 21, Spring 3.2.3
Dependency 가 존재하지 않는 Spring을 통해 객체지향의 이해 및 Spring 전반적인 핵심 내용을 이해
회원 도메인 로직 설계
domain
:Member DTO
객체와 회원 등급을 가리키는Enum Class Grade
repository
: 다형성을 위한MemberRpository interface
와 기능 구현을 위한MemoryMemberRepository
service
: 다형성을 위한MemberService interface
와 기능 구현을 위한MemberServiceImpl
MemberServiceImpl
에서 회원가입와 회원조회를 위해MemberRepository
를 사용해야 한다.private final MemberRepository memberRepository = new MemoryMemberRepository();
- 다른 저장소를 변경할 때 OCP원칙을 준수할까?
- DIP또한 지키고 있을까?
private final MemberRepository memberRepository = new MemoryMemberRepository();