db4o Developer Community

db4o open source object database, native to Java and .NET
Welcome to db4o Developer Community Sign in | Join
in Search
More Search Options

Product News from the Core Team

This blog features product news right from the core developer team, once new features and functions get checked into Subversion, available as Continuous Build every 2 hours.

using Db4objects.Db4o;

Over the past few months, Rodrigo and I have been working a lot in the area of our Java to C# converter. The upcoming 6.0 version was the occasion for us to introduce some big changes in db4o, just like we did in the past when we've moved from camelCase casing to PascalCase casing for the methods.

We've worked a lot on dealing with .net conventions, to get a more than ever native db4o for .net and Mono. Let me show you, in one short example, most of the changes:

using Db4objects.Db4o;
using Db4objects.Db4o.Query;

class Test
{
    public static void Main()
    {
        using (IObjectContainer store = Db4oFactory.OpenFile("test.yap"))
        {
            IQuery q = store.Query();
            q.Constrain(typeof(Person));

            foreach (Person p in q.Execute())
            {
                Console.WriteLine (p);
            }
        }
    }

}

The more obvious changes are in the namespaces names. Instead of having a Javaish com.db4o, we now have a nice Db4objects.Db4o namespace. Another big change is that accordingly to the framework conventions, all our interfaces's name start with an "I" (note the IQuery and the IObjectSet). Also, for all of you that are using a case-insensitive language, like VB.NET, we renamed the Db4o class, that used to clash with the namespace, to Db4oFactory.

We also have some nice changes under the hood, like using the native .net type system directly, instead of using our old j4o layer on top of it. We are also mapping every possible type to its .net equivalent. In the field of collections that means that our types now implement System.Collections.IEnumerator or System.Collections.IEnumerable instead of our own types. That's really nice.

Of course, we will ship a legacy version of db4o 6.0, which still uses the old conventions for our existing users. But I'm sure that they won't resist long to the strong desire of using this new API. This legacy assembly will keep it's old name: db4o.dll, while the new one is named Db4objects.Db4o.dll. Hence, no confusion is possible.

If you want to give a try right now, you can checkout from our SVN repository the new db4o.net module. You should be able to build the projects you're interested in by just picking the good solution file for your Visual Studio installation. Also, you may notice that we are now using a brand new Db4oUnit test framework that is shared with the Java version. Thus we can write a test in Java and get it running on .net automatically using our converter. So if you're in the mood to write C# unit tests (you can find plenty of them in db4o.net/Db4objects.Db4o.Tests), it will be very easy to integrate them in our regression test suite.

I'm really happy with the new conventions, you can feel the love when you type "using Db4objects.Db4o;". Feel the love!
Published Wednesday, November 15, 2006 12:41 AM by Jb Evain
Filed under: , , ,


Comments

 

Tuna Toksoz said:

i haven't understand why we have com.db4o namespace until now :) it was about java huh :)

good decision :)

good luck ;)

November 14, 2006 6:25 PM
 

dcab said:

Nice...

Add ForEach to IObjectSet

So user could write q.Execute().ForEach(Console.WriteLine);

November 14, 2006 11:56 PM
 

Marek Istvanek said:

Good job :-)

November 15, 2006 6:57 AM
 

hattonjohn said:

Yes, thanks for doing this. It may seem like a small thing to some, but when your team is trying to keep to nice, clean, consistent code, having that db4o stuff with java conventions all over is a real drag.  I hope we see .net-style properties next from you.

November 15, 2006 2:34 PM
 

srdemart said:

Thanks for doing this, it's a huge improvement.

However, what is with the redundant naming "Db4objects.Db4o"?

Why not just Db4objects or Db4o?  

November 17, 2006 12:26 AM
 

Carl Rosenberger said:

Thanks for all the nice comments! Our .NET team has been doing a really good job, to make db4o 300% more native to .NET. In case you did not notice, nativeness also happens on the inside. The converter has really been improved and our internal wrapping libraries (j4o.lang.Class and friends) have nearly disappeared.

About redundancy in naming:

We also have Db4objects.Db4o.Defragment.Defrafgment.Defrag()

:-)

I personally do not like redundancies either but I leave the decision to our .NET guys, they are the experts for .NET-nativeness, they have been driving the huge progress. Excellent work!

November 17, 2006 3:03 AM
 

Eric Falsken said:

The .NET standard is to use ComanyName.ProductName, and as long as we do not have a Class named db4o, it makes the most sense to use "Db4o" as the namespace name. For example, other products, like dRS, may use "Db4objects.Drs".

November 17, 2006 4:10 AM
 

db4o Newsletter said:

db4o Version 6.0 Debuts to the Community How to Contribute to db4o Seagate Personal Servers get a boost

November 21, 2006 1:10 AM
 

db4o auf Deutsch said:

db4o Version 6.0 ...ist erschienen und ab sofort fuer die Community als development (beta) Release zum

November 21, 2006 10:42 AM
 

db4o in Chinese said:

11-12月事件列表: 11/18/2006 - Itasca, IL, USA 11/23/2006 - Vienna, Austria 11/24/2006 - Bangalore, India 11/28/2006

November 26, 2006 2:22 PM
 

db4o News and Press Releases said:

SAN MATEO, Calif., Dec. 14, 2006 - db4objects ( www.db4o.com ), creator of the open source object database,

December 14, 2006 4:40 AM
 

db4o Newsletter said:

Welcome to the January newsletter! db4o Version 6.0 Released as Production-Ready dOCL, the New db4o Open

December 14, 2006 4:58 AM
 

db4o in Chinese said:

节日快乐! db4objects 祝你有一个快乐的圣诞节.我们感谢你在过去一年对我们的支持, 我们希望2007能迎来更成功的一年! K U D O O F T H E M O N T H "面向对象数据库...我并没有预料到他们是如此简单和实效.想象一下,db4o只是一个dll.仅仅一个dl这么简单.不用任何的设置和配置.高效率地存储数据.

December 15, 2006 8:36 AM
 

db4o auf Deutsch said:

db4objects wünscht allen eine schöne Weihnachtszeit! Wir danken euch für eure wertvollen Beiträge und

December 19, 2006 6:27 AM
 

Kudos said:

http://www.infoq.com/news/2006/12/db40-6 Db4Object has released version 6.0 of their open source object

December 21, 2006 11:31 PM
Anonymous comments are disabled