Lately I've been spending some time trying to optimize the amount of time it takes to develop web applications. I've realized that it just takes way too much time to do tasks that are common for pretty much every project I work on. Number one on the list has got to be creating a good data layer for an app. My last big project used LINQ to SQL on the backend and I was very happy with how that turned out. The only big complaint I had was that my changes would always get overwritten whenever I refreshed the DBML. I also had some smaller issues with the lack of support for many-to-many relationships.
Well here we are, almost a year and a half after Microsoft acknowledged that they were done with LINQ to SQL in favor of Entity Framework and I am still not seeing anything tangible that EF provides to me over LINQ to SQL. I can see what it brings to enterprise developers with big clunky apps supported by many developers, but I need something lightweight that just works, and that's what LINQ to SQL is for me. Now just imagine what L2S could be if MS had invested that time in updating the LINQ to SQL tools and language.
Well my friends, I'm happy to say that we don't have to imagine, because we have PLINQO! PLINQO is an amazing set of templates for the CodeSmith code generation tool. PLINQO examines your existing database and not only auto-generates an excellent strongly typed LINQ to SQL-based data layer in seconds, but actually enhances LINQ to SQL with some amazing extension methods. Here's just a partial list of what I love about PLINQO:
- Automatic support for many-to-many relationship (very cool!)
- Auto-generates extension methods for filtering by keys and indexes, including non-equality operators!
- Caching extension methods for dead simple caching of queries
- Generates a nice business layer with a very slick business rules engine
- Future queries feature for batching multiple queries to a single database call
- Want to change or enhance the generated code? Just edit the templates to your heart's content!
- And I saved the best for last: your DBML changes are NOT overwritten when you regenerate!
I have to say, I'm amazed at what can be done with CodeSmith. I'm going to have to spend some time looking into what else I can generate with this great tool. I should have a lot more time to do that now that I've found PLINQO :-) .
I was extremely disappointed when I heard that Microsoft was basically abandoning LINQ to SQL. I felt forced to move on to other solutions like nHibernate. Now I see that LINQ to SQL is alive and being supported and improved upon as well or possibly better than Microsoft itself would've done. Thank you PLINQO!
P.S. If you are a fan of LINQ to SQL or even just a fan of working smarter not harder, then you at least owe it to yourself to commit 4 minutes and 8 seconds to watch the intro video on PLINQO.com.