Hanalei, Hawaii Tuesday, February 09, 2010

SubSonic: 2.1 Beta Is Up

Eric and I have been going full-speed to get this next rev of SubSonic up, and with a LOT of your help we've got a beta ready for you. You can download it here.

Eric and I have been going full-speed to get this next rev of SubSonic up, and with a LOT of your help we've got a beta ready for you. You can download it here.

SubSonicSMall

Breaking Changes There are none, w00t! Or, well, there shouldn't be. If you find some do let me know :).

A New Query Tool We have a new Query tool that lives happily alongside our existing one. Our goal with it was to make it as "Fluent" and "SQL-y" as possible. I wrote a post on how it works here, and updated that post here. Please refer to that until can crack out the docs which, yes now that this is my job, I will be spending a good amount of time on.

    Northwind.CustomerCollection customersByCategory = new Select()
        .From<Northwind.Customer>()
        .InnerJoin<Northwind.Order>()
        .InnerJoin(Northwind.OrderDetail.OrderIDColumn, Northwind.Order.OrderIDColumn)
        .InnerJoin(Northwind.Product.ProductIDColumn, Northwind.OrderDetail.ProductIDColumn)
        .Where("CategoryID").IsEqualTo(5)
        .ExecuteAsCollection<Northwind.CustomerCollection>();

Hello, SubStage

Eric and his secret little project are ready to see the light of day. I'm not sure how to categorize this thing, other than to say it's a SubSonic Geek's Best Friend. It's part IDE, part Help Resource, Part Config tool, part Validator. Eric's working up a screencast on it now (link to follow) and here are the highlights:

  • Load your Web(or App).config and it will load your Database up, with settings
  • Work with a GUI when setting your provider bits. Not sure what to use with that naming problem? SubStage will help.
  • Validate your DB according our conventions, and see when you have problems right up front. Eric's built in a complete validation system so if you don't have a Primary Key on a table, you know it up front.
  • View your object's by Table or Class view. All of your naming and provider settings will be viewable when using our Class View - this way you'll know your API before it's generated.
  • Generate your DAL using SubStage. Once you have everything set just so, generate the files then drag them from the SubStage Explorer window right into your project
  • Work with your data. Eric build a frickin web server into SubStage, and wraps an AutoScaffold around your database so you can, literally, work with your data using our scaffold right there.
  • Help... lots of Help. Access our API reference and Forums online, right through SubStage - we're trying to make this easy for you... can you tell?

Here's what it looks like: substage

Tons of Bug Fixes We fixed so many issues that have been reported that it's going to take me 2 days at least to document them all. Of major import are:

  • We now support partial object loading - you don't need to load the entire object if you don't want to.
  • We've changed Update() so it only updates the changed columns - no more wholesale updates.
  • Implemented the RepositoryPattern, and with it, the ability to declare your own base class. This is a biggie as many people don't like ActiveRecord. See my posts above about the RepositoryPattern and how to access it.

Your Feedback Is Critical

I wanted to get this beta out the door so we can crank the next version out as soon as possible. This will be the last point release for .NET 2.0 (we're moving to 3.0 with the next rev) and I'd like to get it as stable as possible. If you find any bugs, or have any questions, please post them here. Your Support Is Always Welcome Many people don't know this but every donation I receive I push back down to our contributors - most notably Eric Kemp. I am getting paid for this stuff so if you want to show some love to the contributors (beer money, whatever), your donations are very welcome. Larry Beal, Gavin Joyce, Damien Guard, Phil, Jon - all of the forum's moderators - these guys work hard on their own time. Please don't take this as solicitation - not at all. Some folks have asked what they could do, and honestly the simple things, like some extra beer money, go a long way :). Shwag With Jon Galloway's and Eric's help, I loaded up some SubSonic artwork to CafePress today and we now have shirts and mugs. If you want some shirts or a mug (all of this goes to contributor's as well) it's here for you! I am going to bring some shirts to MIX 08 as well - I hope you're going!


Jeremy - February 1, 2008 - Sweet !!
Chad Myers - February 1, 2008 - Rob, Cool stuff. We're looking at starting to use Migrations at work, I'll let you know how it goes. I don't know if Migrations is part of SubSonic proper (and this release), but either way I'll let you know how it goes. We have an interesting situation at my current gig, so we should put it through the wringer and a few other medieval torture devices by the time we're done.
Rafael - February 1, 2008 - Great!

