llblgen pro framework prefetch paths vs entity framework include

Posts   
 
   
 
Anonymous
User
Posts: 0
Joined: 11-Nov-2006
# Posted on: 28-Oct-2012 23:34:25   

Hi guys,

I currently use the llblgen pro framework with prefetch paths to load data but in my new job, I'll be using entity framework v 4.5 with include().

What features will I be losing? Or to put it another way, what are the advantages of llblgen prefetch paths over entity frameworks include()?

Cheers

Peter

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 29-Oct-2012 09:16:29   
  • Include works with strings, not typed objects. There are some extension methods available which allow you to perform Include with lambda's but it's not ideal.

  • Include produces horrific SQL. EF uses joins to create 1 big query to fetch the entire graph. This quickly ends up in a big mess and you'll learn soon enough when you inspect the queries being generated. Our prefetch paths produce 1 query per node and are self-tuning (so produce IN queries if parent node has less than X elements)

  • Include has no way to filter, sort, limit the elements being fetched and doesn't offer any exclude/include fields feature.

Recently some guy, Richard Hopton, created an even easier prefetch path api for us, for Linq to LLBLGen Pro: https://github.com/richardhopton/LLBLGen.Linq.Prefetch/

So in short: EF with Include... you're not gonna like it wink

Frans Bouma | Lead developer LLBLGen Pro
Anonymous
User
Posts: 0
Joined: 11-Nov-2006
# Posted on: 29-Oct-2012 12:18:21   

gulp ... somehow I just knew it wasn't going to be good news.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 29-Oct-2012 15:22:40   

Yeah, sorry I had to bring you this news... perhaps your team leader will get fed up with it as well and you can make the switch to a better framework wink

Frans Bouma | Lead developer LLBLGen Pro
Anonymous
User
Posts: 0
Joined: 11-Nov-2006
# Posted on: 29-Oct-2012 15:31:38   

lol ... lets hope so - I'll certainly carry on using LLBLGEN for my own stuff. I'll finally have a chance to learn queryspec. Unless of course you recommend using LINQ.

Pete

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39614
Joined: 17-Aug-2003
# Posted on: 29-Oct-2012 18:03:13   

Queryspec is more flexible, but in some cases linq might be easier. You can use both in your code, at the same time, so just pick whatever rocks your boat simple_smile

Frans Bouma | Lead developer LLBLGen Pro