프로토타입
-
객체에 대해서(생성과 중첩 객체)Front/js 2024. 7. 5. 15:11
▤ 목차">HTML 삽입미리보기할 수 없는 소스 ✔프로토 타입 객체⌨ 프로토 타입java는 클래스 기반 객체지향 프로그래밍 언어이다.객체 생성 이전에 클래스를 정의하고 객체를 생성한다. 하지만 javascript는 프로토타입 기반 객체지향 프로그래밍 언어이다. 자바스크립트의 동작 원리를 잘 이해하기 위해서는 프로토타입의 개념을 잘 이해하고 있어야한다. 프로토타입 기반 객체지향 프로그래밍 언어는 클래스 없이 객체를 생성할 수 있다.자바스크립트의 모든 객체는 자신의 부모 역할을 담당하는 객체와 연결되어 있다. 객체지향의 상속 개념과 같이 부모 객체의 프로퍼티 또는 메서드를 상속받아 사용할 수 있다. 👏 객체 생성 방법자바스크립드의 객체 생성 방법에는1. Object 생성자2. 객체 리터럴3. 생성자 ..
-
디자인 패턴 _ 어댑터 패턴 (Adater pattern)정보처리기사/개념 2024. 5. 13. 09:50
▤ 목차" data-ke-type="html">HTML 삽입미리보기할 수 없는 소스 ✔ 디자인 패턴⌨ 디자인 패턴이란?객체 지향 프로그래밍 설계를 할때 자주 발생하는 문제들을 피하기 위해 사용되는 패턴이다.여러 사람들이 협업해서 개발할 때, 기존 코드를 이해하는 것은 어렵다.더 어려운건 이런 코드를 수정하거나 새로운 기능을 추가하는 것이다.의도하지 않은 결과나 버그를 발생시키기 쉽고 성능을 최적화시키기도 어렵다.개발했던 개발자들이 함깨 수정하지 않는다면,하지만 특정 패턴을 만들어주면 위의 상황을 조금 방지할 수 있다."이런 기능을 만들어야한다." 라는 제안이 진행된다고 가정하자. "그럼, 이런 패턴을 사용하자."라는 개발의 진행 방향을 결정할 수 있다. 객체지향 설계/구현에 많이 사용된다.소프트웨어 구..