G
gazza67
Hi Everyone,
I have two quick questions about programming style for oo programming.
i guess they are probably generic questions but as i am only interested
in c# i thought i would post here.
I have written an application, it has a main form with a menu and one
of the menu items allows me to create a car object. When I select this
option a dialog window comes up with a series of options that let me
set the characteristics of the car object that I will create.
1. where should u call the constructor for the car - should it be in
the create car dialog code or should it be in the mainscreen code?
2. the list of characteristics for a car is growing longer than i first
thought. i am having to pass more and more parameters to the contructor
code and it is starting to look ugly (ie there are so many parameters
to pass). Is there an alternative to having many params being passed to
a constructor - and if so, at what point should I start to look at
these alternative.
Thanks in advance,
Gary
I have two quick questions about programming style for oo programming.
i guess they are probably generic questions but as i am only interested
in c# i thought i would post here.
I have written an application, it has a main form with a menu and one
of the menu items allows me to create a car object. When I select this
option a dialog window comes up with a series of options that let me
set the characteristics of the car object that I will create.
1. where should u call the constructor for the car - should it be in
the create car dialog code or should it be in the mainscreen code?
2. the list of characteristics for a car is growing longer than i first
thought. i am having to pass more and more parameters to the contructor
code and it is starting to look ugly (ie there are so many parameters
to pass). Is there an alternative to having many params being passed to
a constructor - and if so, at what point should I start to look at
these alternative.
Thanks in advance,
Gary