Rumor has it… #LightSwitch 2012 (RC) will be available in a couple of hours…

God I sound like a gossip queen…

Last time I posted a “rumor has it” post, I was completely correct in my Sherlock-style assumptions, so let’s try again…  In that article, I speculated that VS 11 (beta) would be released 5 days later, and that it would include a new version of LightSwitch.  Five days later, VS 11 (beta) indeed went live, including the new version of LightSwitch, with the biggest surprise that LightSwitch apps are now built on top of the OData protocol, basically blowing them wide open…

Yesterday I read a post on CNET that Microsoft Visual Studio 2012 Professional RC (Release Candidate) would be available somewhere on May 31st.

Now, for those that are still following the naming here, MS VS 2012 Professional RC should indeed be the “improved” version of MS VS 11 (beta), containing the RC candidate of LightSwitch 2012, the technology we all love and uses v2.0 of the LightSwitch framework v1.0, which was used by LightSwitch 2011, which was released less than a year ago as an out-of-band addiction to VS 2010, or as a stand-alone version.

In the line above, you’ll notice that I put “improved” in quotation marks.  In a normal release cycle, the Release Candidate does not include any significant changes from the beta, usually just contains bug fixes and perhaps some minor changes based on customer feedback.  However, the LightSwitch team already proved before, with the out-of-band release, that they aren’t shy to stray away from normal release cycles…

The team has been communicating SOOOO much lately, but always in a “read between the lines” or “listen between the lines” kind of way…  And then I read a tweet sent by our LightSwitch goddess this morning…

Really Beth?

A big surprise ending?  In a LightSwitch session?  On the same day VS 2012 professional RC is supposed to be released?

That’s it… I’m excited!  Whether it’s the HTML5 client support, use of the new Azure SDK, built-in reporting, or something totally different, my little toe is itching, which means it’ll be good… Really good!

Extensions Made Easy v1.12: Fuzzy searching

Once you’ve grabbed EME v1.12.1 or higher, you can explore a new functionality that I ported from a client project to the extension called Fuzzy searching…  Although created months ago, published weeks ago, I never found the time to blog about this gimmick until minutes ago.  Time to post a small example, in VB.Net

What is Fuzzy searching?

Suppose there’s a patient tracker application, written in LightSwitch.  When I’m seeing the doctor, he has to enter my exact family name, or part of it, to find my record between the many Patient entities.  Chances are, I’m seeing the doctor because I have a sour throat or allergic reaction on my mouth, and I’m not in the mood for spelling out my last name, again (I ALWAYS have to spell out my last name… Well, about 99% of the cases anyways, my wife is called Kundry Annys, she has to spell it out in 100% of all cases)…  If the patient tracker application developer implemented fuzzy searching, he could make the doctor and his/her patients lives easier by implementing fuzzy searching…

Fuzzy searching is a technique where searching a list of items or entities is not done based on exact string match, but on “partial” or “metaphonic” match.  Basically, if the user enters a search term like “Hagen”, it’s convenient in some very particular scenarios to return all entities with a property that sounds like “Hagen”, including “Haeghen”, “Haegen” and “Hägen”.

Although this isn’t something you’d want to do for each search screen, some user scenarios definitely justify the use of a Fuzzy search.  Take my name for example: “Jan Van der Haegen”.  Although it might sound like an exotic name to the non-Dutch speaking audience, my name is literally translated as “John of the Hedge”.  You can imagine that this is quite a common family name in Belgium and the Netherlands, and thus, comes in a variety of notations across different families, from “Haägen” to “Verhaeghe” to “Van der Haegen” to…

Setting up a sample application

To test this fuzzy searching implementation, create a new LightSwitch application.

Note to self: Application798? Really? Get a life!

In the application, create a new entity called Patient.

As you might expect, the patient entity will contain some common fields like FamilyName, FirstName, and a computed field called FullName, for displaying purposes, which is computed as:

