Tales from the Evil Empire

Bertrand Le Roy's blog

News

Ads Via DevMavens

ASP.NET AJAX UpdatePanel Control: Add Ajax interactivity to your ASP.NET 2.0 web pages

Add to Technorati Favorites

Blogs I read

My other stuff

Declarative programmation will bloom with ASP.NET 2.0 auto-compilation

You may already know that, but ASP.NET 2.0 introduces a new Code directory (or Application_Code, the name is not final yet) that enables you to just deploy the source files of your libraries, and they will get compiled on-the-fly. What you may not know is that you can extend this by creating your own build providers.
When I first learned about the extensibility of the auto-compilation, I immediately thought about how an Object/Relational  mapping tool could take advantage of it and generate the DAL transparently on-the-fly from the XML mapping file. It would make it marvelously transparent and easy to use, update and manage. An additional bonus is that any change to the xml file would immediately result in Visual Studio Intellisense picking up the change and displaying the new types. Just perfect.
It seems like I'm not the only one who thought about that: here's an article from Fritz Onion that explains exactly how to do this now, with the public beta of ASP.NET 2.0. Check it out, it works now.
The possibilities are endless. For example, a business rule engine could use it, or a form generator.
Play with it, invent great new applications, and if you find anything limiting you in doing so, just tell us about it. Now is the right time.

Comments

Rob Cannon said:

It's a great facility. The only problem is that I would like to see a solution that will also work for non ASP.NET project. Shouldn't this be something that can be harnessed by Visual Studio/MSBuild (or is it already)?
# September 22, 2004 9:28 AM

BillT said:

I agree with Rob. (I still do more WinForms that ASP.NET apps with VS 1.1.)
I'm not sure how you'd do this. (a) Perhaps just an API call to initiate the necessary examination and processing of the (or any) directory. (b) Perhaps a project (shipped with VS) that would be added to a solution. This project would implement all the needed processing.
# October 8, 2004 4:44 AM

Bertrand Le Roy said:

It's a great question. Though I don't have a precise answer right now, this new feature of ASP.NET is just a build manager that you can easily configure.
ASP.NET is very different from Windows Forms in that it is a server environment that has to compile on-the-fly. I suppose that in a Windows Forms application, the need to do it on-the-fly is much less important. The same thing could be done at application launch. I suppose MSBuild could be used for that, but I don't think you need it. It should be enough to look at the config, scan any registered directory in there and launch the declared build providers if a recent enough dll does not already exist. Then load the dlls and... voilà.
Actually, this would make a beautiful project if someone wants to do it...
# October 8, 2004 1:18 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)