Nice timing so I can play with it over the weekend
Duckie - February 1, 2008 - I am going to move my project from 2.0 to 2.1 asap. I guess no last minute syntax-changes after this release? :-)
Zack Owens - February 1, 2008 - Oooo this is exciting stuff. Time to play (and break ;) ) SubSonic 2.1!
Steven Harman - February 1, 2008 - Hey buddy... were you able to figure out a testing story for the Repositories? Perhaps doing away with the static nature of them and instead make them instances, w/interfaces, so they could be shoved into and IoC container? I don't think we'd want to include an IoC container out of the box b/c some ppl might want to use StructureMap while other prefer Windsor or Spring.NET. I think the right thing would be to enable folks to choose whats best for them. Just some thoughts as they fall out of my head. :)
Stuart Allen - February 1, 2008 - That's some nice stuff there... SubStage is going to be awesome, can't wait to try all this out!
John S. - February 2, 2008 - SubStage RULES. Absolutely awesome work guys.
tony testa - February 2, 2008 - Can't wait to try out the new features! Props to you guys for all the hard work.
vincent - February 2, 2008 - Started out trying SubSonic 2.0 a couple of weeks ago, to find out if it could help. Of course it did. And now I briefly had the chance to immediately compare what I've learned the last couple of weeks, with what's new in this release. One word: awesome. RepositoryPattern : amazing. New query tool: so much more natural and less, uhm, confusing. In the current stable release, different ways of selecting/querying caused confusion (now I'll do a new Product(1); right, now I need a ProductCollection().Load(); ah, now I need to build a query thing). The new query tool is very strong, very natural. Almost Linq-like, a similar instinctive syntax. I'm right now only wondering if there's a Where("Username").Equals(username) somewhere, instead of the Where("Username").Like(username) but I'm sure I'll find out. Great great work. Thanks. I'm gonna donate later today. It's the least I can do.
NorthernMonkey2000 - February 2, 2008 - We are not worthy.
So Cool
ESICO - February 2, 2008 - What else do we need? :-)
Tom Lynch - February 2, 2008 - Vincent - you can do that like this - Where("Username", username)
Charles Nurse - February 2, 2008 - Rob - what happened to the Migrations? Is that in 2.1?
Rob Conery - February 2, 2008 - Hi Charles - they will be 2.1 and are almost there. When I saw Eric's substage it got me thinkin... :)
Tiago Soczek - February 2, 2008 - Awesome! I will start migration of my projects to the new version now! ;)
Mr. Furley - February 3, 2008 - Good stuff. One question, which is a stupid one and I know it. So if you have a stupid answer thats cool with me.

Q. What does, "All Your Database are belong to us" mean? It just reads funny.
adminjew - February 3, 2008 - @Mr. Furley http://forums.subsonicproject.com/forums/p/875/10492.aspx ----- and the logo on top of the page is called "subsonicsmall.png" then what is a big logo?
C.A. - February 3, 2008 - great stuff - thanks! I'll be at Mix - you'll have to let me buy you a beer. :)
Cornel - February 4, 2008 - What is subsonic? A link or something? Thanks
adminjew - February 4, 2008 - @Cornel http://subsonicproject.com :)
Lance Fisher - February 4, 2008 - Congratulations! I'm looking forward to checking this out. I'm really looking forward to playing with migrations when those are up too.
Igor - February 5, 2008 - I moved to the new version and the issue of Medium Trust level has come back.
Saving entities EntityName.Save() the SecurityPermission exception is thrown :(
kevin - February 7, 2008 - hot damn!@ nice work guys. 3 cheers!!!
Ben - February 7, 2008 - Sweet!!! I just ordered a shirt!
C.A. - February 8, 2008 - Igor- This is a brute force hacky change, but fixes the issue for me while we lovingly wait for Rob and team to rev the code: Rob - please feel free to slap my hands on this one. ;) in [INSTALL DIRECTORY]\src\SubSonic\Utility.cs comment out the body of the method: public static void WriteTrace(string message) lines 38-51 Compile from the src directory and use your custom build in the meantime.
Willie Tilton - February 14, 2008 - Hey Rob, Is there a tutorial or walk through someplace that tells us how to get SubSonic working with ASP.NET MVC? I've searched and found the sneak peek (http://msbluelight-0.agappdom.net/e1/d/16445/38/63338616000/0.mPkA_NMOqha_gQ6VmSMsowbnyx8/zziframehtml1zz.html#/StartWithParent/appId/////////1.0/6/MicrosoftAjax.js/BasePlayer.js/PlayerStrings.js/player.js/StartPlayer.js/Silverlight.js), but trying to piece together how to setup everything up from quick pausing the playback isn't working. I can probably try to write something up after I sludge through something but I'm not really the "authority" behind this stuff, so probably won't be as helpful.
Rob Conery - February 14, 2008 - @Willie: this isn't our MVC stuff per se, just a rev of good old core SubSonic. It works with MVC just like it does a normal site :).
Willie Tilton - February 15, 2008 - No, I understand that. I was just looking for anything that might show me the "way" to setup SubSonic within the ASP.NET MVC stuff. Within your sneak peek you're throwing commands to sonic.exe that I've tried and it won't work - like migrate. Also, when I generate the objects it's also creating Controllers within the same folder that aren't quite MVC controllers. Again in your sneak peek, the controller class isn't created. Are you setting a switch someplace, or using a different exe? And thanks, I've watched the video so many times now I have the music playing in my head. Great :P
Tim Marman - February 19, 2008 - Any sense on when we might get a new compiled release? I tried upgrading but ran into the issue with the Primary Key in views (which I think has subsequently been patched), but had trouble grabbing the source code out to compile myself yesterday. (Going to try again from a different machine)
Robsworld - February 20, 2008 - Hi there great release and thanks for such a great tool, I have a couple of questions: 1) "We now support partial object loading - you don't need to load the entire object if you don't want to." Is that lazy loading? wasn't this supported in prior versions? using "GenerateLazyLoads" or can you do it per request now? 2) Where can I find release notes for all changes made for this version? Regards Robsworld
Gecko