Jim's Blog Ramblings about novels, comics, programming, and other geek topics

19Aug/09Off

SubSonic 3.0

Google AdSense

I've used SubSonic 2.x for a while and I've blogged about how useful it was as a tool to aid my development projects. A few weeks ago, SubSonic 3.0 was released and I hadn't spent much time reviewing the updates and changes to version 3.0 until this week.

At the present, I have several large projects using SubSonic 2.x and I have a new smaller project starting this week. So I decided to download and install SubSonic 3.0 and use the small project to get familiar with the updates prior to updating my other web sites from 2.x to 3.0.

This article and code examples are based on my first impressions of SubSonic 3.0.0.3 with respects to the ActiveRecord implementation.

 

Downloading & Installing

At first glance, I was completely confused by SubSonic 3.0. The easy to use and intuitive SubCommander was missing and the previous way of generating database class files was completely gone. After spending some time, I learned that I need to use the new T4 templates to generate my code and run the "run custom tool" command on the .tt files to generate the classes.

Note: The new requirement of using T4 templates for generating the database class files make SubSonic 3.0 (using T4 templates) completely unusable for all Visual Studio Express users. You need to configure Visual Studio Express to use T4 files.

 

Generating my DAL

When executing the templates, it generates all of the class files within the ActiveRecord.cs file. So the good old days of just right clicking and "excluding" the class files that you didn't want was gone. Now, if you need to exclude a table, you'll need to go through and update the Settings.ttinclude file. This is a minor annoyance, since I prefer to do as little customization and configuration changing as possible.

I do think the 4T templates are a bit more intuitive than the previous way SubSonic 2.x used ASP.NET web pages. However, I still prefer having one class per file even with auto-generated class files.

 

Naming Convention Change

The first thing that struck me and almost knocked me out of my seat, was that the incredibly cool naming standardization between my database and programming code was gone. In SubSonic 2.x, I could use my standard database naming convention and my standard programming convention and everything worked. Now, that's gone, too.

For example, if my database table was named "my_table", then SubSonic would translate this to "MyTable" class name. In SubSonic 3, the class is named "my_table". This also applies to all object (table, field, stored procedure) names.

So for all of my existing implementations, I'm going to have to choose to recode my entire projects or change all of my database tables, views, fields, and stored procedures names.

 

How to fix the Naming Convention Problem

You should past the below code into your Settings.ttinclude file where the existing CleanUp method exists. If you use symbols other than underscore, dash, or space in your database naming conventions, then just update the statement assigning the delimiters.

string CleanUp(string tableName)
{    
     string result = string.Empty;   	    	    	
     char[] delims = new char[]{ '_', '-', ' '};
     string[] parts = tableName.Split(delims);
     foreach(string part in parts)
     {
          string firstLetter = part.Substring(0,1).ToUpper();
          result += firstLetter + part.Substring(1, part.Length-1);
     }
     return result;
}

Generating Views

To my surprise, there's no support for views in SubSonic 3.0.

After digging through the code, I've found where to update the .tt files to get the SQL needed to generate classes for views, but it appears that the SubSonic.Schema.DatabaseView object doesn't exist. I'm assuming that this class would set the TableType to TableType.View and remove things like PK and FK properties. It also doesn't make much sense to me to putting the TableType enum inside of the DatabaseTable class, so it appears that there's been no thought to implementing the DatabaseView class.

Note: There's a post at StackOverflow showing how to load views as a SubSonic table, but note these classes will think they are table and not view types.

 

Fetching Record By Primary Key

There's two methods that I used throughout all of my projects. These two methods are probably some of the most common methods that you might be using in SubSonic 2.x. Unfortunately, neither of these methods exist in SubSonic 3.0.

The first method is the FetchById method which returns a record by passing in the primary key value. The new method that replaces FetchById is called SingleOrDefault and requires using a Linq expression rather than just the primary key. For a comparison between 2. x and 3.0, see the two code examples below:

  • SubSonic 2.x:
        
    MyTable.FetchById(0);
  • SubSonic 3.0:
        
    my_table.SingleOrDefault( x => x.my_table_id == 0)

