Skip to content
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

팩토리 메서드 #2

Open
Jin409 opened this issue Oct 19, 2022 · 1 comment
Open

팩토리 메서드 #2

Jin409 opened this issue Oct 19, 2022 · 1 comment

Comments

@Jin409
Copy link
Contributor

Jin409 commented Oct 19, 2022

의문점 정리

  • 왜 예시 소스코드에서 DefaultShipFactory 는 interface 가 아닌 추상 클래스로 정의하는가
@Jin409
Copy link
Contributor Author

Jin409 commented Oct 20, 2022

  • 온정 소스코드에서 feed 부분을 팩토리 메서드를 이용해 개선할 수 있지 않을까?
  1. feed 클래스 생성 (지금은 도메인 개념이 아니라 메서드 정의만 되어 있음)
  2. feed 클래스를 상속받은 serverfeed, clientfeed 클래스 생성
  3. FeedService 인터페이스 생성 (공통되는 메서드 미리 구현 ex. delete / readfeed ...) + (put 과 create 는 필드가 상이하므로 오버라이드 할 수 있도록 키워드를 따로 붙이지 않고 인터페이스에 정의)
  4. ServerfeedService / ClientfeedService 에는 오버라이드 해야 하는 메서드만 정의

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant