how constructor arguments too many?
let's contend have category called customer, contains following fields:
- username
- first name
- last name
let's also contend according your business logic, fan objects contingency have 4 properties defined.
now, graceful simply forcing constructor mention any properties. nonetheless it's graceful easy spin out control forced supplement some-more mandatory fields fan object.
i've seen classes take 20+ arguments constructor it's only pain them. but, alternatively, don't need fields run risk carrying capricious information, worse, vigilant referencing errors rest job formula mention properties.
are there any alternatives you only have endorse presumably x volume constructor arguments too live with?
Comments
Post a Comment