Friday, December 24, 2010

Lightswitch

Its finally here!   

Follow the announcement of  Lightswitch. The public beta is going to be available on late August,   I suggest you try it out.

LightSwitch is the simplest way to build business applications for the cloud and the desktop.

Sunday, December 12, 2010

Which Way Is Faster – Windows Phone 7 App

 

I am working on a Windows Phone 7 application, so that I can learn about development on the Windows Phone 7, so far it is a really great experience. I love using Linq, Xml serialization, extension methods, Visual Studio 2010, Silverlight, XAML, and all the technologies I am so familiar with.

I wrote a paper about the phone application which is called "Which Way Is Faster": A Mobile Phone Application Leveraging Location Tracking to Determine Which Commonly Traveled Routes are Faster.

The presentation and paper can be viewed here:

presentation

paper

Wednesday, December 08, 2010

Debugging SharePoint Code With a Console Application

 

Here is my SharePoint tip of the day. This is a helpful technique for debugging/testing SharePoint methods without having to fire up IIS. In my SharePoint code, I write my methods as public static methods that take an SPList or SPWeb object as a parameter. This may seem weird since you could just get these from SPContext.Current.Web. The reason for this is that this is a functional style programming technique where we don’t have class level variables. Instead the method takes in everything they need via parameters. The advantage of this is that I can write a console application and reference my SharePoint project and test my EventReceiver method (or Feature Receiver or WebPart or whatever) without having to deploy my SharePoint solutions, fire up IIS, etc. etc. It makes debugging and setting through code much quicker.  Of course once I have tested it in my console app, then I need to test it in the browser.

Sample Console Application. Note that I create my SPWeb object and list object using the non-SPContext way and pass them into my method which is contained in the referenced SharePoint project.

 

static void Main(string[] args)

{

try

{

   SPSite site = new SPSite("http://localdev/en-US/egs/contact/requestinformation");

   SPWeb currentWeb = site.OpenWeb();

   SPList ciList = currentWeb.Lists["CustomerInquiry"];

   SPList cirList = currentWeb.Lists["Customer Inquiry Routing"];

   SPList ciSettingsList = currentWeb.Lists["CustomerInquirySettings"];

   CustomerInquiryBL.Execute(cirList, ciList.Items[0], ciSettingsList, currentWeb);

}

catch (Exception ex)

{

   Console.WriteLine(ex);

}

Console.WriteLine("Press Any Key to Continue.");

Console.ReadKey();

}