If you were like me and had successfully avoided Linq in the past, there's no way to avoid it with SubSonic 3.0.

 

How to add in the FetchById Method

You should paste the below code in the ActiveRecord.tt file near the SingleOrDefault methods. This method will automatically generate the Linq syntax for you, so your existing FetchById method should still work and it will save you a lot of recoding time.

public static <#=tbl.ClassName#> FetchById(<#= tbl.PK.SysType#> keyValue)
{
     return SingleOrDefault(x=>x.<#= tbl.PK.CleanName #> == keyValue);
}

 

Fetching Records By Parameter

The second most used method in my projects is FetchByParameter. This method queries the database using a specified field and value. Since this doesn't exist, You'll need to recode all of these statements to use the Find method using Linq syntax.

  • SubSonic 2.x:
      
    MyTable.FetchByParameter(MyTable.Columns.MyField, "test");
  • SubSonic 3.0:
      
    my_table.Find( x => x.my_field == "test")
How to add in the FetchByParameter Method

You should paste the below code in the ActiveRecord.tt file near the Find methods. This method will dynamically generate the Linq syntax for you, so your existing FetchByParameter method should be easier to migrate to SubSonic 3.0. To finish this method, you should probably add in the Comparison types (greater than, less than, etc.). This example code only uses Equals comparison.

public static IList<<#=tbl.ClassName#>> FetchByParameter(
     string columnName, object columnValue) 
{            
   ParameterExpression tblExpress = 
     Expression.Parameter(typeof(<#=tbl.ClassName#>), "x");
   MemberExpression leftExpress = 
     MemberExpression.PropertyOrField(tblExpress, columnName);        
   Expression rightExpress = 
     Expression.Constant(columnValue, columnValue.GetType());
   BinaryExpression binaryExpress = 
     MemberExpression.Equal(leftExpress, rightExpress);
   Expression<, bool>> expression =
      Expression.Lambda<, bool>>
         (binaryExpress, new ParameterExpression[] { tblExpress });
   expression.Compile();			 
   var repo = GetRepo();
   return repo.Find(expression).ToList();
}

Stored Procedures

Executing stored procedures seem to not work when you need to return a value. I still haven't figured out how to get SubSonic 3.0 stored procedures to properly return values. Executing a stored procedure works just fine, but I just can't get any stored procedure output values. Note: John helped me work through this. It just didn't work as I had expected.

 

Strongly-typed Collections

The strongly-typed collections (the classes named "MyTableCollection") are gone and replaced with IList<MyTable> implementations. Both are similar, but using MyTableCollection allowed you to use partial classes to add in additional methods or override methods.

You'll have to update the tt files to change all of the methods that return IList<T> values to a custom collection class name to emulate the same functionality as SubSonic 2.x. If I had more time to spend on recoding previous features of SubSonic 2.x, then I would probably have to recode this feature next.

 

SubSonic Community & Documentation

The project's forum is now gone, so getting questions answered is much more difficult. There's also almost no documentation on the new version (example of great 2.x documentation is at SubSonicHelp.com). Most of it is easily understood, if you come from the SubSonic 2.x background. Not having access to a community forum to post questions or search for answers and very little documentation pages makes trying to use the new version much more difficult than it should be.

Note: StackOverflow is now the recommended outlet for SubSonic discussions and Q&A.

 

Overall Impression

As it currently stands, it's nearly impossible to implement SubSonic 3.0 in the same manner as version 2.x. SubSonic 2.x was a great and easy to use utility, but with the current version, I can't easily migrate my knowledge and existing code snippets.

The great thing about SubSonic 2.x was that most of the work was done for you and you just needed to customize your DAL using partial classes. I didn't need to worry about the DAL and I could just focus on my coding. Today, I've spent more time trying to get SubSonic 3 to work like SubSonic 2, understanding Linq, and re-coding all of the functions of SubSonic 2 than coding on my actual project. Maybe, some of the time spent (or invested) in this non-coding research will turn out to be useful in the future.

I'm a bit disappoint with this release. It feels like there's not a clear migration path for how existing 2.x user-base can easily migrate their code to the new release. With all of the missing functions from 2.x and the new LINQ coding requirements for 3.0, part of me wishes that SubSonic 3 would have forked off and become another project to focus on Linq.

As of right now, all of my corporate projects use SubSonic 2 and I'm not going to move away from SubSonic. It's still the best ORM that I've researched and found. I have one small corporate project that I'm trying to use SubSonic 3.0, but so far the I'm failing miserably at doing even the simplest of things that I did in SubSonic 2.x.

kick it on DotNetKicks.com

James Welch

James Welch is a software engineer in Vermont working for a large information technology company and specializing in .NET. Additionally, he holds a Master’s Degree in Software Engineering and a Bachelor of Science Degree in Computer Science. Jim also enjoys local craft beer, comic books, and science-fiction and fantasy novels, games, and movies.

Twitter Google+ 

Comments (35) Trackbacks (1)
  1. The move from 2.2 to 3.0 for ActiveRecord does appear to be rocky as you described.

    If you were using 2.2 with RepositoryRecord and use the 3.0 LinqTemplates, it’s not much of a jump. I successfully updated my repositories for managedassembly.com in about an hour.

    I haven’t had any issues with return values for Stored Procedures. Care to elaborate?

    I do miss support for views. I hacked around it by creating simple DTO classes that match my view schema, calling the view from a sproc, and using ExecuteTypedList() on the results from the sproc.

    If you couldn’t easily roll back migrating to 3.0 to your old 2.2 code, you should reconsider your source control strategy.

    There are far more docs now than there ever have been: http://subsonicproject.com/docs/Main_Page

    Questions posted to StackOverflow almost always get responses and a resolved answer. There’s a Google Group for discussion: http://groups.google.com/group/subsonicproject?hl=en

    You’re also welcome to contribute to the project.

    I’ll be using 3.0 on all new projects, but the projects I have with large 2.2 codebases will stay on 2.2.

  2. I haven’t begun the migration of my existing sites yet. I’m thinking of just keeping them with v2.

    This experience was based on making a new DAL for a new project. I’m having too many issues right now and it’s taking too long, so I’m thinking that I might just redo my DAL using v2. I could get it the entire site up and running using v2 in less than an hour or so. I’ve spent the better part of an entire day working with v3 and I’ve only scratched the surface. (I have my auto-generated classes, but my stored procs and views aren’t there yet.)

    I’ve also posted the example source code above and bugs to the GitHub site.

  3. Man this post pissed me off. I wrote a rather cranky response but… well what’s the point. James – you didn’t read our docs, you didn’t read the README that tells you what you need to do.

    You don’t get LINQ and you don’t get T4 – and that’s fine. Don’t use it – I really won’t mind. But don’t write a review about something you haven’t used and you don’t get. It’s not helping me AT ALL and in fact makes me want to stop doing this shit entirely.

    Just stay with 2.0.3 and stop writing reviews OK?

  4. 1) It was pretty clear from the start that SS3 was a complete, ground-up rewrite of SubSonic…not an enhancement/bug fix release of v2.x.
    2) v2.x is still available and can be downloaded and used just like v3.x is/can.
    3) StackOverflow.com is actually (in my experience) a much better support forum than the previous discussion forums were. There’s also the Google Group as John mentioned.
    4) Linq is not a new language, its a feature of the C# language. Learning it should be a natural progression for a C# developer. Its really not all that difficult.
    5) John also mentioned above the documentation. Had you taken the time to read through it, or watch some of the screencasts, you might’ve saved yourself a significant amount of pain.

    I spent about 5 minutes watching a screencast, about another five minutes reading through the ActiveRecord documentation on the web site, about two minutes setting some values in a couple of config files, and was up-and-running with an SS3 model in less than 15 minutes. I can HIGHLY recommend SS3.

  5. Wow, you really didn’t pay any attention to any of the info on SubSonic 3 did you? It was a totally different take on data access. I loved SS 2 and if I had to only work on .Net 2.0 projects, but SS3 offers a much richer way to do things now.
    Also so you say SS3 won’t work if you use VS Express. WRONG! The simple repository allows you to work in a very POCO way and is a much better learning tool than starting at the db end.
    No documentation? Damn man, did you not check the website? Rob’s posts? The screencasts?

  6. @Rob,

    I’m still a fan of SubSonic and I’ve blogged about how wonderful SubSonic is and how easy it is to use.

    I get LINQ and I don’t have a problem with LINQ. I just really loved my two favorite methods (FetchById and FetchByParameter) in v2 and was a bit shocked to find them missing in v3. I posted code above showing how to implement these missing methods and I also posted the same code to the github site.

    This was the first time that I used 4T – but I get that too. I posted that I actually like the 4T way of generating class files better than the way we did it with v2. It’s much cleaner and easy than updating those ASP.NET files.

    The real point of the post was was to show that the ActiveRecord portion of SubSonic 3 needed a bit more love. The things that I took for granted in v2 were missing and left me a bit frustrated when trying to get a project done in a short time frame.

    Maybe, it’s just my fault for thinking that since I was familiar with v2 that I could just leverage that knowledge and jump into v3. Sure, I figured there would be newer stuff that I didn’t see in v2, but I hadn’t expected there to be somewhat less features or at least less in regards to how I’ve implemented SubSonic in the past.

    And, sure I probably rushed out this post in a bit of frustration after spending more than a day with v3 and still hadn’t gotten everything working. The next day, I went back to v2.2 and finished the code for this new project in an half-hour with everything working exactly the way I wanted it.

    For almost all of the things that I didn’t like about v3, I’ve posted code snippets showing how to implement v2 methods. There were only 2 other problems that I blogged about and John helped me work through the one in regards to the StoredProcedure and the other one is in discussion in the github site.

  7. @Bob

    3) I still miss the forums. I’ve been using StackOverflow for SubSonic related questions.

    4) I know LINQ is not a new language. I wrote a dozen pages covering LINQ for a research paper several years ago. I understand how it works and the benefits of it. I don’t care if SubSonic uses LINQ in the backend or not. I just preferred the v2 ActiveRecord implementation that didn’t require me to use Linq.

    I’m a corporate developer and not a C# developer. Although, most of my projects are in C# and that is my preferred language. I have to code and maintain several different projects in various languages and frameworks. I still get confused between class and method names when flipping back and forth between applications. I’d just prefer to not use LINQ, if I can avoid it.

    I understand it’s not difficult. As you can see from the code snippets and post, I didn’t have any problems with LINQ syntax.

    5) All of the streaming media is blocked on my corporate network, so I didn’t see any of the screencasts while I was working. I did read through most of the documents, but for the above issues that I discussed there’s not much said on them.

    I also got some generated classes in a matter of minutes (after spending some time reading about 4T files). Coming from someone who’s used v2 for a while, I came in with expectations that v3 would have the same things that I took for granted in v2.

  8. @Kevin,

    I never said that SubSonic 3 wouldn’t work with Visual Studio Express. I said that you can’t use 4T files with Visual Studio Express. If you can use 4T files with VS Express, then please let me know and I’ll update the post.

  9. @Rob, woah there, can’t take some criticism?

    He brought up valid concerns and from his post understands t4 and Linq just fine.

    Limited backwards compatibility. Whats 4.0 going to be like? I can’t use an ORM when a developer switches gears every major release.

    Docs? What docs? Tome is a piecemeal collection of 99 level starter tutorials.

    Maybe instead of acting like a real jerk in your comment you could have offered to help?

    Your comment was really not cool and has removed Subsonic from my bag of ORM tools that I’m exploring. The “lead” of a tool I use threatens to quit when he gets some bad press? Welcome to the internet, life? Yeah, I’ll drop my eggs in that basket…

  10. @Jim

    Google “subsonic express site:stackoverflow.com”

    Returns http://stackoverflow.com/questions/786734/subsonic-asp-net-mvc-sample-in-visual-web-developer-express

    Explains how to use the T4 template using express. Pretty straight forward.

  11. @Rob,

    Like John i was quite surprised by the response.

    He has expressed his concerns in a valid way which can be very interesting for someone else going from 2 to 3.

    And compatibility between projects is a big concern for some.

  12. @John Farrel:

    This isn’t criticism – there’s nothing I can do to have James read the docs before writing a post that’s gets kicked and rekicked by the guys who would rather you pay for your ORM.

    As for the rest of it – you clearly don’t know me very well. Don’t let the door hit ya…

    @Chris
    I understand the back-compat stuff. I work for a company that lives and breathes it. He has concerns, yes. He blogged them quite loudly…

  13. @Jim, @John, & @Chris:

    I don’t think Rob’s off base here. He’s just released a new version of an open source project taking advantage of the latest language features and given it away for free. If I recall correctly, most people develop OSS for themselves first and for others second. There really is no such thing as a “customer” in OSS, just devs and users. So slamming something without reading the documentation and seemingly ignoring the fact that Rob’s noted this thing is a clean break is completely negligent and ridiculous.

    1) How could you possibly think that you would be able to just easily roll on over to the new version when it was announced it was a fresh start with a new approach? Really?

    2) Showing how to bridge the gap is a helpful exercise and one that I’m sure many would appreciate. How about contributing that documentation instead of whining? It wasn’t in the plans (see item 1).

    3) Corporate dev vs C# dev. So you don’t code in C#? Why are you using SubSonic? (Yes, I know you don’t mean that, but you said it, not me.) If you want to play that card, then I’ll ask how you are past .NET 1.1?

    Rob spent some major hours on this thing and came out with something really excellent. How about comparing it with LINQ to SQL or Entity Framework? I’d love to read those reviews…

    • @Ryan,

      2) That’s somewhat what I’ve tried doing here. I posted all of my code snippets (here and github) in hopes that others can find use for them or maybe get merged into the next release.

      3) I’m happy to report that I finished my final (that I know of) v1.1 to v2.0 migration last year. I didn’t tell anyone that I was recoding it until I was already finished – I think that’s the secret to upgrading corporate apps. We’ll also be officially moving from MSIE 6 to MSIE 7 by Q1 2010 :)

      I’m still a fan of SubSonic v2.x and will continue using it and blogging about its greatness. Just because I didn’t get a good first impression from something doesn’t mean that I’ve completely given up on the entire SubSonic project. If I had more free time, then I would code all of the stuff that I want into the templates and publish the rest of the code.

  14. I’m starting to understand why DHH said, “F*** you!” to a bunch of Rails developers. :)

  15. I’ve been using Subsonic back since version 1 and it still is my favorite above other ORMs.

    I was confused by how it changed considerably from v2 to v3 too, but like someone already mentioned in the comments, the fact that it was a complete re-write was clearly stated, and you can always go back to steady v2.

    Your blog post was good, but I think it would’ve been great if you had kept the disappointment to yourself and just stated the technical comparison, the lacking methods etc, and just the way you did, the solution on how to add/include most of the missing stuff.

    While I don’t completely approve of Rob’s reply, I can certainly understand him. There’s always a better way to say things, and maybe he was just having a bad day. I mean, he dedicates his personal time to do this stuff and saying things like “I’m completely disappointed” aren’t a really nice way to say thanks. I’d go with the old saying “if you don’t have something good to say, then say nothing”.

    • @Gabriel,

      I agree. I’ve only used SubSonic since 2.0 (2.1, 2.2) and it’s still my favorite (v2.2).

      If I had to post it over again, I’d leave out the last part about my overall impressions. I think that’s the bit causing the uproar and it’s certainly not what I intended or expected.

  16. Hey Jim – sent you an email earlier… let’s get on Skype tomorrow and I’ll show you some cool things you can do, and you can tell me what to add to the project site to make it more apparent.

    Sorry for getting cranky – I’m a tad stressed out and I shouldn’t read blogs at the end of the day. With respect to SubSonic and criticism – I crave it – as long as I can do something with it.

    Cheers – and thanks for the writeup – apologies again for being grumpy.

  17. A lot of these criticisms seem to stem from a lack of understanding of the point of the project.

    I’ve assessed Subsonic 3 and I did indeed find it lacking, but understood that

    a) The T4 templates would make it easy to add what I wanted to the project – I could then show other people like you have above and maybe get them added to the core project

    b) Some of the more complex stuff is… well complex and if I want it in there, I can add it myself and submit back to the project

    My wants were a little more than these basic ranty/complaints

    1) Certainly, output parameters in stored procedures ala Linq2sql would be nice. The easy solution here is to look at Linq2sql in reflector and see how they do it
    2) More pressing, returning your own POCOs when performing a select query would be *great*

    ala:

    from x in MyTable
    select new MyClass()
    {
    Id = x.Id,
    Name = x.Name
    };

    (Obviously with joins this becomes more useful)

    Currently, having looked through the code, I can see that this is achieved currently by doing simple property mapping by name whenever the system comes across a user-created POCO that isn’t either primitive or anonymous.

    This can be achieved again quite simply by looking up the Linq2sql implementation and solving accordingly

    It would be nice to have the ability to generate update queries too, but I can see how this would be easily added.

    My view of the project that it was a wonderful framework to start building on top of and augmenting with good functionality.

    Getting an early release out allows us users to evaluate it and calmly suggest improvements (and even make them ourselves). Rant posts like this don’t seem that helpful towards that cause.

    I can see that there is a bit of a knowledge gap after reading some of the code, and I can understand why – writing a Linq provider is quite a challenging topic, and I think Rob’s done quite a good job of laying down the foundations for it.

    Me? I settled with NHibernate in the end as I wanted a proper entity-mapping solution, but I fully intend on using Subsonic for a few of my simpler RAD projects once the changes I want have either been made by myself or somebody else.

  18. @Rob Now thats the easy going, evangelistic Rob that made me fall in love with SubSonic.

    I myself must add that i’ve just started projects in 3 and agree with alot of what was said above about the switch – not that it is the end of the world, but i wish there was more docs like this out there so before you get into it you can “read” a subsonic 2-3 review.

    It was very clear to me that i had to use linq – but at the same time i felt that there wasn’t as much “sugery” (robs addage not mine) cool method goodness.

    not everyone is a linq god, and therefore not having as many “push . ” easy to find methods to explore has made my development with 3 a little slower. I do love linq, but sometimes really miss the .this().Is().ACool().Way() to write expressions that subsonic had before.

    Still love Subsonic with all my heart and am happy to say as a senior dev at work i have got the whole company to have a cult following (60+ devs here use it everyday for nearly EVERYTHING) – i wish more people helped Rob out as my work schedule sadly holds me back.

  19. Rob,

    I agree with this post. I think subsonic 2.x was better then LINQ (linq to sql) and I think while LINQ may have it’s advantages with collections, for DB stuff I always found subsonic far superior.

    The field is getting caught up in the 3 technologies per week that MS releases, and forgetting the core basics. The truth is subsonic 2.x could be setup in a project in 2 minutes.

    And subsonic 2.x still had a lot of bugs that could have been fixed. Instead you scrapped it for basically a linq helper utility.

    But this is all your work and its for free, so I appreciate you either way. But this is just one mans opinion

  20. One minor nit which is unrelated to the SubSonic critique…

    I wouldn’t consider “my_table.SingleOrDefault( x => x.my_table_id == 0) ” to be LINQ syntax. It’s code which uses the LINQ / IEnumerable class, but as I understand it LINQ syntax generally refers to using the LINQ language feature:

    from my_table where my_table_id == 0 select my_table_id

    I while it’s only syntactic sugar, I believe that using the LINQ syntax makes it much easier to read, and thus to learn and maintain.

  21. @Rob,

    Your first comment was such a douche thing to say man. I love SubSonic and I love your blog. But I was completely shocked at the way you reacted to this post. He didn’t trash SS3. He just explained, in very polite manner (no cussing or swearing) about his difficulties in making the migration. It was nothing personal.

    Thank God, I continued to scroll down and read all the comments. That’s when I read your apology. Takes a great man to do that in a public forum, especially since you are already so popular. It shows you have no ego.

    And that’s pretty cool and admirable. And i’m back to being your fan again.

  22. @Matt: You don’t make the distinction between LINQ and LINQ to SQL. They are not the same thing. From your post it is apparent you don’t understand the distinction. SS 3.0 is not a LINQ TO SQL helper utility. It is (or I should say includes among many other things) a data access utility similar to 2.2 with a LINQ (not LINQ 2 SQL) front end on it. This is a huge plus and it is a natural progression for the product. That notwithstanding I understand frustration when things aren’t backwards compatible, but there’s only so much time you can devote to that.

    But clearly calling 3.0 a LINQ helper utility shows a lack of understanding of what Rob has built.

  23. I can totally see why Rob reacted the way he did. Though I am glad in the end it all work out in the best interested of all party.

    This post highlight some problem with Migration from 2.x to 3.x. I think it should be incorporate into the wiki. With that said, I don’t believe in maintain backward compatibilities between major version, especially for an opensource project.

    Some thought should definitely be consider for user to migrate. Users should also be made aware of why the project is taking a new direction.

    But backward compatibilities shouldn’t become a major factor for a new version. Because it stiffen innovation and create unnecessary painpoint. If 2.x is working out great, what is the compelling need to upgrade?

  24. I agree with Firefly. It’s open source. There are no guarantees and no support agreements. It’s not like 2.x is dead. As long as some people continue using it, the community is the support. 3.0 is a new take. If you like 2.x but want new features, you are welcome to fork and continue adding to it or even commit back to the original.

    I’ve read others comments on this, but I think this is the unfortunate reality of so many things becoming open source. We’re all (me included) forgetting that it’s open source for a reason and want commercial quality docs and support. It’s not like the older versions are dead. Heck, I’ve had to work on .NET 1.1 apps in the last few years, so I don’t think a new version should cause so much consternation.

    I also think you are entitled to your opinion. It is just that in this case, the opinion was tied to things that were explicitly stated and known from the beginning, so complaining now just seems kinda silly.

  25. I migth sound a bit strange, but I consider SS 2.x and SS 3.x as completely different ORMs. This helps me understand that if I want to change from one to another, it will take some pains. This also helps me in admiring the beauty of both the projects and the hard work Rob has done to make them work. I find both of them to be awesome!!

  26. Wow, you’re really pissed aren’t you?

    Did you really expect a whole version number change to be nothing more than a tweak? The information about v3 stresses that it’s a complete rewrite with a change of architecture to take advantage of new stuff.

    Linq was not hidden, and is just about everywhere you look. It’s even being shoe horned in to places it doesn’t really add anything, just because having ‘Linq’ in the pack shot might bring a few more sales. If you really want to avoid it then why go looking for anything new at all?

    I jumped straight in at v3 and skipped past 2 (was there een a 1.0?) and although it means I have to climb the Linq and lambda learning curves while I climb the SubSonic curve I’m convinced the end result will be a benefit to me and the projects I work on.

    I’m all for reviews and critiques, but just panning something without anything constructive just comes across as sour grapes.

  27. @Brian,

    I expected a new version to have some sort of migration path for previous version users. When .NET 4.0 is released, I expect there’s a way for me to get my 2.x/3.5 code to 4.0 without recoding all of it. I think you’d expect the same. Whether or not the internal bits get completely rewritten, I was talking about the interface that I interact with the utility.

  28. It’s pretty obvious that I really failed at making my points. Several people got the underlying message, which was upgrading from 2.x to 3.0 is a bit harder than it could be. I made some poor use in grammar choices and posted some sentences under frustration that didn’t properly convey my primary point or resulted in distraction from the primary point.

    I think SubSonic 3 is great and I think SubSonic 2 is great. There’s nothing wrong with either of the two releases. My problem is getting from v2 to v3 without major recoding in specific regards to ActiveRecord implementation.

    I’m also sure that a few people understood my problems (even though, I’m sure they might have disagreed with the way I phrased it). I’m also positive that somewhere between SubSonic versions 3.1 and 3.9, it will become easier to move from 2.x to 3.x.

  29. Hello,
    I’ve been using SubSonic 2.1 and I’ve been a big fan of it. I too was disappointed to see some of the things I’ve been using in 2.1 missing in 3.0. I appreciate the team’s hard work, and I think the fact that they did so much to embrace new features of the C# language, like LINQ. However, some backwards compatibility isn’t a bad thing.
    Jim, thanks for showing how to add some of the old functions to the macros.

    @Ryan: I’m not very interested in Linq. Most of the engineers _I work with_ don’t use it at all and don’t feel a need to. Therefore, if I start writing code that uses Linq, they’re going to reject using SubSonic as it pushes a learning curve on them where they don’t want to ramp up on it. From their point of view, linq is a new way of doing something they are already doing just fine without.

    For me the big pain point here is [a perceived] lack of documentation, what seems to be the removal of the query tool, and a lack of backwords compatibility which requires me to learn a lot of things just to get my old projects to build.

    Please keep up the work with SubSonic but also if you can, bear in mind people who don’t want to work with Linq and love a lot of the interfaces SubSonic 2.x provided!

    Thank you very much for your hard work and your great contribution to the programming community.

    David Berman
    CEO
    SocialNetwork.com

  30. @David,

    Interesting that you should call me out on this, and I think you completely missed my point. Here’s another try: SS2.x SS3.x. Rob could have avoided this whole issue by saying he’s not updating SubSconic but creating a new ORM project called LinqSonic that provides similar but different functionality.

    If you don’t care about Linq, that’s fine. No one is telling you to care about Linq.

    Also, no one is telling you this is an official upgrade path. I haven’t read the docs in awhile, but I am fairly certain they mentioned this was a different approach.

    Thus, if you are happy with SS2.x, keep with it. I’m pretty sure Rob would say the same. It’s open source, so if you need new features, you are free to add them.

    Now, I can only imagine the comment was directed at my statement that I would rather see a comparison of SS3 with L2S or Entity Framework. I said that not because others care, but b/c those are similar ORM solutions. If you don’t care about SS3 or Linq, then you certainly won’t care about L2S, Entity Framework, or a comparison of any of those.

    A final note on backward compatibility: if you are building a customer-focused solution, that’s important. If you are building a tool for yourself (and others if they find it useful) it really doesn’t matter. That is not the point of open source stuff. Sure, you can do that if you want, but it’s not a requirement. People build tools that help them and let others use them for free. If you want it to be backward compatible, then go do that for the project, don’t complain.

    My 2 cents is that anyone who complains should be blocked from using the tool. Feedback is one thing; demands are another entirely.

    I suppose this comment fires me up b/c 1) Rob has done a great service by building this and giving it away, 2) he’s catching all kinds of flack for not doing it the way some others want him to (it’s quite selfish and me-monster-ish, really to think that you are so important as to demand your way from a free tool), and 3) ALL of your points were stated above. Must you really have your say, too? (See parenthetical aside in point 2.)

    /sigh

    -Ryan

  31. @Jim

    My point to David follows to you. Why do you want / need a migration path? What’s wrong with SS 2? Why do you feel the impulse to upgrade when you are using a tool that suits your style and method of coding?

    Given Linq is a completely new approach to solving problems (functional versus procedural), you are absolutely going to have to rework stuff to get it to the new paradigm. There isn’t an “easy” button here. It’s a shift in thinking. It’s also not necessary.

    So again, why do you feel the need to upgrade?

    - Ryan

  32. This is a year old blog post, so I’m going to lock it down again. The discussion has ran it’s course and the discussion has been resolved for quite a long time now.

    If anyone wants to express their thoughts on SS3, please do so in the SubSonic project forums or Rob’s blog.

    Thanks,