私はいくつかのasp.netアプリケーションフォームasp.netを閲覧しました
http://www.asp.net/downloads/starter-kits/jobのような OOP Aggregation または Containment を使用しない例をいくつか見ます 。たとえば、開発者は私の求人情報クラスと会社クラスで国オブジェクトの代わりに国 ID を使用します。
この方法が推奨されているかどうか知りたい
public class JobPosting
{
#region Member Variables
private int intJobPostingID;
private int intCompanyID;
private string strContactPerson;
private string strTitle;
private string strDepartment;
private string strJobCode;
private string strCity;
private int intStateID;
private int intCountryID;
private int intEducationLevelID;
private int intJobTypeID;
private decimal dblMinSalary;
private decimal dblMaxSalary;
private string strDescription;
private DateTime dtPostingDate=DateTime.Now;
private string strPostedBy=HttpContext.Current.Profile.UserName;
}
public class Country
{
private string strCountryName;
private int intCountryID;
public Country()
{
}
}
public class Company
{
private int intCompanyID;
private string strUserName;
private string strCompanyName;
private string strBriefProfile;
private string strAddress1;
private string strAddress2;
private string strCity;
private int intStateID;
private int intCountryID;
private string strZIP;
private string strPhone;
private string strFax;
private string strEmail;
private string strWebSiteUrl;
}