Del Elson
Aug 17, 2021

--

It's good to remind people that the Single Responsibility Principle works both ways. A class should have a single responsibility, but also a responsibility should belong to one class. So you already have a chef class, that can cook. You should not have to create separate new classes like "baker" or "mom" or "kitchenhand" that can also cook (unless they are specialised child classes), all of the cooking responsibility should be delegated to the "chef" class.

--

--

Del Elson
Del Elson

Written by Del Elson

Since moving from Australia to Vietnam in 2014, Del has been running training courses in software architecture and technical architecture for the IT industry.

No responses yet