본문 바로가기

PL14

[PL] Object-Oriented Programming : OOP (3) 1. OOP 언어 장점 (1) Encapsulation and data abstraction -> increase reliability -> procedural, representational specification을 분리하는데 도움 (2) Dynamic Binding -> increase flexibility (3) inheritance -> increase software reusability 2. OOP 언어 단점 (1) High run-time costs for - dynamic binding - message passing (2) 구현이 힘듬 - semantic gap - software simalation (3) 프로그래머가 비싼 클래스 라이브러리를 사용해야 함 3. C++ as a bett.. 2022. 6. 14.
[PL] Object-Oriented Programming : OOP (2) 1. Multiple inheritance (1) 클래스가 하나 이상의 부모를 상속함 (2) sharing 증가 (3) 클래스는 모든 superclass의 변수와 메소드 집합을 상속함 (4) conflict가 있으면, 변수의 descrition 또는 메소드에 대한 우선순위를 정하는 class precedence list를 사용 (depth-first-to-joins) 한 객체는 2개의 클래스에 속할 수 없음 학생 탤렌트 -> multiple inheritance 학생과 탤렌트에서 일을해라()가 overriding 되어 있으므로 conflict 발생 학생 탤렌트에서 일을해라(){학생::일을해라()}로 overriding 가능 탤렌트의 인스턴스를 k에서 j로 변경하면 장나라는 i,j,j의 인스턴스를 갖게 됨.. 2022. 6. 9.
[PL] Object-Oriented Programming : OOP (객체지향 프로그래밍) 1. OOP (1) Natural modeling of real-world problems - Several autonomous entities - Simulation systems (2) Modularity - Data + Procedures - Problem decomposition - Information Hiding (Encapsulation) ; 직접 access하지 않고 인터페이스를 통해 access (3) Software Re-usability - Using inheritances - a lot of useful class libraries (4) Parallelism 2. 개념 (1) 프로그램이 object의 협력적인 집합으로 구성된 구현 방식으로, 각 object들은 클래스의 인스턴스를 .. 2022. 6. 7.
[PL] CH11. Abstract Data Types and Encapsulation Concepts (2) 1. single syntatic unit에서 representation과 operation을 packaging 한 것의 장점: (1) Localized modifications (by encapsulation) - 타입을 사용하는 프로그램 유닛은 representation의 세부사항을 볼 수 없으므로 코드는 representation에 의존하지 않음 -> 타입을 사용하는 프로그램 유닛에 영향을 주지 않고 representation은 언제든지 변경 가능 (2) Increased reliability (by information hiding) - 프로그램 유닛은 representation을 변경할 수 없으므로 object의 intergrity 증가 ex) abstract data type = stack -.. 2022. 6. 2.
[PL] CH11. Abstract Data Types and Encapsulation Concepts (1) 1. Data Abstraction의 2가지 주요 특징 (1) 관련된 operation에 대한 data object의 encapsulation (2) information hiding 2. 추상화 종류 (1) Process Abstraction - 모든 서브프로그램은 process abstraction - 이 서브프로그램 안의 내용을 몰라도 이름만 갖고도 이 서브프로그램의 기능을 파악할 수 있음 (2) Data Abstraction; 데이터 타임 - stack, int, float, ... - 프로그래머에 의해 representation과 implementation detail이 숨겨짐 3. Data Abstraction (1) 추상화 데이터 타입의 Floating-point - 모든 built-in t.. 2022. 5. 31.
[PL] CH10. Implementing Subprograms (3) 1. display 구현 (1) 프로그램에서 서브프로그램의 최대 static depth인 display의 최대 사이즈는 컴파일러에 의해 결정됨 (2) 메모리에 run-time static array로 저장됨 -> 메모리 위치를 통해 기계가 indirect addressing을 할 경우, nonlocal access는 1개 이상의 메모리 사이클을 돎 (3) 레이스터에 display 두기 위해 -> 추가 메모리 사이클이 필요하지 않음 2. Static chaining vs. display method ; non-local 처리 방법 (1) 레지스터에 display가 저장되지 않으면, display의 로컬 변수에 대한 참조는 static chain보다 느림 (indirection 레벨 추가) (2) displ.. 2022. 5. 31.