Proposal for ConstructorCountCheck to Limit the Number of Constructors in a Class #17058
Atharv3221
started this conversation in
Ideas
Replies: 2 comments 4 replies
-
|
try |
Beta Was this translation helpful? Give feedback.
4 replies
-
|
Please share some examples of good code vs code that should have violations so that we are clear about what your expectations are, especially regarding nested classes and any other edge cases. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Problem:
Classes with to many constructors can indicate that the class is doing too much or is overly complex. While multiple constructors can be useful in certain scenarios, it might lead to maintainance challenges like difficulty determining which constructor to use, violation of the Single Responsibility Principle.
Using ConstructorCountCheck will help in limiting the number of constructors in a class.
Maximum number of allowed constructors can be configurable using a property.
Beta Was this translation helpful? Give feedback.
All reactions