Flipping on LightSwitch
April 23, 2012 —
(Page 2 of 4)
Related Search Term(s): LightSwitch, Microsoft, Visual Studio
All about OData
The LightSwitch team itself recently took advantage of this separation of concerns with the latest beta version in VS11. “We changed the entire middle tier from WCF RIA services to OData, which is a REST-ful way of doing CRUD [create, read, update and delete] operations against data sources,” said Microsoft’s Massi.
The change will be seamless to end users, but now, she said, “When you create a LightSwitch app, your middle tiers are automatically OData services. The Azure DataMarket supplies all data sets via OData feeds. SharePoint list data, Excel, Microsoft PowerPivot, and other reporting and analysis services are all exposed as OData feeds. This really opens the door for companion apps such as mobile clients or Windows 8 Metro style apps.”
Perhaps no one is more excited about OData than Michael Washington, a Los Angeles-based Microsoft Silverlight MVP, who runs lightswitchhelpwebsite.com.
“In this last release, the key thing is they added OData communications,” he said. “People were expecting, ‘Hey, Silverlight’s dead, so why isn’t LightSwitch generating HTML5 pages?’ Instead, it’s like your house is burning down, and someone hands you a telephone instead of a garden hose. The answer really is the telephone.
“I got hit by this OData thing too; honestly, it took me weeks to get my head around it. But they’re right, the telephone is truly the answer. Now you can do a water drop. Trust me, you need the telephone. OData can handle everything.”
Based on HTTP, AtomPub and JSON, OData is a Microsoft-sponsored REST API standard for database-style CRUD using the HTTP verbs POST, GET, PUT and DELETE. LightSwitch developers can consume feeds from, say, the SAP NetWeaver Gateway and SQL Server Reporting Services, not to mention data sets (such as weather, traffic and geospatial) hosted in the Azure DataMarket.
“We still support connecting to RIA services, but it was sort of a black box that only the Silverlight client knew how to talk to. When we switched out the technology stacks of the middle tier, we opened it up,” said Massi.
Not only does LightSwitch now consume OData feeds, however, it also produces them. In a tutorial on his blog, Washington demonstrated how to build an Android client that calls the LightSwitch OData feed and business layer, including its security and business rules.
The three-hour work week
Regardless of the uncertainty swirling around Silverlight, the biggest argument for LightSwitch is still productivity. “Honestly, for the apps that LightSwitch builds, Silverlight is the best solution today,” said Massi. “If you want to build heavy-duty data entry type stuff, Silverlight is a very good choice, based on the community, tooling, and the set of vendors producing controls today. Apps that were taking months to build, take days to build.”
Or even less, according to Washington: “This can shave development time and expense by 95%, period, end of story. I’ve got 30 LightSwitch projects on my site that I’ve built over almost two years.”
Washington has been very involved in Microsoft’s MVVM concept, writing 50 articles on it over the years, he said. Unfortunately, “People who tried to do MVVM projects never got it completely. They kept going back to Web forms. Now with LightSwitch, that’s not the case; people can get it done.”
That productivity stands in stark contrast to the current process, which is to define a business project, hand it off to IT or contractors, and finally, months later, get a finished product that doesn’t do what it needs to do, because the hand-holding required by stakeholders never happened. In fact, according to Philadelphia-based senior business integration analyst Christopher Finlan, the speed can be downright dizzying.
In three hours, he said, he was able to build an app in LightSwitch that had been under development for two weeks by a consultant. “The estimated value of what I provided, they said, would save the company €55 million over the next five years,” he said. “I thought, ‘You mean I just wrote a €50 million application?’ ”
In the last few months, Finlan built five or six applications, all now in production, he said.
Another application he’s built uses OData to tie together customer-relationship management, financial and line-of-business data. He uses ComponentOne’s OLAP control for LightSwitch to display the information. But is this a one-off application, or something that can evolve? The latter, he said: “There were a couple things in there that I didn’t know how to do and didn’t have time for, so I turned it over to my developer because he knows C#.”
That’s exactly the value proposition Massi’s team is touting. She points to the LightSwitch Star Contest from last year on The Code Project, which garnered 30 entries, ranging from Church+ (a church-management application covering everything from relationship management to financials) to Data Centre (a New Zealand-based cooperative project to store product information).
Six of the apps were cloud-based and hosted in Azure, Massi noted.
Some Microsoft partners, however, see LightSwitch playing a bit part rather than a starring role. “Unfortunately, it seems people are using LightSwitch for the stuff they were using Access for,” said Evan Hutnick, developer evangelist for Telerik, another Microsoft .NET partner.
“We’re not seeing anything monumental, just forms over data.”
DevExpress technical evangelist Seth Juarez concurred: “For some reason, from hardcore developers, there is some pushback that this is just Access-plus. On the other hand, business users seem to like it. LightSwitch is development with bumpers.”
He’s quick to add, however, that “It’s not Access, it’s using good architectural practices.”