Welcome to the Database Objects website. The site is for .NET, iOS, Android and VB6 programmers interested in developing object-oriented systems to encapsulte their relational database systems and business logic. Object-oriented design together with the DatabaseObjects library can significantly simplify the development and maintenance of small and large systems by providing a mechanism to consolidate business logic, maintain data integrity, increase productivity and minimise errors. The library can be used for commercial and non-commerical purposes.
Check out the tutorial videos to help get you started here.
Database Library - Object Relation Mapper
The DatabaseObjects library is a.NET object relational mapping tool that contains a large set of powerful classes that interface to the underlying database system. Classes and properties in the business layer / model are marked with attributes (or functions overridden) in order to indicate the table and field mappings to the database. The library is simple, powerful and easy to learn. There are no external files to setup - everything is setup using standard object-oriented techniques. It is light-weight, flexible and provides facilities for ensuring maximum performance. It is also under active development and requests for changes are always welcome. The source code is hosted on GitHub here.
- iOS via MonoTouch
- Android via MonoDroid
- OSX / Linux via Mono
The libraries support a number of different database. There is a .NET and VB6/COM version of the library. Listed below are the databases and which libraries they are supported by.
|Database System||Available Libraries|
|SQLite (available for iOS via MonoTouch)||.NET Library|
|SQLite (available for Android via MonoDroid)|
|Microsoft Access||.NET Library and VB6/COM Library|
|SQL Server||.NET Library and VB6/COM Library|
|MySQL||.NET Library and VB6/COM Library|
Why Another Object-Relational Mapper?
There are a number of object-relational mapping tools available, some open source and some providing extensive features. My general experience has been that they are overly complicated to learn and use. Unlike most other tools available, this library is simple, powerful and quick to learn, and not limited in any way. There are no external files to setup - everything is setup using standard object-oriented techniques. It is light-weight, flexible and provides facilities for ensuring maximum performance. And because it is open source you can 'peek' under the hood if you need to. It can also be easily retro-fitted into your existing applications. There is simply nothing this library cannot handle! The library has been extensively tested and used on a number of large projects written for various industries.
Database Objects vs Entity Framework
Entity Framework is fully fledged ORM tool, however it has a number of issues with regard to customisability and using it as the basis of a domain-driven model / rich data model. The issues include:
- Poor support for data encapsulation
- Encourages using an anemic data modl
- Serialisation / deserialisation process cannot be easily customised
- No support for non-desktop platforms such as iPhone / Android
- LINQ to SQL code generation pushes errors from compile-time to runtime.
- Poor support for polymorphism with one table
- Compllicated database creation and initialisation
- Automated table creation cannot be customised
- Framework utilises a lot of "magic"
Architecturally, Entity Framework encourages the use of creating an anemic data model rather than a rich data model. This means objects are treated more like data structures than objects. The behaviour of the object is often defined in services outside of the class / data structure. This encourages poor abstraction and tends to spread the business logic throughout the code base.
Entity Framework does however afford some advanced searching abilities and uses LINQ to SQL to generate the SQL. DatabaseObjects relies on a more simple method of generating advanced SQL that is less abstracted and more closely aligned with SQL. This ensures that the code remains simple and less prone to errors in expressions which can occur in LINQ to SQL. Furthermore, DatabaseObjects does not typically require the generation of any data access statements, it is completely automatic. Advanced queries can still be generated in DatabaseObjects in a very similar way as LINQ to SQL. Creation of tables and indexes is not automatic which can afford a lot more flexibility. The serialisation process can be easily customised and polymorphism in it's various forms easily implemented.
SQL Code Generation
The library also supports other database commands for creating / altering tables, indexes, views and specifying table joins, arithmetic expressions, aggregates, grouping, ordering, unions and support for all common data types and more. All commands are database agnostic.
If you have any questions or comments please feel free to email me firstname.lastname@example.org