Talking About the Internet of Things

A few weeks ago I had the opportunity to spend a few minutes with my friend, Richard Campbell (of DotNetRocks) talking about the Internet of Things at the Channel 9 Studios. You can watch the video here (it is less than 10-minutes).

devInt_Show3

This show is part of a countdown show to DevIntersection2016 in Orlando, FL. My team and I will be running a ThingLabs IoT Workshop on Monday, April 18th (if you want to attend, register with discount code SEVEN to save $50 plus a Raspberry Pi 2 kit complete with lots of sensors, and some cool add-ons from the conference, such as a Microsoft Band 2, Surface 3 or XBox One depending on how many workshops you attend).

Here is the abstract:

This is a hands-on workshop. You must bring your own Windows 10 laptop with Visual Studio 2015 Community (or higher edition) installed.

The Internet of Things (IoT) is the latest in an ever growing realm of technology that modern developers have to know about. To get into the IoT you have to learn about small form-factor and low-energy devices that interact with the physical world, and you have to know the Cloud services that will interface with these devices, for both data ingestion and command and control. In this full-day workshop you will learn both sides of the IoT. You will begin by diving into the world of Things by building applications that run on the Raspberry Pi 2, running Windows 10 IoT Core – a small form-factor variant of the popular Windows 10 family. Once you have mastered the world of Windows 10 IoT Core, you will learn how to connect the Thing you built to Azure IoT Hubs – a new Azure service designed to support millions of devices sending millions of messages. You will build an data ingestion pipeline, including visualizations of your IoT data that enable you to gain insight into your solution, and a command capability that enables you to control your device remotely. By the end of the workshop you will have built a complete Windows and Azure IoT solution – and you may keep the hardware kit to continue your adventure in IoT.

The goals of this workshop are:

  • Educate developers on the IoT stack offerred by Microsoft
  • Educate developers on the Universal Windows Platform (UWP)
  • Educate developers on the Azure services related to IoT

By the end of the workshop a participant will be able to:

  • Build an IoT device using the Raspberry Pi 2 (RPi2)
  • Build a UWP app for Windows IoT Core to run on the RPi2
  • Use Windows IoT Core and the RPi2 to both capture input and present output
  • Create and configure an Azure IoT Hub
  • Connect their UWP application running on the RPi2 to Azure IoT Hubs
  • Build a data pipeline that captures data coming into IoT Hub and stores it
  • Build a visualization of IoT data
  • Build a client application that can send a command to the IoT device via Azure

See you in Florida!

Overcoming the New Visual Studio UI

In a blog post last week, Monty Hammontree, the Director of User Experience for Visual Studio, announced the UI refresh for Visual Studio. This is a project that I had some involvement in (mostly as a reviewer) while still at Microsoft, and have been waiting patiently for this announcement so that I could talk about it.

iconRefreshPersonally I love the new UI. Sure, its not perfect, but it is a huge improvement over where Visual Studio has been for the past ten years. What is surprising to me is the amount of negative reaction the blog post has gotten. Some of my favorite comments from the blog post are:

Okay, i get wanting to reduce distraction and “lighten” the UIs feel… but GEEZ! Why do good ideas always get taken too far? This UI is SO bland and SO dead, I’d be afraid of it putting me to sleep on the job as opposed to reducing distractions. ICH! – Aaron – 23 Feb 2012 10:20 AM

Is it a desktop app?  Is it a metro app?  Decide and stop mangling the two UIs together.  The capitalized titles hurt my eyes.  They’re distracting and out of place. – Mike – 23 Feb 2012 10:26 AM

…While I do like introducing simplicity, I won’t be installing this if there is no option to replace these very low contrast lay-outs. And I’m pretty sure other people will don’t want to upgrade to this either, which will cost you some Metro developers in the long term… – Tom Wijsman – 23 Feb 2012 10:31 AM

Windows 3.1 is back? – Andrey – 23 Feb 2012 10:52 AM

The monochromatic color scheme is so bad it is distracting.  Instead of staying out of the way, my eyes are drawn to just how bad it really is…It is so bad and so distracting that a new word should be created to describe how bad and distracting it is…like baddistracting or bastracting.  The monochromatic scheme is bastracting and should be stopped. – jparramore – 23 Feb 2012 11:38 AM

Anyway, you get the point. There is a lot of negative reaction to the new UI. But is the new UI really that bad. Is it possible that it is actually a significant improvement, and we, the develoeprs who use and love Visual Studio, are just not ready to accept change?

A Bit on Metro

The Metro design echoes the visual language of an airport or metro system signage in both its design and typeface. The goal of the Metro design style is to create contextual relevance through content – primarily icons. Icons should be clear and understandable, and leverage real-world metaphors that are familiar to users. They should have simple geometry and limit the amount of fine detail.

Simplicity is the key. Every icon should be as simple as it can be (and no simpler). The primary purpose of the action the icon enables should be clearly and cleanly represented by the icon.

420.xamlLook all around your life and you will find these icons. They are not only on airport and metro signs, they are on your electronics, your clothing tags, and the dashboard of your car. You are so used to seeing Metro style icons, that you have developed an ability to quickly understand instructions and information based on a simple icon.

Metro style’s main goal is to make understanding information and instructions at a glance easy. The challenge is always balancing what you need to know with how much you can consume. For example, look at the laundering instructions on a piece of clothing. There could be 5 or 6 icons there, some of which you may not understand. That is likely because they are not within your domain, or context. I guarantee you that anyone working in a dry cleaning facility understands them all at a glance.

A Good Metro Implementation Focuses on Content

I think of the dashboard of my car, an Audi A6, as a great Metro style implementation. It provides me easy access to the information that I need in context, and easy way to switch context (e.g. between audio entertainment and navigation), and draws my focus and attention to the content that matters (speed, RPMs).

IMG_0087-2

Most command buttons have an easy to understand icon (seat heaters, parking brake, fans, etc.). Some things use text (On/Off, Nav, CD/Aux, etc.) instead of icons. In either case it is easy to quickly infer the meaning and intent of the button. All of the command buttons and interfaces are the same color – white icons and text (redish backlight if its dark) on a black button. Essentially a monochromatic UI that makes finding and using the commands easy, but focuses my attention on the important stuff – warnings and content.

    • Warning information is indicated with a different color than the rest of the UI. For example the “Passenger Air Bag Off” warning and the check engine icon are both yellow.
    • Content that requires my focus and attention is white, such as the speedometer and tachometer, and the navigation screen (which includes a small set of other colors to indicate route, landmarks and warnings).

I can’t imaging how distracting it would be to drive my car if every icon and button were a colorized button. It would make finding and focusing on the important content much more difficult. As it is, I know to focus on the white content, and pay extra attention to any yellow content.
The new Visual Studio UI is attempting to do exactly what my Audi dashboard does. Make it easy for you to find information and commands, but draw your focus and attention to the content that matters most (aka your code).

Resisting Change

The fact of human psychology is that we tend to resist change before we embrace it. This seems to be the tone of many of the comments on Monty’s blog post. Many people are likely going through the stages of grief – Shock, Denial, Anger, Bargaining, Depression, Acceptance.

    Many people seems to be in the first four or five stages.

Shocked by the change.

WO WO WO. Let’s get one thing straight. There had better be a GIANT button in there to “MAKE IT LOOK LIKE IT USE TO.” – Don’t “Windows 8” me! – 27 Feb 2012 3:07 AM

Denying the change.

Why not keep the current GUI? it seems that your vs11 will be the worst design ever… please, see all these post, reconsider your transition… – ammin – 26 Feb 2012 5:15 AM

Anger toward Microsoft for the change.

I assume these god damn awful UI changes are meant to hide the lack of real changes over VS2010? – Steve – 27 Feb 2012 10:56 AM

Bargaining with Microsoft regarding the change.

Folks, we need to organize & mobilize to fight this: talk to your co-workers, give them link to this page, ask them to comment here. – Dee – 25 Feb 2012 9:32 AM

Depressed about the change.

Don’t care.  It is what it is and nothing anyone says here can change that. – Not Anal – 27 Feb 2012 12:12 AM

Its not clear to me that the mass of Visual Studio developers will reach acceptance of the new UI, nor is it clear to me if the bargaining will result in change. I like to believe that both will happen.

The Path Ahead

