using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 


namespace ProjetDotNet.web
{
    public sealed class SingletonConnexion
    {
        private static SingletonConnexion instance = null; 
        private static readonly object myLock = new object();

        

        private DAO.DAOTriangle daotriangle = new DAO.DAOTriangle();
        public DAO.DAOTriangle DAO_TRIANGLE
        {
            get
            {
                return daotriangle;
            }

        }

        private DAO.DAOSegment daosegment = new DAO.DAOSegment();
        public  DAO.DAOSegment DAO_SEGMENT
        {
            get
            {
                return daosegment;
            }

        }

        private DAO.DAORectangle daorectangle = new DAO.DAORectangle();
        public DAO.DAORectangle DAO_RECTANGLE
        {
            get
            {
                return daorectangle;
            }

        }

        private DAO.DAOPolygone daopolygone = new DAO.DAOPolygone();
        public DAO.DAOPolygone DAO_POLYGONE
        {
            get
            {
                return daopolygone;
            }

        }

        private DAO.DAOGroupeMySQL daogroupe = new DAO.DAOGroupeMySQL();
        public DAO.DAOGroupeMySQL DAO_GROUPE
        {
            get
            {
                return daogroupe;
            }

        }
        
        
        private SingletonConnexion() { }

        public static SingletonConnexion getInstance() 
        { 
            lock (myLock) 
            { 
                if (instance == null) instance = new SingletonConnexion();
                return instance; 
            } 
        }
        
    }
    
}
