기반 클래스와 파생 클래스에서 제공하는 연산은 일관성 있는 행위(behavior) 여야 함
기반 클래스 인스턴스를 파생 클래스 인스턴스로 대체해도 프로그램의 의미 불변
Pre -> Pre` & Post` -> Post (if Pre then Pre` & in Post` then Post)
Pre/Post: 기반 클래스 연산의 선행/후속 조건
Pre`/Post`: 파생 클래스 연산의 선행/후속 조건
ISP(Interface Segregation Priciple) 인터페이스 분리 원칙
객체지향 설계 원칙
클래스에 특화된 인터페이스로 분리
클래스는 사용하는 해당 인터페이스만 구현
어떤 클래스가 다른 클래스에 의존할 경우 가능한 최소한의 인터페이스만 사용
public interface All {
public void walk( );
public void bark( );
public void fly( );
}
public interface Walkable {
public void walk( );
}
public interface Barkable {
public void bark( );
}
public interface Flyable {
public void fly( );
}