My opinion is that this is a step in the right direction. Of course, its near impossible to actually tell if its an improvement with out extended usage of the new UI, to see if it improves my productivity or not. This means that for many people there is likely a step of “testing” that must occur prior to acceptance. The testing may be challenging at first because we have to unlearn a few old things in order to learn some new things. Like the Audi dashboard example above, this happens almost anytime you buy a new car as well. Basically things work the same – there is a speedometer and tachometer, although they may be in reverse positions from what you are used to; there is a console for controlling audio, heat and AC and possibly navigation; and there are warning indicators, but possibly different ones, or they are in different positions. Testing the change requires a little patience in order to fully determine if the change is manageable – that is to say, you may not be able to affect the change, but you can determine your acceptance of the change.I encourage everyone to withhold judgment until you’ve had a chance to try the new Visual Studio UI. Once you’ve given it a fair chance, provide actionable feedback to the team via Monty’s blog (e.g. “There had better be a GIANT button in there to “MAKE IT LOOK LIKE IT USE TO.” isn’t really actionable).

As someone who leads product development, I can tell you that there is nothing more important than hearing from customers. It is the challenge of the product development team to determine actionable, real feedback from shock, denial, anger and depression driven feedback. A good product development team will be innovative and creative, and it may not immediately resonate with the customer, but if they’ve done their job right, the customer will accept and embrace the change in the long run, and have a better product experience as a result.

My favorite Henry Ford quote:

If I asked my customers what they want, they simply would have said a faster horse.

Henry Ford went on to introduce a radical change and innovation, that was met with both immediate acceptance and criticism. Can you imagine if that change had not been widely accepted?

Goodbye Microsoft. Hello Telerik.

If you keep up with me on Twitter you know that last Friday was my last day at Microsoft. I joinned Microsoft as a vendor in 2004 after I sold my company (dotnetjunkies.com) – I was hired in to fix a broken community program that dotnetjunkies had been part of, and a few months later accepted a full-time position to implement the supporting infrastructure. It was my second tour of duty (my first was in 1999-2000, where I met my dotnetjunkies partner). Over the past seven years I was fotunate enough to have some great experiences running a development team, and owning the product management of one of the most successful and widely used IDEs on the planet, Visual Studio. Itwas a good run, but it was time for a change.

Today was my first day as an empployee of Telerik – whom I believe to be a fantastic company that is doing some very innovative work, and working in a very agile way. While today was uneventful (travel day from Seattle to Boston for my onboarding and a management summit), it was a good day. I spent a lot of time thinking about what is to come. About the excitement the coming months and years will bring. I thrive in fast moving, agile, start-up style environments and expect that the culture at Telerik will suit me well.

There is of course an immense pressure that I feel as well – I supose anyone transitioning jobs, especially after seven years, is likely to feel a sense of pressure to prove themself quickly. My hope is to balance that pressure with the common sense to not try too hard too soon. A friend of mine gave me a book a while back – The First 90 Days: Critical Success Strategies for New Leaders at All Levels by Michael Watkins. This is a great (and short) read for anyone moving into a new leadership postition either in a new company, or a company you already work at. The cornerstone is to understand why you were brought in, and implement a matching strategy for the first pivitol 90-days. The wrong strategy, while successful in another situation, could spell dissaster. The right strategy – one that matches the purpose for you to move into the role – should yield good or better (potentially stellar) results.

As I embark on my first 90-days, I plan to share what I can. Telerik has a reputation for being very connected to the community, as I have been for over a decade. If you’re interested, then plan to hear from me regularly as I share the amazing work we are doing here at Telerik.

D7

Visual Studio LightSwitch Feature Matrix

On his blog yesterday, Soma (Sr. VP of Developer Division at Microsoft), announced that Visual Studio LightSwitch Beta 2 will be coming soon. I can tell you, we are really excited about LightSwitch, and apparently you are too (you’ve downloaded over 100,000 copies of Beta 1).

One question that comes up a lot is, what can LightSwitch do versus what can Visual Studio Professional do? What’s the difference? Well, the difference is pretty clear.

Visual Studio LightSwitch is a specialist tool for building line-of-business applications for the desktop and cloud, while Visual Studio Professional is a generalist tool for building anything you can imaging for Microsoft platforms.

