September 2017
Beginner to intermediate
384 pages
8h 4m
English
Interface segregation design principle recommends modeling many small interfaces for a specific purpose, as opposed to modeling one bigger interface that represents many things. In the case of C++, an abstract class with pure virtual functions can be thought of as an interface.
Let's take a simple example to understand interface segregation:
#include <iostream>#include <string>using namespace std;class IEmployee { public: virtual string getDoor() = 0; virtual string getStreet() = 0; virtual string getCity() = 0; virtual string getPinCode() = 0; virtual string getState() = 0; virtual string getCountry() = 0; virtual string getName() = 0; virtual string getTitle() = 0; virtual string getCountryDialCode() = 0; virtual string ...