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

✍️ post service 수정 #34

Open
1 of 2 tasks
seasameoil opened this issue Jul 1, 2023 · 1 comment
Open
1 of 2 tasks

✍️ post service 수정 #34

seasameoil opened this issue Jul 1, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@seasameoil
Copy link
Collaborator

seasameoil commented Jul 1, 2023

Description

Post 관련 service를 interface를 이용하여 implement와 extends를 사용할 수 있도록 수정�

To-Do

  • implement, extends 차이점 알기
  • 상속 구현

ETC

@seasameoil seasameoil self-assigned this Jul 1, 2023
@seasameoil seasameoil added the enhancement New feature or request label Jul 1, 2023
@seasameoil
Copy link
Collaborator Author

extends

부모에서 선언/정의를 모두 하며 자식은 메소드/변수를 그대로 사용할 수 있음

  • 부모의 메소드를 그대로 사용할 수 있으며 오버라이딩 할 필요 없이 부모에 구현되어 있는 것을 직접 사용 가능함
  • 다중상속 지원하지 않음

implements (interface 구현)

부모 객체는 선언만 하여 정의(내용)은 자식에서 오버라이딩(재정의) 해서 사용해야 함

  • 부모는 선언만 하며, 반드시 자식이 정의를 오버라이딩 해서 사용
  • 다중상속 지원함

정리

추상 클래스는 그 추상 클래스를 기본 틀으로 해서 확장 할 때 사용
인터페이스는 이미 정의된 인터페이스에 맞추어서 만들게 함

인터페이스

  • 인터페이스는 어떠한 설계도
  • 설계도에 맞추어서 규칙으로써 인터페이스에 맞추어 개발하고, 그 규칙에 맞추어 개발하게 되면 내부 구현을 알 필요 없이 호출 가능

추상 클래스

  • 부모 클래스에서 정의한 동작을 자식 클래스에서 구현하고 그것을 자식이 구현하고 확장함
  • 인터페이스와 달리 다른 기능도 확장하고 추가 가능

-> 구체 클래스를 구현하기 전에 interface의 함수를 가져다가 개발 진행 가능

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

No branches or pull requests

1 participant