学生と教師向けのソーシャル ネットワーキング アプリケーションを作成しようとしています。現在、ユーザー アカウント モジュールを設計しています。
この2つの方法を考えました
アプローチ1
Public class Account
{
public string AccountId{get;set;}
public string AccountName{get;set;}
.
.
.
}
public class Student : Account
{
public Course[] Courses {get; set;}
//other student properties
.
.
.
}
public class Teacher : Account
{
//other teacher properties
}
アプローチ 2
Public class Account
{
public string AccountId{get;set;}
public string AccountName{get;set;}
public AccountType AccountType {get;set;} //AccontType is enum having student and teacher
.
.
.
}
public class User
{
public string UserId { get;set;}
public string UserName {get;set;}
public Account Account {get;set;}
}
public class Student : User
{
public Course[] Courses {get; set;}
//other student properties
.
.
.
}
public class Teacher : User
{
//other teacher properties
}
これらのアプローチよりも優れたアプローチはありますか?