Object Persistence Framework

  • Thread starter Thread starter Peter Morris [Droopy eyes software]
  • Start date Start date
P

Peter Morris [Droopy eyes software]

Hi all

Any recommendations for a good object persistence framework? I'd be
interested in hearing from anyone with personal experience.


Thanks


Pete
 
As a rule, I have to recommend eXtensible Persistent Objects (XPO)

I tried XPO and didn't like it. In fact I found it so slow on the PPC that
it proved economical to write my own.
 
As a rule, I have to recommend eXtensible Persistent Objects (XPO)
I tried XPO and didn't like it. In fact I found it so slow on the PPC
that it proved economical to write my own.

XPO is not optimized for the Compact framework though it does run there.
Perhaps listing your requirements might be helpful.

Best Regards,
Dustin Campbell
Developer Express Inc
 
As a rule, I have to recommend eXtensible Persistent Objects (XPO)
I tried XPO and didn't like it. In fact I found it so slow on the PPC
that it proved economical to write my own.

I have also heard good things about LLBLGen Pro though I don't know if it
will suit your requirements.

Best Regards,
Dustin Campbell
Developer Express Inc.
 
Dustin Campbell napisal(a):
I have also heard good things about LLBLGen Pro though I don't know if it
will suit your requirements.

I've been using it for some time and I've been very content. It is very
simple comapred to Hibernate (in fact, never used NHibernate, but I
used to do lot of stuff using java version), and performance's never
been an issue. I came across some problems when tried to import project
files between different versions of LLBLGen after we'd switched to .NET
2.0.
 
Peter said:
Any recommendations for a good object persistence framework? I'd be
interested in hearing from anyone with personal experience.

Paul Wilson's ORMapper is simple and easy to use:

http://www.ormapper.net/

nHibernate is a much heavier solution, but great for more advanced
needs.

I've heard a lot of good things about LLBLGen Pro, and it's possibly a
better option than nHibernate if you want a well supported advanced
tool.

But I'm not convinced that these tools are as good as the theory would
indicate. In my opinion the more advanced your DB schema is, and the
more tables and databases you have, the more difficult it will be to
make ORM work efficiently. And after a huge number of manhours to
develop the maps and tune everything you'll find yourself totally
beholden to the person who set all this up for you. If he leaves your
company you will be in for some pain.

However, if you have a small project it's not going to be difficult to
make it come together. I can see a much better payoff on a small
project, especially with a less complex tool like ORMapper. And if you
typically do a lot of small projects, that's where this concept becomes
a "no brainer". The manhour savings can add up quickly in this case.

Watch out if you're a consultant - some companies won't allow this type
of thing to be used without prior approval.

Eric
 
The BEST i've played with has to be hands down LLBLGenPro. I've played
with several including most listed below and the one that has the
official lock on the seagment has to be LLBLGenPro.
 
I have also heard good things about LLBLGen Pro though I don't know if
it will suit your requirements.

I use LLBLGen Pro and it works great (very bug free). LLBLGen Pro also has
CF.NET output templates too.
 
But I'm not convinced that these tools are as good as the theory would
indicate. In my opinion the more advanced your DB schema is, and the
more tables and databases you have, the more difficult it will be to
make ORM work efficiently. And after a huge number of manhours to
develop the maps and tune everything you'll find yourself totally
beholden to the person who set all this up for you. If he leaves your
company you will be in for some pain.

True - OR/M mapping can get complex on a larger database - but it is the
case with any data layer for a complex DB right?
Watch out if you're a consultant - some companies won't allow this type
of thing to be used without prior approval.

Thankfully LLBLGen Pro (and some other tools) generate complete source
code. In LLBLGen Pro's case, source code for the runtimes libraries is also
provided. So at the least, the client can audit the outputted code
(everything is transparent).
 
Eric said:
I've heard a lot of good things about LLBLGen Pro, and it's possibly a
better option than nHibernate if you want a well supported advanced
tool.

well, thank you! :)
But I'm not convinced that these tools are as good as the theory would
indicate. In my opinion the more advanced your DB schema is, and the
more tables and databases you have, the more difficult it will be to
make ORM work efficiently. And after a huge number of manhours to
develop the maps and tune everything you'll find yourself totally
beholden to the person who set all this up for you. If he leaves your
company you will be in for some pain.

