/// <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); }
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); } }
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); } }