Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ideal number of properties/methods in a class [closed]

Tags:

oop

What is the ideal number of properties and methods in a class? What considerations must be made in determining this?

like image 509
Dave Avatar asked Dec 25 '11 23:12

Dave


1 Answers

There is no "ideal number of properties and methods" but there are the SOLID principles to which you should adhere if you want to have a good OO design.

But if you try to implement the Universe following the God Object anti-pattern the number is close to infinity.

like image 75
Pencho Ilchev Avatar answered Sep 24 '22 17:09

Pencho Ilchev