Skip to content

Udemy/Ts/section5/73: implements #48

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

Open
wants to merge 57 commits into
base: UdemyTs
Choose a base branch
from
Open

Conversation

4BFC
Copy link
Member

@4BFC 4BFC commented Sep 24, 2024

✍Udemy/ts/section5/73: implements

본 PR은 청강 1회독을 마친 후 N회독으로 작성된 PR입니다.

🔥KeyWord

  • interface
  • type
  • implements
  • class

📝Description

  • type으로 type custom을 하면 되지 않은가?
    • 🚩: interface의 의문, type으로 정의해서 사용해도 되지 않느가? 결국 하나의 타입 덩어리로 묶여 있지 않은가?
    • type을 가지고 유니온 타입 등을 사용해서 우리가 원하는 객체형식으로 type custom을 할 수 있다. 그렇다면 우리는 의문이다. 왜 interface를 사용하는가?
      • interface를 사용하는 이유
        • 분명하고도 미묘한 차이점
          • 🚩: interface와 type의 차이점 설명, interface로 구현한 class 실습
          • type을 사용해서 유니온타입과 같이 커스텀하면 분명 유연할 수는 있지만 interface를 사용하면 훨신 명확해진다는 장점이 있다. interface로 정의하면 객체의 구조를 정의하고자 한다는 것을 명확하게 나타낼 수 있다. 따라서 객체의 타입으로 정의, 커스텀 타입을 사용하기 보다는 interface를 자주 사용한다. 뿐만 아니라 클래스 안에 interface를 구현할 수 있다. 즉, 클래스로 사용하는 문법으로도 interface를 정의할 수 있다는 장점이 있다. 즉, interface로 extends, override와 같이 상송 구조로 공유성을 확보할 수 있으며 클래스인 implements를 사용해서 클래스와 연동, 혼용이 가능하다.

📌Summary

  • 위에서 서술한 interface와 class로 작업하는 방식 외에도 interface를 가지고 extends를 사용해서 동일한 interface로 여러 형식의 interface를 생성할 수 있다. 추후에 Extra 브랜치에서 이와 같은 형식으로 interface를 수정하고 커스텀해볼 예정이다.
  • section5-Extra/N #55

4BFC and others added 30 commits August 27, 2024 01:50
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 작성한 커밋입니다.
Github에서 작성한 커밋입니다.
Github에서 수정한 커밋입니다.
Github에서 수정한 커밋입니다.
4BFC added 22 commits September 21, 2024 01:34
@4BFC 4BFC requested a review from nyun-nye September 24, 2024 13:50
@4BFC 4BFC self-assigned this Sep 24, 2024
@4BFC 4BFC added the 2회독 회독 label Sep 24, 2024
@4BFC 4BFC added this to the Udemy:TypeScript milestone Sep 24, 2024
@4BFC 4BFC changed the title Udemy/ts/section5/73: implements Udemy/Ts/section5/73: implements Sep 25, 2024
@4BFC 4BFC mentioned this pull request Sep 25, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2회독 회독
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Udemy/section5/75: readonly with interface, type Udemy/section5/74: Think about interface
1 participant