Namespace LightSwitchApplication

    Public Class Patient

        Private Sub FullName_Compute(ByRef result As String)
            ' Set result to the desired field value
            result = Me.FamilyName + ", " + Me.FirstName
        End Sub
    End Class

End Namespace

Making the entities fuzzy

To speed up the fuzzy searching, we won’t loop over the entities during the actual search.  Instead, we’ll add an extra property to our Patient entity, which will never be displayed except for this demo, where we store some “fuzzy” version of our entity.  When the end-user hits search, we’ll make the search term fuzzy as well, and look for exact matches between the fuzzy version of the search term, and the fuzzy version of our entity.

Add an extra property to the Patient entity called “FuzzyName”.  Make sure the maximum length is high enough to contain a fuzzy version (512 characters will do since our FirstName and FamilyName properties are 255 characters each).

This would make a valid candidate to be a computed field, but since computed fields aren’t stored (they are computed on the tier wherever they are called), we’ll “manually” keep this field in sync with the other properties on save (both insert and update), by writing some code (from the Write Code dropdown).

The code we’ll need to add is this:

Imports ExtensionsMadeEasy.Utilities.Extensions.StringExtensions

Namespace LightSwitchApplication
    Public Class ApplicationDataService

        Private Sub Patients_Updating(entity As Patient)
            entity.FuzzyName = entity.FullName.MakeFuzzy()
        End Sub

        Private Sub Patients_Inserting(entity As Patient)
            entity.FuzzyName = entity.FullName.MakeFuzzy()
        End Sub
    End Class

End Namespace

