Large Class

noun

say it: “larj klas” /lɑrdʒ klæs/

A code smell: one class that does many jobs, so it changes for many different reasons and one change can break another.

What is the code smell large class?

A large class is a class that does many jobs: a food truck's FoodTruck class that prices items, draws the menu board, takes payments and prints receipts. It isn't only about length; it's about having several reasons to change, so a change to one job (the receipt's layout) can break another (the payments). The cure is to split it by reason to change, which is the single responsibility principle.

In a sentence

  • “FoodTruck was a large class: it priced items, drew the menu board, took payments and printed receipts.”

Level: Apprentice · More Software Development terms at this level

Updated