I run my flex project in sonar, and sonar says, I decleared too many fields, too many methods , too much public fields or functions.
acturally, the rule shows the standerd number is very little.
I just want to know, in the common way, how many fields, methods, functions are suitable?
You need as many fields as are required to hold object state.
You need as many methods as are required to implement object functionality.
You need as many public fields and methods as are required to enable external objects to use the class.
Anything more is pointless. Any less means some aspects of the class are inaccessible.
Generally don't make things public unless there's a reason to do so.
Is there anything more? There is no magic number to say X fields or methods per class is optimal.
Yes, i agree with you.
I can write the class to meet the requirement. but I am not sure whether the way is good or not.
I want to get the way to improve the performance. So I try to talk this topic to find the rule to identfy.