The imports statement at the top (using directive in c#) makes sure you can call an extension method called .MakeFuzzy() on any string.

I added a new screen (Lists and Details Screen template) to show the Patient entities, and in the list I’m showing both the FullName computed property and the FuzzyName property.

Again, this is done for demo purposes only, you’d normally never display this field to the end-user.

What we have done so far, will result in a behavior as in the screenshot below: for each entity, a value is stored that contains the FullName, but without vowels, diacritics, lower case letters, non-alphabetic characters, and with some special attention to how consonants are pronounced (for example: both “Haeghen” and “Haägen” will be stored as “HGN”).

In case you are wondering, the “MakeFuzzy” .Net implementation (source code) is based on this SQL implementation by Diederik Krols.  It’s supposedly Dutch specific, but I found it to work for English as well.  If you disagree, feel free to export a better algorithm (just export a class from your common project that implements  IMetaphonicStringValueConverter), or better yet: send it to me and I’ll gladly include your locale in EME.

However, this doesn’t solve anything yet.  If I misspell my name as “hagen”, the search result list is still empty…

Making the search term fuzzy

The last step, is to also grab the search term that is used in the list (or grid) on the screen, and replace it with it’s fuzzy version before it hits the server, so it can be compared to our fuzzy entities…

The bad news is that to do this, you must subscribe to the NotifyPropertyChanged event on the screens IVisualCollection, find the SearchTerms property on the IScreenCollectionPropertyLoader, and swap out the SearchTerms for their fuzzy counterparts, and be careful about threading in the process.  Thanks to Justin Anderson, for helping me get access to the “Search Pipeline”.

The good news, is that you can implement this from any screen, in the Screen_Created method (from the “Write Code” dropdown), as a one-liner:

Namespace LightSwitchApplication

    Public Class PatientsListDetail

        Private Sub PatientsListDetail_Created()
            ' Write your code here.
            ExtensionsMadeEasy.Presentation.Screens.ScreenCollectionFuzzySearch.MakeFuzzy(
                Me.Details.Properties.Patients)
        End Sub
    End Class

End Namespace

 

The result is that whenever the end-user (our dear doctor) hears my name, he/she can enter “Haagen”, “Haägen”, “Haaaaaaeeeeeeeeeghen”, …, our implementation will replace it with “HGN”, and match a whole set of records that sound like “Hagen” (and thus also have “HGN” in their FuzzyName property).

Succes! The name-spelling-era is finally over!

Extensions Made Easy: v1.12: Deep linking entities

I’ve been somewhat quiet on my blog lately (but have good excuses, as always), but tonight I’ll try to make it up with a little blogging spree…  Part one: what’s new in EME 1.12

Hooray, EME 1.12 is finally released…  It’s been a while since I worked on EME because I’ve been so busy.  Actually, EME 1.12 was released 2 weeks ago, but didn’t have the time at that point to show the goodies included!  A miniature “what’s included”…

Goody nr1: LS 11 (beta) support.

EME has been tested with VS LS 11 and works: commands, shell & theme exporting, the hole bunch.  I updated the manifest so you can actually install EME to target VS LS 11 beta!  Hooray!

Goody nr2: deep linking on entities.

For those of you that missed it, EME already allows deep linking on screens since a much earlier version.  I posted this in a sample (http://code.msdn.microsoft.com/silverlight/NavigationDemo-having-some-f2629c9c), but never gave it much attention.  

Deep linking is a technique in Silverlight where a user can interact with your application through the URL.  Basically, by passing parameters (the screen name) in the URL, the LightSwitch application opens up and navigates to the correct screen when fully loaded, for example:

LightSwitch doesn’t support deep linking out-of-the box, but if you install & activate Extensions Made Easy, it does!  That’s right, the only setup you need to do is to download Extensions Made Easy, and activate it.

Possible navigation commands:

* screens:  http://localhost:30325/default.htm?NavigateTo=StudentsListDetail

* entities: http://localhost:30325/default.htm?NavigateToEntity=Students&Id=1

* entities in the non-default datasource (or: you renamed the “ApplicationData”: http://localhost:30325/default.htm?NavigateToEntity=Students&Id=1&DataSourceName=ApplicationData

The funny thing about this “deep linking to entities” gimmick,  is that I was porting it to EME from a client specific project, at the very same time Chad77 was asking for this feature in the LightSwitch MSDN forums.  Funny, because that almost never happens.  Heck, that never happens!  Anyways, Chad77 was happy with the result, and I got a free beta tester! Double tap!

Goody nr3: Fuzzy searching

The third gimmick in EME is another functionality that I needed in a client specific LightSwitch project, and happily ported to EME for your convenience: fuzzy searching.  This one though, deserves a separate blog post, just because of it’s coolness… 🙂

 

 

How to make your required fields NOT have a bold label using Extensions Made Easy… (By Kirk Brownfield)

I’ll be honest, I haven’t spent much time on Extensions Made Easy lately.  I have good excuses though: I’m writing a “getting started with LightSwitch eBook” (link on the way), I founded a “LightSwitch exclusive startup“, I’m writing about LightSwitch for MSDN magazine, I’m working on my next extension called “LightSwitch Power Productivity Studio“, but mainly because I consider EME in its current form to be complete, in the way that it can do all that I intended it to do, all that I felt was missing/not easy enough in the LightSwitch RTM, and maybe even a bit more, like deep linking in a LightSwitch application

Ironically, just when I stopped writing about EME, other people started discovering the power behind the lightweight extension, and have been happily sharing…

Kirk recently mailed me with another question: “how can one make the required fields NOT have a bold label”?  For those of you that haven’t noticed, when you use the LightSwitch default shell & theme, required properties will have a bold label like in the screenshot below:

Adding Data

By the way, my apologies on the crappy graphics in my MSDN screenshots.  I turned ClearType off on my machine, as requested in the MSDN Magazine writer guidelines.  If you take a screenshot with ClearType on, it looks crappy on-screen but much better when printed.  Bad move for the MSDN Magazine web edition, obviously…

Before I could even answer his mail, a second mail came in from Kirk with the response to his own question.  Kirk later happily granted me the privilege of posting me the answer…

Firstly, set up your LightSwitch project so you can create a theme inside your LightSwitch application.  (Everyone hates the “Extension” debugging mess…)  A sample of how to do this can be found here.

Next up, since you want to do some control styling, not just mess with the colors and the fonts a bit, you need to export a new control style to the LightSwitch framework.  I wrote about this earlier, and Keith posted the VB.Net version!

The question of course is what control you need to style, and for this you need to understand a bit about LightSwitch’s Meta-data driven MVVM implementation (MV3).  Unfortunately, the joke is on you here, because there’s little to no documentation about the subject (hold your breath for exactly 7 days and there will be… 🙂) The very short preview: the LightSwitch default theme & shell provide Views that binds to ViewModelMetaData, which in turn binds to your ViewModels and Models.  The XAML (View) part that shows the label, is called an AttachedLabelPresenter.

Kirk actually found the control to style, by looking at the source code of the LightSwitch Metro Theme, reposted here for your convenience…

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:framework="clr-namespace:Microsoft.LightSwitch.Presentation.Framework;assembly=Microsoft.LightSwitch.Client"
xmlns:internalstyles="clr-namespace:Microsoft.LightSwitch.Presentation.Framework.Styles.Internal;assembly=Microsoft.LightSwitch.Client"
xmlns:internalconverters="clr-namespace:Microsoft.LightSwitch.Presentation.Framework.Converters.Internal;assembly=Microsoft.LightSwitch.Client"
xmlns:converters="clr-namespace:MetroThemeExtension.Presentation.Converters"
xmlns:windows="clr-namespace:System.Windows;assembly=System.Windows">

<internalstyles:RequiredFontStyleFontWeightConverter x:Key="RequiredFontStyleFontWeightConverter"/>
<converters:TextToUpperConverter x:Key="ToUpperCaseConverter"/>

<!-- The attached label presenter is the control that places labels next to controls. It is restyled here to put the label-->
text in upper case. The style is applied using implicit styles, so do not give the style a key -->
<Style TargetType="framework:AttachedLabelPresenter">
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="framework:AttachedLabelPresenter">
<TextBlock x:Name="TextBlock"
Text="{Binding DisplayNameWithPunctuation, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ToUpperCaseConverter}}"
VerticalAlignment="Top"
HorizontalAlignment="Left"
TextWrapping="Wrap"
FontWeight="{Binding Converter={StaticResource RequiredFontStyleFontWeightConverter}}">
<windows:VisualStateManager.VisualStateGroups>
<windows:VisualStateGroup x:Name="AttachedLabelPositionStates">
<windows:VisualState x:Name="None"/>
<windows:VisualState x:Name="LeftAligned">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextBlock" Storyboard.TargetProperty="Margin" Duration="0">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<windows:Thickness>0,3,5,0</windows:Thickness>
<!--DiscreteObjectKeyFrame.Value>
<!--DiscreteObjectKeyFrame>
<!--ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextBlock" Storyboard.TargetProperty="HorizontalAlignment" Duration="0">
<DiscreteObjectKeyFrame KeyTime="0" Value="Left"/>
<!--ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextBlock" Storyboard.TargetProperty="VerticalAlignment" Duration="0">
<DiscreteObjectKeyFrame KeyTime="0" Value="Top"/>
<!--ObjectAnimationUsingKeyFrames>
</Storyboard>
VisualState>
<windows:VisualState x:Name="RightAligned" >
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextBlock" Storyboard.TargetProperty="Margin" Duration="0">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<windows:Thickness>0,3,5,0</windows:Thickness>
<!--DiscreteObjectKeyFrame.Value>
<!--DiscreteObjectKeyFrame>
<!--ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextBlock" Storyboard.TargetProperty="HorizontalAlignment" Duration="0">
<DiscreteObjectKeyFrame KeyTime="0" Value="Right"/>
<!--ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextBlock" Storyboard.TargetProperty="VerticalAlignment" Duration="0">
<DiscreteObjectKeyFrame KeyTime="0" Value="Top"/>
<!--ObjectAnimationUsingKeyFrames>
</Storyboard>
VisualState>
<windows:VisualState x:Name="Top" >
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextBlock" Storyboard.TargetProperty="Margin" Duration="0">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<windows:Thickness>0,0,0,5</windows:Thickness>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextBlock" Storyboard.TargetProperty="HorizontalAlignment" Duration="0">
<DiscreteObjectKeyFrame KeyTime="0" Value="Left"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextBlock" Storyboard.TargetProperty="VerticalAlignment" Duration="0">
<DiscreteObjectKeyFrame KeyTime="0" Value="Bottom"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</windows:VisualState>
<windows:VisualState x:Name="Bottom">
<Storyboard>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextBlock" Storyboard.TargetProperty="Margin" Duration="0">
<DiscreteObjectKeyFrame KeyTime="0">
<DiscreteObjectKeyFrame.Value>
<windows:Thickness>0,5,0,0</windows:Thickness>
</DiscreteObjectKeyFrame.Value>
</DiscreteObjectKeyFrame>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextBlock" Storyboard.TargetProperty="HorizontalAlignment" Duration="0">
<DiscreteObjectKeyFrame KeyTime="0" Value="Left"/>
</ObjectAnimationUsingKeyFrames>
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="TextBlock" Storyboard.TargetProperty="VerticalAlignment" Duration="0">
<DiscreteObjectKeyFrame KeyTime="0" Value="Top"/>
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</windows:VisualState>
</windows:VisualStateGroup>
</windows:VisualStateManager.VisualStateGroups>

</TextBlock>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

The interesting bits are all near the top.  First thing to notice, is the comment:

<!-- The attached label presenter is the control that places labels next to controls. It is restyled here to put the label
text in upper case. The style is applied using implicit styles, so do not give the style a key -->

Ok, so that confirms what we thought: the AttachedLabelPresenter is the control that places labels next to control.  Good naming (Nomen est Omen)!

Also, the Metro theme puts all Labels in upper case, and for this exercise, we only wanted to get rid of the bold.  Let’s revert that by getting rid of the ToUpperCaseConverter a couple of lines below that comment line:

  Text="{Binding DisplayNameWithPunctuation, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ToUpperCaseConverter}}"

Nice, following all the links posted in this blog post, and removing that converter, we have a LightSwitch application where the way labels are represented, looks exactly like the standard theme, but is completely under our control.  One thing we can now accomplish, is to get rid of the functionality where required fields have a bold label.  This is accomplished by getting rid of the following line completely (not just the converter!):

 FontWeight="{Binding Converter={StaticResource RequiredFontStyleFontWeightConverter}}">

Awesomesauce, another mission accomplished!

As you might have suspected, I wrote this blog post myself, but titled it “By Kirk Brownfield” since he basically came up with the solution before I could even read his first mail. 🙂  He promised me to send information about some other LightSwitch hacking adventures he’s been undertaking, I’m personally looking forward to reading about it, and sharing it with you!

Keep rocking LS!

Monthly LightSwitch column in MSDN Magazine, and other “all things LightSwitch”…

I closed my last post two weeks ago by stating that 

I’ll probably be in the LightSwitch 11 zone during the next 48 hours straight .

Judging by the number of new posts ever since, you might think that I have instead been clustered to my laptop for 14 days straight, not sharing of writing about my LightSwitch experiments with the community, but those of you that know me in person would probably beg sometimes for a way to have me shut my mouth about LightSwitch for more then 5 minutes… I’ve just been more quiet on this blog…

LightSwitch covered in a monthly column in MSDN Magazine.

I’m extremely proud to announce, that MSDN Magazine – the Microsoft Journal for Developers – will soon have its own monthly web column about “all things LightSwitch”, written by yours truly.  As one could expect, the articles will deal with both “what comes out of the LightSwitch box” and “thinking outside the LightSwitch box”; from the looks of the propositions as they are now I’ll be your guide on a LightSwitch flavored tour through Windows Phone 7.5 (“Consuming a LightSwitch OData service from a Windows Phone application”), application building and Metro design style (“Building data centric applications faster than ever with Microsoft Visual Studio LightSwitch 11 beta” and “Taking LightSwitch for a ride on the Metro“),  Azure ACS (“Logging on to a LightSwitch application using a Windows Live ID“) and Windows WorkFlow Foundation (“LightSwitch 11 – coding’s optional“) mashups.

The first post will be published quite soon (and rest assured I’ll make sure you know where to find it), but I wanted to go ahead and thank everyone involved, with a couple of people in particular: Michael Washington (www.LightSwitchHelpWebsite.com), Michael Desmond and Sharon Terdeman (1105 Media), and Beth Massi (Microsoft).

“My first eBook”.

Working title, by the way. 😉

Another item on my “LightSwitch list of things to do”, is writing on my first eBook.  The kind people at Syncfusion – Deliver Innovation with Ease – have asked me to author an eBook for them about “all things LightSwitch”.  My only request to them was that the eBook will be available for free to the general public, which they immediately and gladly accepted.  The eBook should be written by May 1st, rest assured I’ll make sure you know where to find it!

“The LightSwitch startup”.

Another working title, I’m afraid.

I’ve already mentioned it a couple of times, and on April 2nd it’s finally happening. Besides my fulltime employment at Centric, I’ll be working for my own startup that will do “all things LightSwitch”: LightSwitch evangelism (training, blogging, writing, speaking, …), LightSwitch consulting, building LightSwitch solutions, and LightSwitch extensions.  Actually, my second LightSwitch extension is almost, almost, – really – almost ready to be released in beta, and I promise it will blow your mind!

So anyways, I haven’t been so active on my blog lately, but have instead been playing with LightSwitch 11 beta, and other “all things LightSwitch”.  Did anything fun lately that you’d like to share, got a good name for the eBook or a suggestion for the startup’s name, know that I just love it if you hit that comment button below to let me and the other readers know!

What’s new in Visual Studio LightSwitch 11 (LS VS vNext Beta) – a hacker’s view…

I need to write down my random thoughts on what just happened… 

Rumors got out a couple of days ago, but in case you missed it: Visual Studio LightSwitch 11 was released in public beta a couple of hours ago!

  • Download it – it’s no longer a separate download, but is included in the full Visual Studio 11 consumer preview.
  • Find out what’s new on the official LightSwitch team blog.

There will probably be more official content later today, and over the next few weeks, but let’s dive into the “what’s new” post together while the installer is running…  My blog post won’t list the new features, the official announcement covered that briefly but with just enough detail, instead, lets reflect a bit on how this will change our lives as LightSwitch newbies, experts, and hackers alike…

The LightSwitch team has been listening!

Some of us, including myself, had the amazing honor to meet Beth Massi in person, others used the Microsoft Connect site, to provide feedback to the team.

And they have been listening!

And not only have they been listening when we addressed them directly, but they have been listening when we blogged, tweeted, or even posted popular LightSwitch extensions that solve some common problems in LightSwitch v1… They have been listening!  So let’s continue, more than ever, to connect to the LightSwitch team, connect to each other, and enjoy how LightSwitch product and community becomes better and better over the years.

The result, is directly visible in LightSwitch 11.   The ability to define data relationships on external data, an easy way to add static text and images, new business types (web address and percentage), assigning roles on Active Directory groups to easy the user management pains, …

All of this is mainly for end-user-developers, which of course, includes us experts and hackers as well!  Really, besides exploring the technological wonders of LightSwitch, we use it to write applications too, right?  

Welcome LightSwitch as a first class citizen!

 What’s more, today marks the availability of Visual Studio 11 Beta

This, might be one of the most influencing novelties confirmed today.  LightSwitch is no longer (solely?) available as a separate download, but is included in the full-blown Visual Studio 11.  LightSwitch v1 primarily targeted “end-user-developers”, or at least – that’s how it often felt, and by including it in the full VS 11 package, Microsoft is clearly signalling that they haven’t, and will never, forget about us experts & hackers.

It’ll be a lot easier to convince other professional developers to give LightSwitch a second try, to convince them that it’s not “Access version 2” (yes, one person literally asked me that… I politely giggled at his ignorance then, but am laughing out loud now!), if it’s already installed on their machines!

The fact that there is a next version of LightSwitch, and that it’s included in the full VS 11 suite, is also a clear acknowledgment that LightSwitch has a future, and that Microsoft is working hard on that future.  Who would have guessed that a billion dollar company wouldn’t release a product without a bigger plan? 

In the middle of all this “HTML5 and Metro”-hyping, a lot of people also wondered if LightSwitch wasn’t “dead before it even started”, because of using SilverLight as a front-end technology.  To be honest, the business doesn’t care much about front-end technology, but we, as professional developers, want to stay trendy and hip, and in a way, they gave us that with this release…  (Read on…)

Getting your data out of a LightSwitch application!

LightSwitch v1, included quite some options to get your ‘legacy’ data in a LightSwitch application – design it yourself, connect to an existing database, SharePoint, custom WCF RIA services, …  but apart from some custom excell exports, you could not get your data back out easily.

First, LightSwitch in VS11 has embraced OData. […] adds first-class support for connecting your business applications to OData feeds. […] But, we thought we’d spice things up more and turn our OData support on its head – in VS11, LightSwitch also makes is extremely easily to produce and deploy your own data as OData services.  This is both true for tables you define in your project as well as external data sources you connect to.  What this means is that the LightSwitch server pipeline […] is no longer a closed black box – other apps can now leverage the simplicity and power of LightSwitch via the OData feeds it exposes.

So many ideas pop into my head…

  • Instead of LightSwitch connecting to other application’s data, other applications can now connect with greatest easy, to our LightSwitch application’s data.  For me, this takes LightSwitch away from the “tool that can connect to enterprise solutions”, right up there on the pedestal as the “application that is part of an enterprise solution”.
  • If you have some legacy apps, but don’t have the need to re-write them as a LightSwitch application, you can abuse LightSwitch to create an OData service for it.  Create a new LightSwitch application, connect to the database of the legacy app, don’t make any screens but instead, publish the LightSwitch OData service only.  Convert-legacy-to-future? Fastest tool to accomplish the job, right here!
  • If you are creating an application in another technology, it’s now really easy to access the data from your LightSwitch application using an industry standard.  PhP, JAVA, HTML5 (JavaScript), whatever your flavor, can interact with my LightSwitch application, without bypassing my business logic.  (You could already connect to the database of the LightSwitch application, if you wanted…)  
  • And last but not least… My personal favorite…  Since the LSML contains a definition of your screens (in other words: how your data should be presented) and OData services are available to interact with the data… What’s stopping us, as a community, to create a Windows Phone, WinRT, or HTML5 framework, based on the output created with the LightSwitch built-in editor?
In case you missed my tweet last week, my younger brother picked “using HTML5 as a front end for LightSwitch” as a topic for his (college) thesis.  His life just got a LOT easier…

So… Who’ll be the first to accomplish such a project?  Or does anyone want to start an open source project?  Who’s ready to dream with me, and make those dreams come true, thanks to the awesomeness, that is LightSwitch 11…

Now, if you will excuse me, the installer just prompted me to reboot my pc… I’ll probably be in the LightSwitch 11 zone during the next 48 hours straight, but please, leave a comment and tell me how you feel, or what your opinion is, on the beautiful gift we got today?   Merry Christmas, everyone!