你的位置:首页 > ASP.net教程

[ASP.net教程]单列模式(data与business交互)


public class CommentsBusiness  //Business{  #region 单列模式  private static CommentBusiness instance;  private CommentData dal;//Data  private CommentsBusiness()  {     dal=new CommentData();  }  public static CommentBusiness GetInstance()  {     if(instance==null)       instance=new CommentBusiness();     return instance;  }   #endregion}