Login | Register
My pages Projects Community openCollabNet
Project highlights: Home - Download - Documentation - Contribute

Project home

If you were registered and logged in, you could join this project.

Summary .NET Object-Relational Persistence Framework
Category libraries
License GNU Lesser Public License
Owner(s) luke_marshall, nblumhardt

Ubik Welcome to the homepage of the Ubik project. Here you'll find plenty of info, but as noted below this project is no longer being actively developed.

* Development Status

(Updated 11/01/2008) Ubik is no longer actively developed. As much fun as it is to work on, neither of the original developers is able to find the time.

The mailing lists are still being monitored. Anyone who might like to take this project over is invited to make themselves known there.


Ubik is a persistence framework that has object relational mapping (ORM) capabilities, for the support of domain models in highly interactive client-server applications.

  • Client-server design: Although there are many ORMs now available for the .NET platform, few of them serve the needs of client-server applications built for the desktop using Windows Forms. Ubik can be used in any application context from service to website to rich client, however it excels when the client and server are separated. The carefully layered architecture, local object caching, single-round-trip commits and useful data update events are but a few of the features that make developing sophisticated, user-friendly distributed applications a pleasure.

  • Object-oriented query language: Ubik supports (a useful subset of) the OPath query language, so that an object model rich with associations and inheritance can be queried in a simple and natural manner. The OPath expression syntax is closer to C# than SQL and so fits naturally into C# applications.

  • Predictable behaviour: Ubik has been designed with logically-complex applications in mind, and a great effort has been made to avoid unpredictable behaviour. Queries executed in Ubik for example will return correct results in the context of the local transaction. New objects not yet stored in the database will appear if they match the query, and locally-changed objects will be included or excluded based on their current state.

  • Minimal boilerplate code: Ubik is unobtrusive. A careful tradeoff between functionality and overhead has been made so that while some extra code is required when implementing business objects, repetitive code is minimised.

  • Useful examples: An important goal of the Ubik project is to provide a 'real world' working example, to show not just how the API is used but how Ubik can fit in to a layered architecture including complex user interface interaction.

  • .NET 2.0: Built from the ground up in C# on .NET 2.0, the Ubik API is clean and modern. Nullable types and generics are used where appropriate. Everything from compilation to deployment is simple and easy.

* Project Goals and Plans

Why Ubik?
Object relational mapping has been around for a fairly long time. The most complete and usable ORMs that exist in the .NET world however are being used mainly in server-side development behind web services and sites, rather than in rich client applications. This is probably due in part to the fact that most of the progress in ORM has come from the Java world, where the vast majority of development has been server-side. .NET's excellent desktop application support needs to be complemented with an ORM that provides higher-level features for this environment.

The NHibernate project and many others (see 'Links' below) provide ORM facilities in .NET, and generally offer more flexibility than Ubik in terms of supported platforms, application architectures and mapping transformations. The goal of Ubik is to provide ORM within a framework that in an intergrated manner solves many of the design problems still left to the programmer by other frameworks. In terms of application architecture, Ubik is much more prescriptive in some areas - this allows for features like out-of-the-box networking and event support - but if you don't need these features, Ubik may not be for you.

Building an ORM that will operate effectively in a client-server application poses some unique challenges:

  • Cached and displayed data must be kept up-to-date
  • Sessions are long-running
  • Roundtrips to the server are slow
  • The transactional isolation services of the database cannot be leveraged very well

Ubik foregoes some of the transparency and elegance of other ORMs by addressing these problems - for instance, the diff-based dirty object checking of NHibernate is not considered feasible when sessions are long-lived and can accumulate a large portion of the database in the session identity cache. It is intended that over time the client API will be refined, however the most important issues being addressed by Ubik at the moment are in the back-end.

The out-of-the-box networking functionality provided by Ubik greatly reduces the amount of time required to produce desktop (Windows Forms) applications that can stay current through persistence-layer events rather than by re-querying data. This is due to Ubik's message-based architecture, which distinguishes it from other ORMs. Object refreshing and persistence events are intrinsic to Ubik and require no additional code to be written.

Ubik's client-side caching and the fact that cached objects are kept up-to-date with respect to the database is beneficial when writing efficient applications. Controls and other components can maintain references to domain objects without these domain object instances having to be replaced or manually refreshed each time the database changes.

As well as assisting in desktop application development, Ubik aims to provide a rich programming model that makes highly-abstract object-oriented programming possible. A focus has been made on ensuring that user code can remain completely unaware of the side-effects of methods with respect to the persistence layer, and that objects can behave consistently regardless of their persistence state.

Ubik is still in development and there are still puzzles to piece together. While the goal of this project, and surely of many others, is to create the 'ultimate' ORM within its problem domain, a concerted effort is being made to keep the system stable and useful at every step of the way.

To see where we are and where we're going, check out the roadmap.

* Links

Check out the excellent Grammatica parser generator, which Ubik leverages in its OPath support.

Many of the concepts implemented in Ubik (and more!) are described in the book Patterns of Enterprise Application Architecture by Martin Fowler.

If Ubik isn't what you're looking for, you might want to investigate a different style of ORM that also supports OPath, the Wilson O-R Mapper; or NHibernate, the .NET port of Hibernate, a popular Java ORM.