ASP.NET 2.0 Seminar day 1
For three days, I’m attending a seminar from Microsoft on ASP.NET 2.0. It’s my first time on an official Microsoft course, so this is all new to me.
What struck me on the get-go, was that the mix of people attending was not what I’d originally expected. There were four people from traditional MS-based solution providers, a couple of embedded, C++ kind of thing people, a guy that did PHP full-time and a couple of other people that I can’t really remember their background.
Next, the whole thing is run with conference software, and all labs are run on a VirtualPC VM, running Windows 2003 Server with Visual Studio 2005 beta 1. How convenient, to ensure that all labs are run on a VM. None of the normal installation hassles, perfectly controlled environment.
The seminars started out pretty basic. We started off with a few alterations in the way Visual Studio now manages projects - and the lack there of …
Apparently, there is no more the notion of a ‘project’ in a Web Project. VS 2005 comes with the latest incarnation of the Personal Web Server embedded, so your Web Sites can now reside on the local file system, some FTP server, or a direct IIS connnection, but you hande all changes as changes to files. There is no build-deploy cycle. Changes are propagated to the server, and the runtime there compiles stuff on first use. I must admit that this is a much easier way to work.
Attached, comes a very helpful tool that manages synchronization between the ‘dirty’ files on your hard drive, and the actual deploy directory.
A few architectural changes were discussed as well. In ASP.NET 2.0, the class implementing the code-behind of an aspx page is now declared as ‘partial’, and no loger derives from System.Web.UI.Page. It’s in essence, a POCO (Plain-Old C# Object ;] ). In the 1.1 environment, the Code Behind and the actual page classes were compiled seperately, in two different assemblies. Now they are compiled together as two parts of a partial class. I can only assume that this would also alleviate the cross-assembly communication that perhaps could incurr some overhead, but other than that, the only usefulness I can see in that is in the developer experience. The code is now much clearer, and in much fewer lines.
Our first lab was about creating a new Web Site, and setting basic options.
The next session was about Master Pages. MP is a new feature, towards an effort to make templating the layout of a web site easily.
A Master Page defines some regions (ContentPlaceHolder’s) by Id. Other than that, a Master Page can include whatever content the developer cares to place on it, to be included in all templates based on that Master Page. Then, each page can specify that it is assosciated with a Master Page, and that it’s content should appear on a specific place holder Id.
I can see the usefulness of Master Pages, especially for medium-sized projects, that require a somewhat mandane, not so varied layout. Other than that, I acknowledge that MP’s have some potential, but I found it a rather boring new feature.
The lab after that was all about illustrating nesting within Master Pages. Actually, the only interesting part in that was discovering the new ‘Refactoring’ option on the context right-click menu on the Code Editor. I’d just declared a couple ot private variables in my class, when I remembered reading something about Refactoring utiilities in VS 2005. Happily, I fould an option called ‘Encapsulate Field’, that generated Properties for my private variables. Other utilities included local renaming of variables, and a bunch of other I didn’t have the time to explore. Nice one for the VS guys though, even if this functionality is nothing compared to Eclipse or IDEA, it’s an addition very happilly received
I hope tommorow morning we get started on more interesting things. The guy kept insisting that there’s major changes in the framework - although the only thing I noticed was a bunch of new controls. I’m being unfair now, but if you’d only paid attention to the speaker and not inquire further, you’d end up a Web GUI code-monkey. A bit shallow, I think.
Anyhow, till tommorow then.
O:]