Scaffolding in an ASP.NET MVC App#

So at work I had to create a simple admin for a few new features in our app and decided I would try out a few new technologies while I was at it to not only save some time, but to see what is out there now.  My heart was set on this being a simple MVC web app, but really wanted to try ASP.NET Dynamic Data also.  Well good news is that you can use Dynamic Data in MVC fairly cleanly and easily.  By adding a simple route to the global.asax.cs file you can easily have Dynamic Data working although it is web forms based:

 MetaModel model = new MetaModel();
            model.RegisterContext(typeof(MvcApplication1.Models.NorthwindDataContext), 
                new ContextConfiguration() { ScaffoldAllTables = true });
            routes.Add(new DynamicDataRoute("DD/{table}/{action}.aspx") {
                Constraints = new RouteValueDictionary(new { action = "List|Details|Edit|Insert" }),
                Model = model
            });

Now this opened my eyes a little that you can easily create a hybrid web app of MVC and Web Forms.  Web Forms does have its advantages sometimes, especially when you start looking at existing tools and controls that you just need to work quickly and don't feel like reinventing the wheel.

You can download a sample project of this working in an mvc app over at codeplex. http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=14473

That same night I was playing with Dynamic Data, Rob Conery had just posted his prototype of a Subsonic MVC Add-in for Visual Studio.  I was pretty impressed with the code and views that it generated, and I think is a great start to seeing what is possible.  Both samples took less that an hour to download and implement.  I ended up spending more time integrated security across the multiple web apps on different sub-domains than getting the scaffolds to work.

Wednesday, October 29, 2008 8:10:43 AM UTC #    Comments [0]  |  Trackback

 

Subsonic and Microsoft#

I have been using SubSonic for about a year now and have used it on almost every web project I have done in the last year.  I really have been wondering recently whether or not SubSonic was going to keep going with the MVC architecture that Microsoft is currently developing.  I can't even think of creating a website without it. 

Anyway I had started to think that maybe Microsoft would eventually try to hire Rob Conery especially after they just hired Phil Haack who also helped with SubSonic.  Well it looks like Microsoft is hiring Rob Conery as he posted here:

http://blog.wekeroad.com/2007/10/26/microsoft-subsonic-and-me/

I am pretty happy about this as now I believe that SubSonic is alive and well and that it will be the convention-driven toolset for Microsoft’s new MVC framework.  I am very excited to see where this goes.

Monday, October 29, 2007 7:44:47 AM UTC #    Comments [0]  |  Trackback

 

SubSonic 2.0 officially released#

My favorite ASP.NET code gen framework has just been officially released to its 2.0 version.  It is really more than a code gen tool and provides an excellent framework for getting websites done much quicker.  Really good stuff.  You can check it out here at codeplex.  They have also released Subsonic Tools for Visual Studio which is great for generating dal's outside of you website projects and can be used much easier with Web Application Projects along with WinForm applications.

Sunday, April 29, 2007 5:04:30 PM UTC #    Comments [0]  |  Trackback

 

SubSonic 2.0 - New release coming soon...#

I just got done reading Rob Conery's recent post on what's coming in Subsonic 2.0 and I am so excited.  I already use this stuff everyday in all of my projects for the last 3 months and am sure that many will in the future once they understand how powerful this is.  For those that do not know what SubSonic it, check it out at CodePlex.

For those of you at the Sarasota User's Group on Tuesday, I am pretty impressed at how many of you have emailed me telling me about your experience and asking additional questions on how to use it already.  I guess it made quite an impression.  I know it did for me when I first stumbled across it and I think it will for most asp.net 2.0 web developers out there.

Saturday, February 24, 2007 10:34:06 AM UTC #    Comments [0]  |  Trackback

 

Sarasota Users Group Meeting#

I am speaking on Tuesday, February 20, at the Sarasota .NET Developers Group on Code Generation with ASP.NET.  I am excited to meet the group down in Sarasota and visit another users group.  If you are going to be around the area, stop down and check out my session.  It will be at 6 p.m. at the Sarasota Community Foundation, located at 2635 Fruitville Rd., Sarasota, FL 34237 (just west of Tuttle on the north side of Fruitville).

Here is the session description:

Code Generation with ASP.NET

Learn why there is no need to ever write 1000’s of lines of code again for your Data Access Layer. I will examine the different open source and commercial choices out there for code generation including SubSonic, .NET Tiers using Codesmith, and the new BLINQ stuff coming out with Orcas. I will show practical uses for code generation and also how to best set up your team and / or yourself to become successful when using code generation with your projects.

Look forward to seeing you there!

Tuesday, February 20, 2007 7:20:04 AM UTC #    Comments [2]  |  Trackback

 