Depends on the O/R mapper you use I guess. If the O/R mapper is up to
its task, the mappings should be pretty transparent and easy to follow.

What people often forget is that an o/r mapper isn't a toolkit which
is supporting a true Table + SQL oriented approach, after all the core
focus of an o/r mapper is on an entity / domain class mapped onto a db
construct, which can be a view or a table or set of tables / views
(inheritance).

And of course, if the mapper of choice doesn't have the ability to let
you specify different ways of expressing your filters for example, you
can run into serious performance bottlenecks.

Take for example the following: (on northwind)
let's say you want to fetch all employee entities which have filed an
order with a product P.
As there are very little employees compared to orders in this
database, a query like: (I use '*' for simplicity, a good o/r mapper of
course emits the field list)
SELECT * FROM Employees INNER JOIN Orders ON
Employees.EmployeeID = Orders.EmployeeID INNER JOIN [Order Details]
ON Orders.OrderID == [Order Details].OrderID
WHERE [Order Details].ProductID = @p

will get you a lot of duplicates for Employees. As Employee contains a
blob (Image field: Photo), you can't use DISTINCT. So all these
duplicates will be send to the o/r mapper layer and filtered there. Not
that efficient. In general this is the 1:n filter based on a join
problem. You should use a subquery instead in this case:

SELECT * FROM Employees WHERE
EmployeeID IN (SELECT EmployeeID FROM Orders WHERE OrderID IN
(Select OrderID FROM [Order Details] WHERE ProductID = @p))

This is much more efficient, as it doesn't get you the duplicates.

If the o/r mapper doesn't allow you to specify that you want a
subquery approach in this case instead of a join based approach, or if
it doesn't make this decision by itself, the developer will run into a
problem as the query will be very slow yet the # of returned entities
will likely be very low.
Watch out if you're a consultant - some companies won't allow this
type of thing to be used without prior approval.

Most of the time this is based on lack of knowledge on the subject and
also because it's not always in the best interest of the consulting
company to use tools which save a lot of time ;) After all, a lot of
consultants are payed by the hour. However, if the consulting company
is clever, they can manage more clients in the same period of time,
which could lead to higher profit. Luckily more and more consulting
companies understand this. :)

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
Peter said:
Any recommendations for a good object persistence framework? I'd be
interested in hearing from anyone with personal experience.

As you're looking for a PPC solution, it's hard to come up with
something that can beat direct table access offered by the SqlCE
client. Most O/R mappers, including the one I'm the lead developer of
(LLBLGen Pro), use a general approach for the queries generated as the
queries are executed by a central generic core. This means that the o/r
mapper core is focussed on executing queries, get back results in
ado.net constructs (datareader etc.) and process these.

With SqlCE, you can also use for example SqlCeResultset or the extra
features in the SqlCeDataReader. As these features are beyond a query
which is executed, a general purpose engine like an o/r mapper's query
engine will not always be on the bleeding edge of performance compared
to the SqlCE extras offered by the classes I just mentioned (and there
are other classes for SqlCE to use)

I'm not saying my work isn't efficient, outside the PPC it is, but on
the PPC you've alternatives, which ask you to go more low-level but at
the same time offer a lot of performance, not utilized by most (if not
all) o/r mappers out there.

FB

--
------------------------------------------------------------------------
Lead developer of LLBLGen Pro, the productive O/R mapper for .NET
LLBLGen Pro website: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
Hi Frans

First I would like to say that I would use SQLite and not SQLCE. I tried
SQLCE originally and found that it performed at about half the speed of
SQLite, I think the DLLs were bigger too.

My PPC apps are pretty complicated too, I definately make use of inheritance
and polymorphism in them so I find that writing with objects is much better.
I have written my own OPF for the PPC which includes nested in-memory
transactions which may be rolled back or committed independantly. However I
will be moving to desktop development very soon and I need something
multi-user, reliable, and with good mapping abilities (maybe with the
ability to create / evolve the DB too). At the moment I am just window
shopping :-)


Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top