Object Persistent Framework 3 (or as we call it Opf3) is an Object Relational Mapper (ORM) Framework for .NET 2.0. It has been developed for over 2 years specifically for .NET 2.0. Beginning with the pre beta builds Opf3 evolved with the .NET framework fully supporting new features, such as generics.

ORM - Object Relational Mapper

An Object Relational Mapper is a tool (or framework) that converts relational data into objects and back again. Most modern programming languages use the concepts of OOP (object oriented programming) however most of the current database (MS SQL Server, Oracle, PostgreSQL, etc.) use a relational representation to store their data. This difference in approach is bridged by ORM frameworks. ORMs allow you to define objects in your application and bind those objects to the relational data coming from the database. ORM frameworks fill the gap between relational databases and object oriented programming languages.

ORM frameworks are commonly used in n-tier applications. Your architecture has a SQL database at the backend and your business tier or UI needs access to that data. This is a common problem and has a seemingly easy solution; the RAD tools included in Visual Studio 2005. You select a datasource and bind it to a datagrid. This is a fast and simple way to work with databases, but has a lot disadvantages.

Picture the common occurrence, a change request comes through that requires you to add several fields to a database table. Annoying but typical during the development cycle.

Alerting the underlying table means you need to check your whole application: update your queries (load, update, insert, delete) and update each and every databound control. Opf3 simplifies that process. All the data binding is done by the framework and you are working with real objects; not collections of columns and rows created by the RAD tools. Opf3 moves the data binding from late-bound (compiler does not check the binding) to early bound (where everything is type safe and checked by the compiler). If you remove a field in a table you also need to remove the bound property in the corresponding object; if you forget you get a compiler error for every instance of the bound property in your code. The Visual Studio RAD process will not discover errors like this until runtime when your users will see errors and exception dialogs.

The Visual Studio RAD tools have other disadvantages:
  • The database access happens directly in the UI layer.
  • Every little change is written back to the database.
  • Concurrency problems can occur when multiple user try to edit the same data.
  • You have to write a lot of SQL queries in your application.
  • It's very difficult to use design patterns.

Using Opf3 is very simple. Creating a persistent object (that is an object that is bound to the database) is very simple and only takes a few minutes.

Opf3 offers even more. The ORM framework does the "heavy lifting", automatically transforming the relational data to objects and vice-versa. You don't have to write any SQL queries, and because the framework is responsible it's very easy to switch the underlying database (for example from MS SQL Server to Oracle).

Opf3 simplifies your tiers. You need a new UI? Change it, your Opf3 tier, and your data bound objects stay the same. You need to change the database? Your Opf3 layer remains identical.

.NET 2.0 and 3.5 features

Opf3 was designed for .NET 2.0. We leveraged the best of the new .NET 2.0 features into Opf3. The framework is built to support generics everywhere.

We also make full use of nullable types. Those types allow you to set ValueTypes (for example Int32, Int16, DateTime, Double, ...) NULL. Opf3 natively supports those types everywhere, without the use of magic numbers or structures you had to resort to in previous versions of the .NET framework. Opf3 translates .NET nulls to database nulls and vice versa automatically.

Opf3 supports also anonymous types as they have been introduced in .NET 3.5 and comes with basic support for LINQ queries.

Highly customizable and fast

Opf3 is highly customizable. We defined and used interfaces when building Opf3 to allow you to extend the framework to meet your own needs. We also expose events that may be used by your application, giving you an alternative way to expand the framework .

Opf3 is also very fast. The framework uses optimised caching strategies and algorithms, working as fast as possible.

More about the architecture and over on Opf3 is found at http://www.opf3.com/Opf3/About/Default.aspx.
More documentation on Opf3 is found at http://www.opf3.com/Opf3/Documentation/Default.aspx.
The old website is found at: http://www.opf3.com

Last edited Aug 1, 2009 at 10:15 PM by littleguru, version 8