Automatic source code generation

Generate DAL source code in seconds

Why automatic source code generation?

Source code that would normally take a developer days to write manually can be generated automatically in seconds. ODS takes automation to the next level by automating database creation and upgrade too. ODS automatically tracks design changes made to the DAL and can generate source code capable of upgrading the database in seconds.

The advantages of automatically generated source code

Humans are often not good at writing large amounts of repetitive code. Boring, predictable, repetitive tasks are ripe for automation. ODS doesn't get tired, doesn't make mistakes and always generates high quality code. Generated source code is maintainable and consistent. Consistent structure, layout and naming conventions. Generated source code is well documented. No matter how many different people edit the ODS solution, the generated source code will always remain consistent.

Source code architecture

The DAL source code generated by ODS is divided into three distinct areas: the data store, data structures and the data store providers. They can be compiled into the same or separate binaries.

The Data Store Providers

The data store providers are the only part of the DAL that actually communicate with databases. Each data store provider is responsible for executing stored procedures and SQL and creating and upgrading databases of a particular database (data store) type, such as SQL Server or MySQL. All providers implement the same interface, allowing the rest of the DAL to be completely database agnostic.

Data Structures

The data structures are a series of classes use to hold data from objects stored in the database. The data structures classes are used purely to pass object data around within the DAL.

The Data Store

The data store is the visible front end for the DAL and it is what your application will interact with. It contains a class for each class that you designed in ODS Design Studio. Each class provides accessors for all the properties and all the get, add, update and delete methods that you defined in ODS Design Studio.

For more technical information see the generated source code section of the developer centre.