Python Forum
Best practices for GUI programming: dividing into multiple classes
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Best practices for GUI programming: dividing into multiple classes
#2
Quote:A book I recently read (Clean Code by Robert C. Martin) said classes should be kept small, and that if a class is large then it should be divided into smaller classes

This all depends. I would say instead that a class should pertain to one process. There may be many parts to the process, and all of the pieces should be kept together. Separating a class just because it's getting too large, is not (in my opinion) a good reason to split it into multiple classes.

Methods, on the other-hand should try to solve one problem, and if that problem contains other parts, those parts should be separated into separate methods (unless simple).
Reply


Messages In This Thread
RE: Best practices for GUI programming: dividing into multiple classes - by Larz60+ - Apr-01-2019, 09:56 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020