Database Agnostic

Seamlessly support multiple database types

An Object based DAL

An ODS generated Data Access Layer acts as a broker between your application and a database. You need only deal with the DAL and never directly with the database. Interaction between your application and the DAL is done almost exclusively with objects. There are no recordsets, database columns or tables involved.

Your application talks to the DAL through a single interface. This interface is not specific to any particular type of database. For example, lets assumed you design a Product class in ODS Design Studio. The generated DAL would contain a Product class with methods such as Add, Delete and Update. From your application, simply instantiate a Product object, set its properties and call the Add method to store it in the database. Other than providing initial database connection details, your application doesn't know or care what type of database the Product object is being stored in.

Database Agnostic Diagram

The database agnostic DAL framework

The data store providers

ODS generated DALs implement a provider model that allows plug-in support for different database types. The data store providers are the only part of the DAL that actually communicate with databases. Each provider deals with a specific type of database such as SQL Server or MySQL but they all implement the same interface. This allows the rest of the DAL to be completely database agnostic.

Write Once

The DAL exposes a single interface that your application uses to store and retrieve objects. Once you've written your application against this interface, you can seamlessly switch data store providers and use any of the supported database types without changing your code. As new database types are supported by ODS, you can generate new DAL source code and seamlessly support them too.

Putting it all together

Each data store provider requires an XML initialisation string, similar to a database connection string. It essentially tells the data store provider which database to connect to (or create) and which username and password to use. By creating multiple data store providers and using different initialisation strings your application can simultaneously use any number of databases of any of the supported database types, without changing your code.