CSC/ECE 517 Fall 2010/ch6 6f AZ

From Expertiza_Wiki
Jump to navigation Jump to search

Introduction

Interface Segregation Principle(ISP) states that "Clients should not be forced to depend upon interfaces that they do not use". Instead of one fat interface many small interfaces are preferred based on groups of methods, each one serving one submodule.

If followed, the ISP will help a system stay decoupled and thus easier to refactor, change, and redeploy. It is one of the 5 principles of Object-Oriented Programming called SOLID. This helps in low coupling and high cohesion.

Origin

Motivation

Need for ISP

Examples

Example1

Example2

Example3