[클린 아키텍처] 객체 지향 프로그래밍
캡슐화? 구분선 바깥에서 데이터는 은닉되고, 일부 함수만이 외부에 노출됩니다. 이러한 개념이 OO에만 국한된 것은 아닙니다. 사실 C 언어에서도 완벽한 캡슐화가 가능합니다. point.h struct Point; struct Point* makePoint(double x, double y); double distance(struct Point *p1, struct Point *p2); point.c #include "point.h" #include #include struct Point { double x, y; } struct Point* makePoint(double x, double y) { struct Point* p = malloc(sizeof(struct Point)); p->x = x; p-..