how constructor arguments too many?


let's contend have category called customer, contains following fields:




  • username

  • email

  • 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

Popular posts from this blog

list macos calm editors formula editors

how i practical urls indicate .aspx pages asp.net deployed an iis? (preferably but iis)

jaxb - xjc - reworking generated typesafe enum category members