What is the limit of N maximum methods that you allow in your classes?

When filling out an Overview of Object Oriented Concepts (To provide some research scientists with real data on software development), I came across this question:

What is the limit of N maximum methods that you allow in your classes?

A survey is then performed if you reorganize your classes as soon as you reach this limit.

I honestly never thought of such a restriction when developing my applications and wondered what argument was. Why do I want to impose on myself an arbitrary number, which probably depends heavily on the functionality of the classes?

+3
source share
5

N . " ". all-can-do-whatever-it-is.

, N, . .

+8

, , , .

, 20 , , SRP > .

+4

, , , - 10-20 , , . J2EE, Enterprise Java Melons.

. , , .

+3

, , .

, 30 , 3 (Umm, 30 , - , kloc)

/ -.

- ​​ - , 4 5 .

, JDK- , , , , 20.

+3

, , - , " !" , , do-all, .

If I open the source file, which I have not looked at before, and see more than 10-20 methods, I will probably scan it to see if it can somehow be reinstalled.

+1
source

Source: https://habr.com/ru/post/1704851/


All Articles