Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Database" /> class with the specified database engine factory..
        /// </summary>
        /// <param name="databaseComponentFactory">The database component factory.</param>
        /// <exception cref="System.ArgumentNullException"><paramref name="databaseComponentFactory"/> is null.</exception>
        public Database(IDatabaseComponentFactory databaseComponentFactory)
        {
            if (databaseComponentFactory == null)
            {
                throw new ArgumentNullException("databaseComponentFactory");
            }

            this.databaseEngine   = new DefaultDatabaseEngine(databaseComponentFactory, this);
            this.storedProcedures = new StoredProcedureCollection(this);
            this.tables           = new TableCollection(this);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Database" /> class with the specified database engine factory..
        /// </summary>
        /// <param name="databaseComponentFactory">The database component factory.</param>
        /// <exception cref="System.ArgumentNullException"><paramref name="databaseComponentFactory"/> is null.</exception>
        public Database(IDatabaseComponentFactory databaseComponentFactory)
        {
            if (databaseComponentFactory == null)
            {
                throw new ArgumentNullException("databaseComponentFactory");
            }

            this.databaseEngine = new DefaultDatabaseEngine(databaseComponentFactory, this);
            this.storedProcedures = new StoredProcedureCollection(this);
            this.tables = new TableCollection(this);
        }
Exemplo n.º 3
0
        public DefaultDatabaseEngine(
            IDatabaseComponentFactory databaseEngineFactory,
            IDatabase database)
        {
            this.compiler = databaseEngineFactory.CreateQueryCompiler();
            this.executor = databaseEngineFactory.CreateQueryExecutor();
            this.concurrencyManager = databaseEngineFactory.CreateConcurrencyManager();
            this.transactionHandler = databaseEngineFactory.CreateTransactionHandler();
            this.loggingPort = databaseEngineFactory.CreateLoggingPort();
            this.serviceProvider = databaseEngineFactory.CreateServiceProvider();

            foreach (IDatabaseComponent component in
                this.Components.OfType<IDatabaseComponent>())
            {
                component.Initialize(database);
            }
        }
Exemplo n.º 4
0
        public DefaultDatabaseEngine(
            IDatabaseComponentFactory databaseEngineFactory,
            IDatabase database)
        {
            this.compiler           = databaseEngineFactory.CreateQueryCompiler();
            this.executor           = databaseEngineFactory.CreateQueryExecutor();
            this.concurrencyManager = databaseEngineFactory.CreateConcurrencyManager();
            this.transactionHandler = databaseEngineFactory.CreateTransactionHandler();
            this.loggingPort        = databaseEngineFactory.CreateLoggingPort();
            this.serviceProvider    = databaseEngineFactory.CreateServiceProvider();

            foreach (IDatabaseComponent component in
                     this.Components.OfType <IDatabaseComponent>())
            {
                component.Initialize(database);
            }
        }