It's a beginner question and might be super easy for most of you experts.
I'm trying to find the correct architecture/structure for a case study project (let's say a building construction sample project).
I'm trying to define a team for a project which is identical through all project phases and referenced and its members are referenced and used in different phases.
I've created a Person
class which defines required fields and used it in my ProjectTeam
class which is a generic List<Person>
.
I want to know how to use this
ProjectTeam
class in other classes which are going to define phases in my project? I'm thinking of a static class, but I don't know how to use it (p1.png).Should I follow the concept of one project with different classes, or it's better to follow the concept of one solution, with a class library used with different projects (representing different phases) in my solution. I've graphically shown the second idea in the not-a-UML diagram (p2.png).
Solution architecture diagram:
namespace MyClassLibrary
{ public class Person
{ public enum ERole { Admin, Head, InCharge }
public string Name { get; set; }
public ERole Role;
private decimal rate = 15.00m;
public decimal Rate
{ get { return rate; }
set{ if (rate >= 15.00m) { rate = value; } }
}
public Person()
{
this.Name = "";
this.Role = ERole.InCharge;
this.Rate = 15.00m;
}
}
}
namespace MyClassLibrary
{
public static class ProjectTeam
{
public static List<Person> TeamMembers = new List<Person>();
static ProjectTeam()
{
TeamMembers.Add(new Person() { Name = "APerson",
Role = Person.ERole.Admin,
Rate = 30.00m });
TeamMembers.Add(new Person() { Name = "BPerson",
Role = Person.ERole.Head,
Rate = 25.00m });
TeamMembers.Add(new Person() { Name = "CPerson",
Role = Person.ERole.InCharge,
Rate = 15.00m });
}
}
}
namespace MyClassLibrary
{
public class Project
{
public string ProjectName { get; set; }
public int ProjectNumber{ get; set; }
public string ProjectScope { get; set; }
}
}