Saturday, October 27, 2007

The WebNavigator

What is the Web Navigator?!
Well the Web Navigator is a techhnique, or pattern that I was introduced to from a podcast by Craig Shoemaker at http://polymorphicpodcast.com "Download example code"This pattern is a great way of creating Contracts for Your Web Pages, so its much easier to manage navigation throughout your websites.Some of the strength that i like about it, is that it "Encapsulate page locations" , "Makes the code easy to read and maintain" and make contract of a page requirements.

The Code
Lets say that you need to se a profile page, and that page show userinfo by a querystring, the code could look like this.string userName;
// set userName to something... perhaps from the database
WebNavigator.GoTo(WebNavigator.URLFor.Profile(userName));

class WebNavigator
{
public void GoTo(string url)
{
HttpContext.Current.Response.Redirect(url,true);
}
public string Profile(string userName)
{
return string.Format("~/login/default.aspx?userName={0}",userName);
}
}

You could make it more dynamically so you dont have to recompile if the url changes, by store the urls in xml or whatever you like.
In umbraco the method could look like this.

public string Profile(string userName) { return umbraco.library.GetDictionaryItem("ProfileUrl") + "?" + userName);
}

Wednesday, October 10, 2007

VS 2008 certifications

There have ben announced new certifications for vs 2008 - Great!.. Now I know what to do after my MCPD webdeveloper exams.

Exam 70-502: Microsoft .NET Framework 3.5 - Windows Presentation Foundation - 11/09/2007Exam 70-503: Microsoft .NET Framework 3.5 - Windows Communication Foundation - 11/08/2007Exam 70-504: Microsoft .NET Framework 3.5 - Workflow - 11/15/2007Exam 70-561: TS: Microsoft .NET Framework 3.5 - ADO.NET - 1/17/2008Exam 70-562: TS: TS: Microsoft .NET Framework 3.5 - ASP.NET - 1/31/2008

Where did I fount the informations here