SubSonic - The Zero Code DAL for ASP.NET#

Ok, I am still having a hard time sitting down after playing with this and getting it to work on a few prototypes using existing database schemas. It works with both SQL Server 2000 and 2005 along with MySql.  It has a few issues, all of which are correctable, but I have to say this is going to change the way I develop every web application.  It truly is a RAD toolkit that helps your website build itself as you go.  As I write this my mind is wondering at the possibilities.  The best thing about this is that it is open source.  Go to the SubSonic Project on CodePlex and download the source yourself. 

Make sure to spend the 20 minutes watching the Webcast on how to set it up.  You will be amazed.  If it does not work at first with your database schema or you have weird errors make sure to try and build all the class files and try to compile it.  There may be some naming conventions that you will need to follow in order to get it to compile right.  One off the top of my head is to not name a column the same name as any table.  I just changed the way I named a few columns and in what order and it worked beautifully.

This project has great promise because it can really help teams of developers build projects very quickly.  You can download the release, but if you want to be cutting edge I suggest you download the latest source code from the Latest Source Control Commits.  They have really added a lot of functionality since the last release.  I don't know how many bugs there are, but it worked good for me.

You can also listen to more about it on a Dotnetrocks podcast from October 2006 with Rob Conery.

Hats off to Rob Conery for starting a very cool toolkit for RAD web development in ASP.NET!  Thank you!

Tuesday, December 19, 2006 8:01:56 AM UTC #    Comments [0]  |  Trackback

 

Codesmith 4.0 Released#

This is by far by favorite release of Codesmith.  It has NetTiers as part of it, which is what I use for almost every project I create.  Why would I do such a thing?  Well to save time of course.  I am not trying to sell Codesmith, but if it was my job, I would probably do very well.  You see any time a developer can save time, be more productive and write code the proper way, you feel more empowered.  For years I have known that you can create prototypes very quickly using code generation, but the code generation tools I created were just the way I write code.  This can be good, but also bad. You see, with code generation you can automate creating code that is inherently bad also.  It depends on your style and how you adapt to change.  I have learned many lessons with code gen and have learned that the one that is best is the one that is easiest to change.  NetTiers is not always the best way, but nothing is always the best way.

NetTiers should be use when you need an admin to your application especially.  If your app is constantly changing and you want more dynamic control, then code gen may not be for that project.  Also if you have a team where you want to control the way they access the data layer, then code gen is great because it standardizes the way all of the team accesses data.

Thursday, November 16, 2006 8:35:47 AM UTC #    Comments [0]  |  Trackback

 

.NetTiers 2.0 Release#
.NetTiers has just released it's 2.0 version and it is the best architecture / code generation template ever released. For those of you who do not know about the whole code generation thing, I feel sorry for you. You will not believe the amount of time you will save generating code. I have been writing my own code generators since 1998 when i used Lingo to write html and perl. No joke! Anyway, I have been writing a vb and c# code generator the last 3 years for my own good, but ever since I stumbled across nettiers template for codesmith, I have stopped my own development. These guys knock it out for you. It is the best code generator template out there for .net 2.0. I religiously use this for every project i have had for 6 months now. The new release fixes many things and is very easy to use. You can definitely take extreme programming to the next level with this stuff.

Well as you can see I am pretty excited about this stuff and so much that I asked if I could help with nettiers. I was lucky enough to be added as a developer to the open source project. I am going to focus on adding some atlas / ajax to the admin since it is what i have the most passion for and experience playing around with the atlas control toolkit for the last 4 months.
Friday, September 29, 2006 8:00:00 AM UTC #    Comments [0]  |  Trackback

 

NetTiers New Release for Codesmith#
For those of you that are into Code Generation you need to check out the new NetTiers release for Codesmith. NetTiers is an open source template for CodeSmith. It has options to include the atlas framework and atlas control toolkit along with so many other features like web service generation, admin generation, VSTS unit tests, DAL, etc. It is really unbelievable. I use it on every project now and it has simplified my life. It is really amazing how these guys are producing one of the smartest ways to architect your application for free. Well you need Codesmith, but the templates are open source. Its a great way to learn generics and the enterprise library. I swear by it now. Look into it if you are interested in saving time. Be aware of the learning curve. It is worth it at the end though.
Tuesday, August 15, 2006 8:00:00 AM UTC #    Comments [0]  |  Trackback

 

 

All content © 2009, Jim Zimmerman
Book
New Book
Links to me
On this page
Sponsors
Calendar
<January 2009>
SunMonTueWedThuFriSat
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567
Archives
Tags
Blogroll OPML
Technorati
Favorite Links
Disclaimer

Powered by: newtelligence dasBlog 1.9.6264.0

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail