Brian's Blog

items I see across my tribes

Save Time, get PLINQO

August 05
by briancarter 5. August 2009 23:10

PLINQOI’ve used many code generators over the last few years.  I like LinqToSql but after using ADO.Net Entity framework, working with business entities is a must!

As mentioned I had moved to LINQ to SQL from EF a short time ago, primarily due to issues surrounding the use of detached entities and passing entities around an N-Tier design; also the issue with relationships. LINQ to SQL out of the box didn't fully support what I wanted to do but it was more manageable than EF.

Enter PLINQO. PLINQO ( Professional LINQ to Objects ) is a set of CodeSmith templates that wrap and extend LINQ to SQL functionality. This has been a huge timesaver for me, I have been using PLINQO for only a week now and it has already saved me a ton of time. Right off the bat you get full support for Entity.Detach and Entity.Clone is compelling.  EF 4.0 appears to taking a similar approach.

After a few simple installation steps I was up and running with a full working solution generated for my Sensor Deployment Framework database. You can watch the intro videos – but trust me, make sure you set the QueryPattern to “ManagerClasses”.

image

Nice – working with the CodeSmith tool, PLINQO generated an Entities folder with classes mapping to my database tables.  My favorite, a Managers folder with [ClassName]Manager.cs files for all classes.  This follows a pattern I have used for many years and this alone will same me some much needed time.

There are some performance enhancements over basic LINQ to SQL too. PLINQO provides support for batch updating and deleting, effectively eliminating performance killing round trips to the server. The PLINQO generated DataContext also offers an overloaded ExecuteQuery method that lets you execute as many queries as you want within one trip to the database. This can save significant amounts of time if you have many queries that you need to perform one after another.

Stay tuned, I’m going to do some performance testing of the Query Result Cache and see how it holds up under a load.  I’m going to put this collection of generated code and the framework to the test over the next few weeks.

Thank You for listening.

Categories: Development

Comments

10/13/2009 7:05:50 AM #

Like your writing! Still you can do some things to improve it.

lilBenjamin United States

7/13/2010 11:03:33 AM #

The PLINQO provides support for batch updating and deleting, effectively eliminating performance killing round trips to the server.

certificate training and assessment Australia


 Questions or Feedback, my contact information is located on my About page.


The opinions, thoughts, and comments made in these blog posts are solely my own (unless otherwise stated). They do not reflect the opinions, thoughts or practices of my employer, my universities, my family, or anyone else. Also, I retain the right to change my mind about anything I publish here without having to go back and edit posts that occurred in the past. 

These are my opinions, or just as likely, someone else's opinions that I leveraged for my own.