单列模式(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
}

 

posted @ 2015-10-02 19:37  如此低调的男人  阅读(355)  评论(2编辑  收藏  举报