A
antonyliu2002
I have always been wondering about this question: How do we decide
what should be put into the constructor?
For example, a Project class can have a lot of attributes, such as
ProjectID, ProjectName, ProjectManagerID, ProjectDescription,
ProjectObjective, ProjectProgramAreaID, ProjectStatus, ProjectFundID,
ProjectFundStatus, ProjectSchedule, etc.
Now, when I am writing the Project class, how do I decide which and
which of such information go to the constructor(s)? It apparently
does not make sense to cram all of them into a single constructor,
right? And if we decide to have multiple constructors, what
information needs to be selected and put into which constructor?
I am confused, please shed some light on this issue. Thank you.
what should be put into the constructor?
For example, a Project class can have a lot of attributes, such as
ProjectID, ProjectName, ProjectManagerID, ProjectDescription,
ProjectObjective, ProjectProgramAreaID, ProjectStatus, ProjectFundID,
ProjectFundStatus, ProjectSchedule, etc.
Now, when I am writing the Project class, how do I decide which and
which of such information go to the constructor(s)? It apparently
does not make sense to cram all of them into a single constructor,
right? And if we decide to have multiple constructors, what
information needs to be selected and put into which constructor?
I am confused, please shed some light on this issue. Thank you.