B
Big George
Hello,
I develop in ASP.NET with VB.NET code.
I need some help constructing a class: Worker. I'm designing the
properties of this class.
The class is filled reading tables in database.
Properties of Class Worker:
- ID_Card
- Names of Person
- ID_Current_Company
- Name of Current Company
- Is Worker working at the company? (Yes, No)
- Projects that worker worked in
- Project 1 (ID and name)
- Project 2 (ID and name)
- Project 3 (ID and name)
- ...
My problem is with property Projects_Worked_In. A worker could have
been in many projects. I don't know how many projects a worker has
worked at. It could be only 1 project or 5 projects.
How would you desing this property Projects_Worked_In of class Worker?
I was thinking to:
- Define 50 properties like Project1, Project2, Project3,... Project50,
all of them initialized in NULL
- Define a property Number_Of_Projects and according to that I will
know if I have to display Project1, Project2, Project3, etc.
Problem is what happen if Number_Of_Projects > 50
Thank you for your help !
I develop in ASP.NET with VB.NET code.
I need some help constructing a class: Worker. I'm designing the
properties of this class.
The class is filled reading tables in database.
Properties of Class Worker:
- ID_Card
- Names of Person
- ID_Current_Company
- Name of Current Company
- Is Worker working at the company? (Yes, No)
- Projects that worker worked in
- Project 1 (ID and name)
- Project 2 (ID and name)
- Project 3 (ID and name)
- ...
My problem is with property Projects_Worked_In. A worker could have
been in many projects. I don't know how many projects a worker has
worked at. It could be only 1 project or 5 projects.
How would you desing this property Projects_Worked_In of class Worker?
I was thinking to:
- Define 50 properties like Project1, Project2, Project3,... Project50,
all of them initialized in NULL
- Define a property Number_Of_Projects and according to that I will
know if I have to display Project1, Project2, Project3, etc.
Problem is what happen if Number_Of_Projects > 50
Thank you for your help !