The dance of the squares – Microsoft SignalR

25 05 2013

Every know and then an exciting technology is unveiled that can change the game of software development.
In my eyes Microsoft SignalR is one of this kind. It provides real-time messaging infrastructure via an Internet endpoint. It is fast and runs on a variety of different platforms, browsers and operating systems.
I have done a short demo video showing SignalR’s potential using Damian Edward’s / Patrick D. Fletcher’s MoveShape demo deployed to a Windows Azure Website.
This approach has the advantage that message transport run-time is pretty realistic, which is not the case, when backend and clients run on the same development system (localhost).

For the demo I have collected a zoo of devices from friends and colleagues to show You the potential of the new technology on PC, IPad, MacBook Pro, Windows Phone 8 and Windows 8 Surface RT.

Btw., all devices in the demo connect via WiFi to the Internet, except Windows Phone 8, which uses it’s built-in UMTS connection to access the Azure SignalR hub.

SignalR can be used in a number of interesting ways (event router, RPC mechanism) and in contrast to a lot of other technologies in this area, it is pretty simple to implement.

 

Take a look and have fun!

Alexander





MVC WebAPI – Help, my Attributes do not work!

17 05 2013

When building applications for the “Internet of Things” MVC WebAPI is a great infrastructure for solutions on device as well as in the backend.

In nutshell, the trick trick is that controller endpoints, normally used by the Razor engine to request business logic for web pages, can be used as endpoints on the network remotely. these e.g. can be consumed by HTML 5 single page applications or services running on devices. This is a very interesting technology and quite an enabler.

I am currently working on a few new courses under the “HTML 5 for .NET developers” headline and ran into this interesting effect.

I created a controller to be my custom base controller:

using System.Web.Http; namespace MvcApplication1.Controllers {     public class CustomBaseController : ApiController    

{

         // Add logic here    

} }

It inherits from APIController to make it a WebAPI controller.

Next, I added a new controller in VS 2012 to inherit from:

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; namespace MvcApplication1.Controllers {     public class MyController : CustomBaseController    

{         //         // GET: /GetSomeResult/

         [HttpGet]        

[ActionName("GetSomeResult")]        

public string SomeResult()

{

const string SomeResult = "Result";

return SomeResult;

         }   

} }

 

At my method, I used the ActionName attribute to change the outward facing name of the method for configuration of name and access type and – unfortunately – got a strange result.

When calling the service it came back with this error:

image

MVC Routes were set correctly, so I was a bit puzzled at first.

A bug? Not probable looking at this basic functionality.

After playing around for a while I have found the cause:

It is the System.Web.MVC reference in the controller that is causing this behavior. This is added automatically, if one chooses Add| New Item| MVC 4 Controller Class in VS 2012, as I did.

In System.Web.Mvc types for MVC method attributes are defined. The problem is that this is not the correct reference for a WebAPI Controller, but for a standard Razor MVC Controller!

WebAPI controllers need to use identically named attribute types in System.Web.Http!

Due to the fact that I did not inherit directly, but via my custom base class (CustomBaseController), from APIController, nor the compiler or IDE did find this type ambiguity and did complain.

As soon as you replace System.Web.Mvc with the System.Web.Http reference, all works fine.

using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Http; namespace MvcApplication1.Controllers {     public class MyController : CustomBaseController

     {        

//

         // GET: /GetSomeResult/

         [HttpGet]

         [ActionName("GetSomeResult")]

         public string SomeResult()

         {

             const string SomeResult = "Result";

             return SomeResult;

         }

    } }

image

 

Alexander





Join us at ADC C++ 2013 – 07.-08. May

3 05 2013

Please join my colleague and friend Reiner Gerczuk (Microsoft) and me at this years Advanced Developer Conference C++ 2013 in Bad Aibling, next week Tuesday and Wednesday (07.-08. May). We are going to present cool stuff featured in the brand new Microsoft embedded operating systems: Windows Embedded Compact 2013 and Windows Embedded 8 Standard.
Great native code needs reliable platforms to run on!
Get ready for stunning features, cool demos and a lot of fun, here in Bavaria.

Looking forward to see You all. :-)

Alexander





MVP Award 2013 Windows Embedded

19 04 2013

 

MVP_Horizontal_FullColor

Very happy to announce that I was just rewarded with the Microsoft Most Valuable Professional Award 2013 in the Windows Embedded expertise area.

wlEmoticon-smile.png

Alexander





Here comes embedded version 8!

1 03 2013

Microsoft has just announced GA (i.e. global availability) for Windows Embedded 8 Standard and Windows Embedded 8 Professional to be March 20th, 2013.
Windows Embedded 8 Industry will be released soon after on April, 1st.

Embedded 8 Standard is the componentized version of the Windows 8 desktop OS for creating custom operating system images, while Embedded 8 Pro is the Win 8 Pro version under a specific embedded license. Embedded 8 Industry was formerly known as POSReady and WEPOS and is a vertical version for retail and industrial automation. No friends, no real-time here, look at Embedded Compact 2013 to get this :-) .

Have fun,

Alexander

 





Cool Kinect use case – Marionettebot

15 02 2013

Just ran into a very cool use case rgarding the Kinect for Windows device:

Check it out!

Btw., there is a quite nice Kinect course running at Wechsler Consulting!

:-)

Alexander





Workflow

5 02 2013

Yes, I know that everybody is doing apps!

But, if you look at these, most are games, do content delivery or have a little just a small meaningful action to circle around, which is fine for just 0,99€.

In the coming weeks and months I predict that a lot of developers are going to recognize that this is fine for a start, but if you want to solve real practical problems apps are just not enough. Real solutions incorporate complex workflows and provide flexible interfaces into a lot of directions. They also span a variety of devices. 
Do not get me wrong! Apps can and will play a role in these solutions, but may only be a small part of them, e.g. as mobile user interfaces (where they are really good, btw.).

One of the great challenges in a bigger solution is to cope with workflows and the constant change they are undergoing in real life. Business processes may change day by day and this, of course, needs to be reflected in the digital solution for this process.

For all, who have not forgotten that there still is something called .NET, a deeper look into the Workflow Foundation Framework is absolutely recommended.
I did this over the last few days and am very excited about the possibilities. It made me dream about flexible applications loading updated workflows on online systems without downtimes, business analysts drawing “their” process for developers in WF Designer, which is able to spit out real code or code-stubs.
And wait, there is more: even state machines can be created and maintained by this powerful technology.
This is very interesting for a lot of embedded device applications, where state machines are  a requirement all the time.

So, if you are tired of writing HTML5 and JavaScript spaghetti code and its imminent limitations, or you got a bloody nose managing memory in a multithreaded native C++ application, take a few hours to revisit good old managed code and experience the fun and productivity of strongly typed, garbage collected code, supported by mature tools.

 

Winking smile

Alexander








Follow

Get every new post delivered to your Inbox.