객체지향 프로그래밍 (Object Oriented Programming) 의 특징



1. 캡슐화(Encapsulation)

- 은닉화(data hiding)를 포함하는 개념

- data를 private으로 하고 외부에서는 Method에 의한 접근만 허용하는 것

The idea of encapsulation is to keep classes separated and prevent them from having tightly coupled with each other.

- 강한 커플링을 방지하여 분리된 class로 두기 위함 -> 추후 변화에 대한 유연성

- 실사용 예: Hash table



2. 상속(Inheritance)

Inheritance is the mechanism by which an object acquires the some/all properties of another object.

- 다른 객체의 속성이나 기능을 물려받는 개념

- 계층적 구조



3. 다형성(Polymorphism)

Polymorphism is the capability of a method to do different things based on the object that it is acting upon. In other words, polymorphism allows you define one interface and have multiple implementations.

- 하나의 Method(같은이름)의 기능을 다양하게 할 수 있다.

- Overloading을 통해 method의 static 다형성을 지원

- Overriding을 통해 상위 method의 dynamic 다형성을 지원



4. 추상화(Abstraction)

- 유사한 클래스의 공통점을 묶어 하나의 추상클래스로 만드는 것



Reference:

- https://stackify.com/oops-concepts-in-java/

- https://www.tutorialspoint.com/java/java_encapsulation.htm

- http://beginnersbook.com/2013/03/oops-in-java-encapsulation-inheritance-polymorphism-abstraction/



'Program Languages' 카테고리의 다른 글

언어별 표기법들  (0) 2017.02.24

+ Recent posts