• 0 Posts
  • 49 Comments
Joined 3 years ago
cake
Cake day: June 18th, 2023

help-circle
  • composition can help with all of that. factories, strategies, injections are all composition patterns that work fine.

    business logic that repeats? extract it to it’s own thing (class, function, etc) and pass it as a param to the supposed childs.

    mvc? controllers don’t need to extend anything, just have them accept the framework through the constructor and request and response as args. views? same. models? perhaps only if doing an active record, but a repo pattern with plain objects is a good pattern too.

    I never seen a clean inheritance implementation for a decently sized problem. it mostly works for tiny ones.