Evaluating ORM's, question about the Dynamic SQL Engine

Posts   
 
    
mreiland
User
Posts: 3
Joined: 01-Apr-2008
# Posted on: 09-Apr-2008 06:43:14   

First off, let me apologize for my ignorance of LLBLGen Pro. I haven't taken the time to download the trial and really get into it, so my knowledge is very superficial.

We're going through a technology upgrade at my current company (.Net 1.1 => 3.5) and I'm evaluating ORM's to use. Entity Framework is on the table, although my vote is against it for various reasons.

Probably our most significant requirement has to do with dynamically generated tables. We're looking at dynamically creating tables and querying against them without any type of static SQL (stored proc, or otherwise). How tough would it be to hook into your dynamic SQL engine and have it create the queries for us given sufficient metadata, said metadata being handed to it during runtime rather than compile/software startup time?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 09-Apr-2008 10:19:24   

The problem is: into which objects are you going to fetch the data and how is the code going to work with these objects? The problem is that .NET languages are statically typed. This means that if you create tables at runtime, you have no typed buckets to store the data in, nor are these objects known in your code as they're not known at compile time.

So what's left is a weakly typed bucket, like a datatable.

LLBLGen Pro works with statically typed objects, as its query system has to work with meta-data known at compile time (how else do you want to formulate queries?)

Frans Bouma | Lead developer LLBLGen Pro
mreiland
User
Posts: 3
Joined: 01-Apr-2008
# Posted on: 09-Apr-2008 13:06:17   

I dare to dream simple_smile

I was hoping there was a mechanism to override the compile time meta-data, but apparently not.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 09-Apr-2008 14:19:55   

In theory that's possible, but how would you use it at runtime? I.o.w: how would you formulate a query on a type in code which doesn't exist at compile time? simple_smile

Frans Bouma | Lead developer LLBLGen Pro
mreiland
User
Posts: 3
Joined: 01-Apr-2008
# Posted on: 09-Apr-2008 17:52:47   

To clarify, I meant override in a more generic sense than simply overriding a specific attribute in C#. Perhaps a way to describe the schema that can be registered/unregistered at runtime.

There are other ways for us to achieve our goals, but plugging into an ORM's Dynamic SQL Engine seemed like the path of least resistance. It's a bit unorthodox, so I'm not optimistic that we'll find it, but I thought I'd ask simple_smile

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39903
Joined: 17-Aug-2003
# Posted on: 09-Apr-2008 18:18:50   

I wish I had a different thing to tell you, but I think it's a long road to use a normal o/r mapper for this. Of course, if you use the generated code and create meta-data at runtime and feed that to the dynamic query engine, it could work, though I don't think programming with it is really a joy nor easy as the interface to the query engine is build around the objects our generated code produces.

If you download the demo and generate code for adapter, you can see how this meta-data works with the PersistenceInfoProvider class and the create query routines in the generated DataAccessAdapter. But it's not easy if you have to build the meta-data at runtime, as the meta-data store doesn't contain locks on the meta-data as it's assumed read-only and created before anything happens in teh framework. If you register a meta-data model at runtime, it can lead to problems in multi-user environments.

Frans Bouma | Lead developer LLBLGen Pro