News

Review: eXpress Persistent Objects for .NET

eXpress Persistent Objects for .NET
$149.99 ($199.99 with source code)
Developer Express
Las Vegas, Nevada
(702) 262-0609
www.devexpress.com

Here's another product to make the link between objects in your .NET code and a database for persistent storage. The DevExpress folks have done a good job of making the most common case easy. Here, for example, is all the code you need to write to define, create, and save a Customer object:

Public class Customer : Inherits XPObject
    Public Name As String 
    Public CompanyName As String 
End Class

Dim c As Customer = New Customer()
With c
    .Name = "Mike Gunderloy"
	.CompanyName = "ADT"
	.Save
End With

That's it! But where, you may be wondering, is the database code? The answer is that XPO takes its best guess at what you want to do by using the Microsoft Access database provider, using the application name and folder for the database name and folder, and creating the database if it doesn't exist already. If you want to overrride these defaults, you just need to assign your own connection string to the default Session object before you start using any persisted objects. XPO can work with either an Access or a SQL Server database, and in fact none of your application code needs to change if you switch from one to the other.

Of course, XPO also supports one-to-many relations between objects. It does this with a simple attribute syntax:

Public Class Address : Inherits XPObject
     _
     Public Owner As Person 
    Public City	As String
    Public Street As String
End Class

Public Class Person : Inherits XPObject
     _
    Public ReadOnly Property Addresses() As XPCollection
        Get
            Return GetCollection("Addresses")
        End Get
    End Property
    ...
End Class

XP also offers some other features, including delayed loading for large properties (again, controlled by attributes), a querying syntax to search for objects in the database, and transaction and optimistic concurrency support. The product installs easily and comes with a full set of help files, tutorials, and sample code to get you started.


............

For more reviews and opinions from Mike Gunderloy, click here.

About the Author

Mike Gunderloy has been developing software for a quarter-century now, and writing about it for nearly as long. He walked away from a .NET development career in 2006 and has been a happy Rails user ever since. Mike blogs at A Fresh Cup.