Interface Segregation: No Bee Carries the Whole Hive
Placeholder prose. No single bee is asked to forage, nurse, guard and build; the roles are separate and the hive is the sum of them. The opening section sets up the analogy and states the principle in one sentence.
Second paragraph of placeholder body copy. It names the failure mode the principle prevents and the stub method that gives it away.
The interface nobody fully implements
Placeholder lead-in to the code sample below.
hive/roles.ts
interface HiveMember {
forage(): void;
nurse(): void;
guard(): void;
layEggs(): void;
}
class Guard implements HiveMember {
guard() { … }
forage() { throw new Error("not implemented"); }
nurse() { throw new Error("not implemented"); }
layEggs() { throw new Error("not implemented"); }
}The cost of an interface is paid by everyone who implements it, not by the one who wrote it.
Small interfaces, whole objects
Closing placeholder paragraph. It restates the rule, concedes the one case where breaking it is fine, and hands off to the next article.