Is it wrong to have a lot of parameters inside a constructor? Like 10 to 15 parameters? Because I was designing a class where a constructor will have lots of parameters, for
Yes it is not good to have many parameters in any kind of functions. Maximum parameters should be around 7, according to a book named Code Complete 2.
It is because it will decrease the code readability and maintainability and usability. Imagine other developers working on the same project, how to follow your code?
There are lots of different ways to handle this, factory pattern, for example. It depends on how you design your application.
But in your code, I think it is ok that the no. of parameters is still acceptable (6 parameters)
If your object require so many parameters to instantiate, then you need to rethink how you design your code. For example, can some of the attributes wrap into a separate class? can some of the attribute not necessary pass as a parameter? i.e., get the value from the other class. etc...