CSE Roadmap

Common tier · about 3 hours · 5 parts

Part 3 of 5 · 1 min read

Generalization

Starting from specific entities and pulling their shared attributes up into a new general one.

Think of a veterinary clinic with separate "Dog" and "Cat" records. Someone notices both share a name, a birth date, and an owner. They decide to introduce a shared "Animal" category to hold those in one place.

In plain words: generalization works in the opposite direction from specialization. It starts with specific entities already modeled separately, and pulls their shared attributes and relationships up into a new, more general superclass. The result looks identical to a specialization hierarchy; only the direction of design thinking that produced it differs.

A worked example. Starting with separately modeled Book and Audiobook entities, noticing both share title, author_id and price, and generalizing those into a shared CatalogItem superclass, with Book and Audiobook each keeping only what is unique to them, such as page_count or narrator.

The key lines. No new code; the resulting diagram is identical in shape to a specialization hierarchy.

CatalogItem (title, author_id, price)
  ISA Book (page_count)
  ISA Audiobook (narrator)

Generalization

Generalization starts from specific entities and pulls their shared attributes and relationships up into a new, more general superclass, producing the same kind of hierarchy specialization does, from the opposite design direction.

Example: noticing Book and Audiobook already share three attributes, and introducing CatalogItem to hold them, is generalization.