Take a look at this feature matrix and you’ll see what I mean (we’ll get a formal version of this up on http://www.microsoft.com/lightswitch soon).

Visual Studio LightSwitch

Visual Studio Professional

LightSwitch Runtime

Yes

Yes1

Visual Studio Project System

Yes

Yes

IntelliSense

Yes

Yes

Team Explorer (Team Foundation Server integration)

2, 3

Yes3

LIGHTSWITCH APPLICATION DEVELOPMENT

Predefined Screen Templates

Yes

Yes1

Application Skinning and Theming

Yes

Yes1

Data Entity Designer

Yes

Yes1

Business-oriented Data Types (e.g. EmailAddress, PhoneNumber, etc.)

Yes

Yes1

Automatic Data Input Validation

Yes

Yes1

Windows Azure Deployment

Yes

Yes1

SQL Azure Support

Yes

Yes

LANGUAGES, EDITORS & COMPILERS
Visual Basic

Yes

Yes

Visual C#

Yes

Yes

Visual C++

Yes

Visual F#

Yes

HTML/JavaScript

Yes

Silverlight/XAML Editor

Yes

PROJECT TYPES
LightSwitch Application

Yes

Yes1

ASP.NET

Yes

ASP.NET AJAX

Yes

ASP.NET MVC

Yes

Console Application

Yes

Database Projects

Yes

Office Applications & Add-ins

Yes

Setup Projects

Yes

SharePoint Applications & WebParts

Yes

Test Projects

Yes

Visual Studio Add-ins

Yes

Windows Forms

Yes

Windows Phone

Yes

WCF

Yes

WPF

Yes

XNA Games

Yes

1 Only available for LightSwitch applications. Requires Visual Studio LightSwitch and Visual Studio Professional to both be installed.
2 Team Explorer will integrate with LightSwitch but must be installed separately.
3 Requires a Team Foundation Server Client Access License (CAL).

I hope that helps!

D7

Data Storage in Visual Studio LightSwitch

With the recent release of Visual Studio LightSwitch Beta 1 to MSDN Subscribers, I have gotten a few questions. As questions come in, I’ll do my best to answer them here. One of the first questions I got was about how LightSwitch applications manage and store data source connection information – aka connection strings.

 

Question: In a Visual Studio LightSwitch application, where is the connection string to the database being stored?

LightSwitch applications can work with several types of data, including “local” application data, external SQL Server or SQL Azure data (or any other database supported by the .NET Framework), SharePoint data, and other external data exposed through WCF RIA Services. If you choose to get data from an external source, the Attach Data Source Wizard shows you your options.

Choose DataSource

On the other hand, the “local” application data is a reference to a SQL Server Express database that is created if you choose the “Create new table” option as shown here.

AddTable

This application data is defined and stored in a local SQL Server Express database. For example, in the Vision Clinic demo we have used, the first step was to create a new table to store Patient data. in fact, in the demo we are defining an entity model, and creating a Patients (plural) table in the local application database using SQL Server Express. Notice in the following image that in the Solution Explorer there is a Data Sources node containing an ApplicationData node containing a Patients node. Patients is the table that was created in the ApplicationData database.

 

AppData2

The ApplicationData.mdf file is a SQL Server Express file that is created and stored in the $ApplicationRoot\bin\Data directory. When connected to with Server Explorer, you can see that the Patients table is there, along with the ASP.NET membership tables.

ServerExplorer

So where is the connection string to this database stored? In a Web.config file that is created in the $ApplicationRoot\bin\release directory.

<connectionStrings>
  <add name=”_IntrinsicData” connectionString=”
    Data Source=.\SQLEXPRESS;
   AttachDbFilename=’c:\users\seven\documents\
   visual studio 2010\Projects\VisionClinicDemo\
   VisionClinicDemo\Bin\Data\
   ApplicationDatabase.mdf
‘;
    Integrated Security=True;Connect Timeout=30;
    User Instance=True;MultipleActiveResultSets=True” />
</connectionStrings>

When the application is published (Build | Publish menu), the Publish Application Wizard asks if you want to publish the database directly to an existing database, or if you want to generate a script file to install and configure the database

PubWIzard

If you choose to publish to a database, you are then prompted to provide the database information.

PubWizard2

If you choose to create an install script file, you are prompted to describe the database that will be scripted.

PubWizard3

PubWizard4

All in all this is the standard approach to managing database connections in a multi-tiered application. The Web.config in the application tier contains the database connection information. As will all Web.config files, you may encrypt the connection information.

 

But what about the connections to other data sources, like SQL Azure or SharePoint?

A connection string is a connection string is a connection string. They all get stored in a the Web.config file.

<connectionStrings>

<add name=”_IntrinsicData” connectionString=”Data Source=.\SQLEXPRESS;AttachDbFilename=’e:\my documents\visual studio 2010\Projects\VisionClinicDemo\
VisionClinicDemo\Bin\Data\ApplicationDatabase.mdf’;
Integrated Security=True;Connect Timeout=30;User Instance=True;MultipleActiveResultSets=True” />

<add name=”PrescriptionContosoData” connectionString=”Data Source=server01.data.int.mscds.com;Initial Catalog=PrescriptionContoso;User ID=[removed];Password=[removed]” />

</connectionStrings>

Of course, all of the data in a LightSwitch application is represented by entities. The entities are defined in the ApplicationDefinition.lsml file (stored in $ApplicationRoot\Data). This is simply a reference to the data source(s) represented by the entities in the application. Each data source is described in this file, and the entities representing the data objects are described here as well.

<EntityContainerGroupProperty EntityContainer=”VisionClinicDemo:ApplicationData”
Name=”ApplicationData” />
<EntityContainerGroupProperty EntityContainer=”VisionClinicDemo:PrescriptionContosoData”
Name=”PrescriptionContosoData” />
</EntityContainerGroup>

<DataService DataProvider=”EntityFrameworkDataProvider”
EntityContainer=”:PrescriptionContosoData” Name=”PrescriptionContosoDataDataService”>
<DataService.ConnectionProperties>
<ConnectionProperty Name=”DataProviderName” Value=”91510608-8809-4020-8897-fba057e22d54″ />
<ConnectionProperty Name=”DataSourceName” Value=”067ea0d9-ba62-43f7-9106-34930c60c528″ />
<ConnectionProperty Name=”ProviderInvariantName” Value=”System.Data.SqlClient” />
<ConnectionProperty Name=”SafeConnectionString” Value=”Data Source=server01.data.int.mscds.com;Initial Catalog=PrescriptionContoso;User ID=admin01@server01″ />
<ConnectionProperty Name=”ConnectionStringGuid” Value=”1e9905dc-b519-4003-9387-1272a768b256″ />
<ConnectionProperty Name=”ProviderManifestToken” Value=”2008″ />
</DataService.ConnectionProperties>

</DataService>

 

Summary

All in all, LightSwitch applications are built using standard best practices. In the case of connection strings, they are stored in Web.config files in the application tier, and have all the support of ASP.NET configuration files, including encryption.

D7

Myth Busting Visual Studio LightSwitch

Earlier this week, at the VSLive conference in Redmond, WA (on the Microsoft campus) Jason Zander announced a new Visual Studio product that we’ve been working on – Visual Studio LightSwitch – the simplest way to build business applications for the desktop and cloud.

This is exciting for us – we’ve been working on this product in secret for some time now. Finally we are able to share this work with the world.

Of course, as can often happen, the announcement was followed up with some confusion. Since we aren’t releasing the Beta 1 bits until August 23, 2010, no one (other than the 700 people at VSLive using the hands-on-labs) can actually see LightSwitch in action and get a feel for it. As a result, there is some confusion around what LightSwitch is, what it does, and who should use it. So let me try and dispel a few myths.

Who is LightSwitch for? Who should use it?

LightSwitch is intended for anyone who needs to quickly and affordably create line-of-business applications. LightSwitch is also an ideal tool for professional developers who need to build great-looking custom applications and want to kick start the development with a business application based on the LightSwitch templates.

How is LightSwitch different than Microsoft Access?

Access provides the tools to build and maintain database applications. LightSwitch provides the tools and templates to develop line-of-business applications that can pull data from Access, SQL Server, SQL Azure, SharePoint and any data provided by a WCF RIA Service (Access is not a supported data source in Beta 1). LightSwitch applications can run on the desktop, a web server or in the cloud. As the needs and usage of the application grow, because LightSwitch applications run on the .NET Framework, and use the Visual Studio project system, they can be opened in Visual Studio 2010 Professional and higher, enabling more sophisticated customization of the application.

Can LightSwitch make LOB applications for Windows Phone 7?

LightSwitch is intended for building line-of-business applications that connect with existing applications, legacy systems, Web services, and the cloud. LightSwitch includes support for a variety of form factors, however; development for applications running on mobile devices is not supported at this time. LightSwitch supports publishing applications to the desktop, a web server, or the cloud (publish to cloud is not available in Beta 1).

Does LightSwitch use WPF for desktop applications, and Silverlight for Web applications?

LightSwitch currently creates Silverlight 4 applications. Since Silverlight 4 supports running out-of-browser, or in-browser, LightSwitch can easily generate the application form factor that you prefer.

How do I open a LightSwitch application in Visual Studio Pro?

There is no magic here. LightSwitch is a Visual Studio product. It uses the Visual Studio shell, and the Visual Studio project system. LightSwitch applications are Visual Studio applications. To open a LightSwitch application in Visual Studio 2010 Professional, simply open the .lsproj (LightSwitch Project) or .sln (Solution) file. Of course, you will need the LightSwitch runtime to support the application. If you have Visual Studio 2010 Professional (or higher) installed, simply install Visual Studio LightSwitch. The LightSwitch runtime and LightSwitch project templates will be installed and available through Visual Studio 2010.

When I define a new data source in LightSwitch, what is being created?

LightSwitch can work with several types of data sources, including Access (not available in Beta 1), SQL Server/Azure and SharePoint. If you decide to create a new data source (aka Application Data in LightSwitch lingo) you are defining a new SQL Server database. Under the covers LightSwitch uses SQL Server Express and creates a new ApplicationDatabase.mdf file for the new, local application data. You can also define new tables in other connected data sources (provided your credentials have the permissions to create tables). For example, you can connect to an existing SQL Server or SQL Azure data base, and choose the Add Table option to create a new table on your remote data source. If you don’t have the appropriate permissions, the Add Table option will not be available (as shown here).

How is LightSwitch different than WebMatrix?

WebMatrix is a tool that includes a Web server (IIS Developer Express), a database (SQL Server Compact), and programming framework (ASP.NET). WebMatrix makes it easier to create new websites from scratch, or use Microsoft’s Web Application Gallery to customize popular ASP.NET and PHP open source community applications. It is targeted at non-professional developers, primarily. Although WebMatrix seamlessly integrates with Visual Studio’s professional development tools, it’s not related to LightSwitch. In contrast, LightSwitch is targeted at professional developers looking to create custom LOB applications leveraging data from multiple sources that can be easily deployed to the desktop or cloud.

Does LightSwitch support version control?

Yes. LightSwitch comes with the Visual Studio Team Explorer installed making connecting to Team Foundation Server easy.

Does LightSwitch support custom controls?

Developers can create custom controls, themes and skins for LightSwitch applications. This is done in Visual Studio 2010 Professional and made available as a vsix installation (the Visual Studio Gallery is supported).

LightSwitch is great for developers (also overheard as ‘No it isn’t’)

Its important to understand the role LightSwitch will play in the world of a professional developer. If you are a Coder™ (make your living, or aspire to make your living writing code), LightSwitch may not be for you. Of course, you may use the LightSwitch runtime and project type inside Visual Studio 2010 Professional if you want to quickly build an LOB app or jump start some project development, but typically this isn’t you. The real user of LightSwitch is probably Code-Enabled™ (someone who has some basic coding skill – not like you – who will write or copy-and-paste code as needed to get what they need done). These are typically professionals in some industry who need apps for projects or specific needs, who you can’t be bothered with (think of the account manager who keeps asking you to build a tracking tool for them, and who you reject because you don’t have time). The reality is that there are a lot of Code-Enabled™ out there, and they will find a way to build what they need. The pain for you comes when their app “grows up” and you inherit it, are tasked with maintaining it, or worse yet, have to extend it. This is really when LightSwitch is good for developers. If the LOB app was built with LightSwitch, you are now inheriting a .NET based application, build on standard best practices (such as n-tier architecture with clear tier separation, data in SQL Server, proper data architecture, validation on the appropriate tiers, etc.). So while you may be thinking LightSwitch is not for you, it can still make your life better.

I promise more to come, including some demos. In the meantime, check out Jay Schmelzer’s The Anatomy of a LightSwitch Application Series.

D7