My Live! 360 sessions

This morning I arrived back home from my trip to Orlando, FL together with Marcel. It was a fun trip, where I got the opportunity to do two things: completing my final “exam” for becoming an official Xamarin University Partner Trainer and delivering my sessions at AppDev Trends, part of the Live! 360 2017 conference. It was weird to hear “I’m Dreaming of a White Christmas” and other assorted X-mas songs all day while the sun was shining through the palm trees in the tropical Florida scenery.

On Tuesday, I spent an intense but fun day with Rob Gibbens from Xamarin, going through the Xamarin University curriculum, presenting the material to him and exchanging tips. This was the final part of becoming a certified XamU trainer. My colleague Geert and I are currently the only official Xamarin University Partner Trainers outside the US. We can deliver 3 to 5 day on-site trainings that count towards the official Certified Xamarin Developer exam. Ping me for more info, or check out our website.

img_2796

The rest of the week I got to spend time at the Live! 360 conference at the Royal Pacific Resort in Orlando, FL. Live! 360 is a yearly conference that is a combination of several smaller conferences such as Visual Studio LIVE!, SQL Server LIVE!, TechMentor and AppDev Trends. I was invited to deliver two sessions in the AppDev Trends track, and the fun part is that attendees can pick and choose between the different tracks. My talks were centered around cross platform mobile development.

Here are the slide decks for my sessions:

Mobile DevOps Demystified with Xamarin, VSTS and HockeyApp

In this talk I introduced the concept of DevOps and the unique challenges that come with mobile. This talk was pretty demo-heavy, in which I showed how to set up a continuous delivery pipeline in VSTS Build & Release, in conjunction with Xamarin Test Cloud and HockeyApp. I also briefly introduced the brand new Visual Studio Mobile Center, which was announced last month at Microsoft Connect();

Overcoming the Challenges of Mobile Development in the Enterprise

Big enterprises can be a challenging environment for doing mobile development. There’s tension between existing architectures and processes and the innovation and speed that mobile requires. In this session I shared my experiences in mobile projects in bigger enterprise environments.

You can check out Marcel’s sessions on his blog.

Thanks to the AppDev Trends organisation and the speakers and staff of Live360 for another fun conference. And if you thought you could get away without another food post, think again… 🙂 We closed off in style with a great dinner at Emiril’s Tchoup Chop, where I enjoyed this mind blowing cocktail:

fullsizerender-6
Holiday Cocktail: home infused bourbon with apple, cinnamon, nutmeg, cloves and other spices, mixed with home made raspberry syrup and topped off with rosemary

Xamarin Evolve 16 – Conference Day 1

Day 1 of the Xamarin Evolve 2016 conference is a wrap! It was a full day for me… It started at 6:15am for the Mini-Hack 5k run, organised by Craig Dunn. A bunch of Evolve attendees went for a leisurely run in the area, thereby unlocking the first Evolve Mini-Hack.

Keynote

After a refreshing shower and some breakfast, it was finally time for the keynote. The one impression I had after this keynote is: Xamarin is on fire! The keynote was huge. A big stage, an enormous screen and 1700+ excited people in the room anticipating what Xamarin would be announcing.

I made a sketch note out of my personal highlights:

FullSizeRender 10

A lot of topics were covered. I want to share the ones that stood out to me:

open.xamarin.com
The Xamarin team has been working hard to release the Xamarin platform and its surrounding frameworks as Open Source Software on Github. This morning it was released to the public. You can find it via open.xamarin.com, or directly on GitHub. This must be a breakthrough moment for Miguel! Congratulations to the whole team for this achievement, and thank you for being such strong believers in OSS.

FullSizeRender 11

It made sense that Xamarin was closed source when it was their bread & butter. But now at Microsoft, with their fresh new attitude towards open source, it’s great to see Xamarin added to that array of OSS products and frameworks.

FullSizeRender 13

Xamarin Studio 6 Release Candidate
The Release Candidate for the latest version of Xamarin Studio is available now in the Beta channel. This is a very nice release, which features a Dark Theme, a complete visual overhaul to fit with the UX guidelines for OS X El Capitan and built-in Roslyn support. I’ve been working with the preview version on and off and it has matured a lot. I really like the new polished look and the more stable code editor thanks to Roslyn. One of the most notable changes is the Broken State Support, so that IntelliSense doesn’t blow up if there’s a syntax error a few lines above.

iOS Simulator for Windows
The new iOS Simulator was already presented briefly in the //build/ keynote by Miguel. However today Miguel showed how pen pressure input on a Surface Pro running the simulator is passed through to the iOS Simulator which runs on a Mac somewhere in the network.

Xamarin.Forms
The cross platform UI framework, Xamarin.Forms, is becoming more and more mature. This update brings support for so-called DataPages: a ready built and styled set of views that you can feed Azure Mobile Services data or local storage of JSON data. This is a higher level abstraction that lets you set up data driven pages very quickly, but I’m not sure how suited this is for production scenario’s. There is no MVVM in play – at least not for the developer, maybe behind the scenes – to tweak the behaviour. And you know me when it comes to abstractions… 🙂

A feature I did like *a lot* is the ability to drop in a native UI control directly into a Forms layout hierarchy. It’s called Xamarin.Forms Native Embedding. So you can now add a native Floating Action Button to your Android app without the hassle of writing a Renderer, etc.

And then…

The Xamarin Forms Previewer is a built in player for your Xamarin.Forms markup code that gives you Gorilla Player like direct feedback inside Xamarin Studio while you’re editing your pages. This is so awesome, because it speeds up the development cycle tremendously! Definitely one of my favourite announcements from the keynote and Nina Vyedin did a great job presenting it.

Xamarin Workbooks
Miguel already talked about Xamarin Workbooks at //build/ and he showed us how the tool is progressing. Workbooks is a fantastic tool for teaching and communicating about code. My pal Marco already alluded to this in his blog: it’s a nice visual way to teach children to code for example. I’ve been doing some classes for the Dutch “hour of code” initiative called CodeUur.nl and I’m thinking about using Workbooks as a tool for that. In any case, it’s clear from the keynote that Workbooks is Miguel’s favourite project at the moment. And rightfully so.

HockeyApp, Insights and Test Cloud Live!
After the Microsoft acquisition, the mobile DevOps toolset at Microsoft is pretty complete. As became clear in the Keynote, Xamarin Insights will merge into HockeyApp to become a compelling tool for deploying and monitoring apps. Donovan Brown from Microsoft came on to rub some DevOps on all of this and walked us through those tools.

The keynote ended with a sweet “one more thing” moment: the announcement of Test Cloud Live. Wow! Ever had your app crash on some obscure device and had a hard time tracking down that bug? Well, now you can attach your debugger to that device in the Xamarin Test Cloud and start debugging your app! Mind blown!

giphy

Bear in mind that you’re debugging over a network connection to a device that sits in the Xamarin Test Cloud device center in Denmark, and the technology is early preview, but this is so promising!

I was amazed by all the announcements, especially how fast Xamarin was able to open source all of their stuff and release the new goodies.

Breakout sessions

For the breakout sessions, I mainly looked for sessions that were not so much technical, but more inspirational to get some nice new ideas.

Contextual CommunicationBrent Schooley
Brent is from Twilio, who are experts in communication technology, but he did a great job not making this talk about Twilio. Instead, I found this an inspiring talk about improving and modernising business communication.

FullSizeRender 7

The main 4 tenets he highlighted are that communications should be:

  • Contextual: what do you already know about the user/customer? Context matters to make communication more personal and …
  • Streamlined: if you can leverage context, you can get down to the point quickly and make conversations as short as possible
  • Secure: again, if you leverage context and what you already know about a user, you don’t have to communicate that information again every time. This saves you from exposing security or privacy sensitive information.
  • Medium of Choice: the customer must be able to choose his/her medium of choice. So an app cannot be the only option. Some people prefer to call or use chat.

Brent demonstrated this with an inspiring demo-app where he started a call from inside a fictitious airline app, and had information (context) exchanged automatically into the app during the conversation to get through a transaction in a streamlined manner. He then used TouchID to verify the customer’s identity to finalize the transaction (secure).

He also covered the new “Bots” trend. With Microsoft’s new Bot Framework and Cognitive Services, we can build interesting things to make these conversations as contextual, streamlined and secure as possible and reuse that across different media. It remains to be seen if 2016 will indeed be the year of the Bot.

I really enjoyed Brent’s talk; he definitely made me think about interesting use cases to improve communications by looking beyond “an app for one single process”. This is what I will focus on at Xpirit for our Mobile strategy.

Clicking on the Real World with iBeacon – Jim Bob Bennett
Similar to the previous session, this session also worked as an inspirator for me to look beyond that one app on the device that your user interacts with. iBeacons are a great way to make the physical world your interface. For example: as I walk into a Starbucks, using iBeacon, they can recognise that I’m entering the shop and know which coffee they have to make so I can walk right up to the counter and pick up my double espresso and pay with my credit card linked to my Starbucks account. Cool. Jim Bob showed how to do this with the iOS CoreLocation API’s.

Unfortunately I had to leave the iBeacon session early, to be in time for my DevOps discussion panel at the Mobile Leaders Summit.

The Future of Connected Devices with Philips hue – Eric Shapiro, Sait Izmit, Mike James
To be honest, I was a bit disappointed with this session, as it was mainly a product placement session for Philips hue, driven by videos instead of much substance. The interesting part for me was Mike’s part in this case, where he showed how to develop against the hue bulb using the Q42.HueApi SDK.

FullSizeRender 6

Adventures in PerformanceMark Probst
This session was a deep dive on the way Xamarin does their performance benchmarking. It was a little bit different than I had expected, but interesting and entertaining nonetheless. I really appreciated Xamarin’s transparency: Mark spoke about some of the challenges they had in the Garbage Collector and the experimental ways they are trying to improve performance and bringing down GC pauses. Really some clever stuff!

FullSizeRender 14.jpg

No big lessons here, except appreciation of Xamarin’s transparency and respect for the smart guys working on the Mono runtime.

Xamarin Party!

In the evening, we celebrated Xamarin Evolve 16 at the Wizarding World of Harry Potter theme park. We took all the rides, including the crazy intense roller coaster and the big splash over in Jurassic Park. The food and the vibe were awesome!

I didn’t get to take many pictures, but there’s a lot of that going around on the #XamarinEvolve Twitter feed.

I’ll leave you with some inevitable food pics and some from the party 🙂

Dumplings #food #xamarinevolve

A post shared by Roy Cornelissen (@roycornelissen) on

Golden Snitch popsicles #food #xamarinevolve

A post shared by Roy Cornelissen (@roycornelissen) on

Jurassic Park! #XamarinEvolve

A post shared by Roy Cornelissen (@roycornelissen) on

T-Rex #xamarinevolve

A post shared by Roy Cornelissen (@roycornelissen) on

Xamarin Evolve 16 – Training Day 2

Time flies! The second day of training at Xamarin Evolve is over already and I just came back from the awesome opening party in the Darwin Lounge.

The main conference starts tomorrow. I’m honored to be on stage with some industry giants at the Evolve Mobile Leaders Summit track in a panel discussion about The Unique Challenges of Mobile DevOps. But that’s tomorrow!

About today: before the training, the day started at 6:15am (!) with a 5k test run with for the first Mini-Hack tomorrow morning. I spot an orange Xpirit T-shirt 🙂

The training part was another intense day from 9am-6pm, but it was a good day. I’d say the content of today was a bit better and deeper than what we learned yesterday, at least for me personally. We covered three major topics:

Securing local data
This part was all about dealing with data locally on the device, especially sensitive data in terms of privacy and security. We had a look at what the Xamarin.Auth component has to offer for local storage of sensitive data. This component (you can find it on GitHub and on Nuget) uses the platform specific facilities for storing data in a secure container, i.e. the KeyChain on iOS and a secure KeyStore inside the app’s sandbox on Android.

Be sure to get the latest 1.3.0 version of the Xamarin.Auth component though, as this is a bait-and-switch PCL library that also offers support for the Windows platform, whereas the older 1.2.x version doesn’t.

warning-stamp.png

There’s one caveat with the Xamarin.Auth component though… The KeyStore file on Android is locked with a hard coded password. The Android app in one of my previous projects was actually flagged in a security audit because they extracted the Xamarin.Auth DLL, decompiled it and found the hard coded key. Pretty iffy, because this means that the KeyStore data in every app that uses this library can be easily opened and read by extracting the file from the sandbox and using the key that’s publicly available on GitHub!

I made a pull request about 2 years ago that fixes this problem, at least in a way that you can provide your own key. But somehow Xamarin didn’t get around to merge it yet, so the vulnerability was still there, also in the 1.3.x version. The funny thing was that as we were doing the training, one of the Xamarin developers was actively working on this component. We pulled him into the training, explained the problem and he immediately went to work to see if he could merge my fix. How awesome!

FullSizeRender 4.jpg
How awesome is this: Xamarin Developer DNA… everyone could add their own string, picking the pegs that fit with their preference. The result is this awesome, unique “Xamarin DNA” sequence. A work of art!

The other part of this chapter was about the awesome PCL.Crypto component. This component is also a bait-and-switch PCL library, which means that the PCL portion contains nothing more than the API definitions for your shared code to compile against (the bait), but uses the actual device specific implementation at runtime (the switch). This means that PCL.Crypto can use the platform specific crypto API’s developed by Google, Apple and Microsoft themselves instead of relying on its own security implementation. Much the same as the Xamarin.Auth component solves its local storage issues. For developers familiar with the WinRT crypt API’s for example, there is a special WinRTCrypto API that you can program against, but PCL.Crypto will map this to the underlying native API’s. Pretty clever. For example: a method for encrypting some data could look like this:

public static byte[] Encrypt (byte[] plainText, byte[] keyMaterial)
{
  var provider = WinRTCrypto.SymmetricKeyAlgorithmProvider
    .OpenAlgorithm(SymmetricAlgorithm.AesCbcPkcs7);

  var key = provider.CreateSymmetricKey(keyMaterial);
  var IV = WinRTCrypto.CryptographicBuffer.GenerateRandom(16);
  var cipher = WinRTCrypto.CryptographicEngine.Encrypt(key, plainText, IV);

  var cipherText = new byte[IV.Length + cipher.Length];
  IV.CopyTo(cipherText, 0);
  cipher.CopyTo(cipherText, IV.Length);

  return cipherText;
}

PCL.Crypto can be used quite easily in combination with Xamarin.Auth to encrypt or hash data before storing it. At least as long as your app is using the not-so-secure version of Xamarin.Auth – with the hard coded key – using something like PCL.Crypto to secure the values that go into the secure storage is a real necessity! But it’s good practice to do it anyway.

OAuth
Next we went into OAuth for authorizing access to an API from a mobile app. OAuth in itself is a pretty broad topic and enough to fill tens of blogposts. One of the important points here is that for mobile apps, basically there are only two OAuth flows that are really usable:

Screen Shot 2016-04-26 at 22.50.26

The Implicit flow or the Authorization Code flow. The other flows aren’t really suitable for mobile apps (or browser apps involving JavaScript code), since this means that there will be client secrets hidden inside the app, and they involve dealing with a user’s password in the app itself instead of handing that off to an Identity Provider. The Client Credentials flow is typically used for service-to-service communication, usually on behalf of the user.

Xamarin.Auth provides some nice API’s to easily initiate a login sequence, using a web view that follows all the redirects that are part of the OAuth flow, to obtain an access token (or authorization code).

Memory Management Issues
The most interesting part of today was about diagnosing and dealing with Memory Management Issues. I actually learned a lot about how both the Xamarin.iOS and Xamarin.Android frameworks work in terms of memory allocation. It’s important to understand that in both cases, you are always dealing with native objects, managed peers and a binding layer in between, provided by Xamarin. At least, for those objects that are actual native platform classes.

Under the hood, there are some intricacies to be aware of. For example: in order for iOS’s reference counting mechanism to work, you have to be very careful to release references to native objects, for example by making sure to always unsubscribe from event handlers. For Android, it’s important to realise that you’re working with two Garbage Collectors: the Mono one and the one in the Android Java VM. There are a lot of details, but there is some nice guidance up on the Xamarin Developer site about this [iOS] [Android].

You can prevent a lot of memory issues by following a couple of important guidelines. Also the Xamarin Profiler is a great tool for diagnosing possible memory leaks.

Lots of excitement for the opening of the Darwin Lounge at #XamarinEvolve

A post shared by Roy Cornelissen (@roycornelissen) on

 

Darwin Lounge
As for the (other) fun part of Evolve: the Darwin Lounge was opened this evening, accompanied by a huge buffet and a nice range of tasting stands for artisanal chocolate, local beers and hipster coffee 🙂 This tweet sums up how I felt this evening:

It’s no secret that I’m an avid foodie, so suffice to say that I was in seventh heaven when it comes to the food that was served here. This means that you have to sit through my Instagram food porn pictures now:

Excellent chocolate. The Phillipines one is a clear winner #food #XamarinEvolve

A post shared by Roy Cornelissen (@roycornelissen) on

 

I expected to visit a mobile dev conference but instead I've come into food discovery heaven. #XamarinEvolve #coffee

A post shared by Roy Cornelissen (@roycornelissen) on

 

Great hipster pour-over coffee at #XamarinEvolve

A post shared by Roy Cornelissen (@roycornelissen) on

 

Hmm, macarons #XamarinEvolve #food

A post shared by Roy Cornelissen (@roycornelissen) on

 

Beer tasting at #XamarinEvolve. Local beer from Orlando Brewery. Good stuff.

A post shared by Roy Cornelissen (@roycornelissen) on

 

 

So… Xamarin sure knows how to throw a party 🙂 Of course, the Darwin Lounge at Evolve is mainly about cool geek stuff and tech inspiration. There’s lots of that going on as well. Lots of IoT stuff, drones flying around, etcetera. Check out the Twitter timeline for #XamarinEvolve for a great impression of the fun things out there.

IMG_0946
Great buzz and lots of hacking going on in the Darwin Lounge
IMG_0944
These robot spiders are pretty creepy!
IMG_0943
LEGO Mindstorms, totally cool! Their official iPad app for programming the Mindstorms robot was built with Xamarin

Be sure to tune into the Evolve keynote tomorrow at 9am EST. Rumours are that it’ll be spectacular! 😉

Xamarin Evolve 16 – Training day 1

Hi there from Orlando, FL! Yesterday was the first day of the Xamarin Evolve 16 pre-conference training. And man, we’re already having a blast here. Evolve 16 is even bigger than the previous one, and on the pre-conf training alone, there are more people than there were at the original, legendary Evolve 2013; in total! Impressive.

Finally it's happening! #XamarinEvolve

A post shared by Roy Cornelissen (@roycornelissen) on

My mobile peer at Xpirit, Geert and I arrived on Saturday, together with a bunch of fellow Dutchies including some of my former colleagues from Info Support. It’s nice to catch up and hang out.

In the training, we’re doing the Intermediate track, which offers some more advanced topics. I have to say that most of the topics are already familiar, but for us this is also a great opportunity to get to know the Xamarin University material. We’re working towards certifying ourselves for delivering the official Xamarin University training curriculum at Xpirit to be the first Dutch Xamarin Training Partner! How awesome is that? Stay tuned for more news!

The main topics we covered were:

Asynchronous programming with async/await
For this module we dove into the mechanics behind the Task Parallel Library in .NET and the async/await keywords. This stuff is so important to get right as it’s crucial for quality apps to make sure that you’re not wasting the main UI thread by doing expensive work like heavy CPU-bound work or (network) I/O. The course went into some of the mechanics of async/await – with the compiler generated state machine that ends up in the generated IL.

The problem with async/await is that the syntactic sugar makes it almost too easy to make work inside your app asynchronous. The point is that making things asynchronous isn’t always necessary and using async/await the wrong way may actually hurt the app in the sense of complexity and possibly performance more than it helps. Understanding the state machine that the compiler generates, the effects of ConfigureAwait(false), working with the Dispatcher, etcetera is crucial if you want your apps to be responsive.

Patterns for reuse
A topic that’s dear to my heart. Marcel and I actually did a pretty popular talk about it at Evolve 2013. IMO, this stuff all still holds true, however we have progressed a bit when it comes to the maturity of the Xamarin platform. With the advent of Xamarin.Forms, more and more code sharing techniques are possible and go right up to the top UI level. On the other hand, Xamarin.Forms already takes away a lot of the hard work of bridging platforms. Very nice, but – my pet peeve – beware of the abstractions! 🙂

It all comes down to keeping things as simple as possible. In the training, we talked through using the Factory and Service Locator patterns, but our common conclusion was that they involve a fair amount of Yak Shaving.

front

In the end, Dependency Injection is a relatively clean way of dealing with dependencies that have per platform implementations. In my experience, using a light weight DI container like SimpleIoC is sufficient for most apps. Let’s be honest, in an average app, you don’t really need much sophisticated lifetime management or other things. You just want to be able to swap in per platform implementations of some components to use them from shared code. But before you start building your own components, head over to Xamarin’s plugin repo on GitHub because a lot of plugins are already available. And they generally use DI to set up.

Testing
We talked about the techniques that are at our disposal for validating the quality of your app. Of course using unit tests should be a no-brainer to developers, and there are actually some nice scenarios for testing the behaviour of your ViewModels and other logic in your app. These unit tests, being independent and mostly having their dependencies stubbed (another advantage of using DI is that it makes stubbing a bit easier), can give you the quickest feedback during your development cycle.

But an important part of your app will be the UI and that actually runs on the device. This has always been hard to test and we had a look at what Xamarin Test Cloud has to offer and the UITest API’s that you use to drive those tests. In a recent talk, I used this test pyramid diagram to show the stack I like to use for testing mobile apps:

mobile-test-stack.png

Note that I still think that there will always be a certain amount of manual testing involved for the more complex cases. And specifically those cases where you want to check the behaviour of your app under different circumstances, such as actually being on the move through tunnels or other low connection situations, or being out in the field to make actual pictures with the camera. Manual field tests by the team and beta test platforms like HockeyApp, Apple TestFlight and Google Play Beta are excellent tools for this.

Xamarin sure knows how to throw a party… #XamarinEvolve

A post shared by Roy Cornelissen (@roycornelissen) on

After the training it was time for some relaxation at LaFayette’s. Excellent food and great Southern style live music, and all the familiar faces from the Xamarin community there. Great to see everyone again! Really looking forward to the next few days!

To infinity, and beyond!
On Sunday, we had some spare time, so we spent the day at the NASA Kennedy Space Center. Wow what an amazing trip! It was incredible to see the huge rockets, it’s impossible to fathom how big they are until you see them. The same goes for the Space Shuttle. The Atlantis Space Shuttle is on display and you can see it up close. Super cool!

Awesome, the Atlantis Space Shuttle #nasa

A post shared by Roy Cornelissen (@roycornelissen) on

Rocket science

A post shared by Roy Cornelissen (@roycornelissen) on

The biggest surprise came when we went on the bus tour to the actual launch site. Again, it’s impossible to fathom the scale of the site and the equipment there that’s used for space travel. At the end we got a great show about the Apollo missions. The actual control center used for the Apollo mission is there on display. And then there’s the overwhelming and HUGE replica of the Apollo rocket.

Appollo Control Center #nasa

A post shared by Roy Cornelissen (@roycornelissen) on

And the coolest thing was: our Uber driver who took us back to the hotel was an engineer on the Space Shuttles for 30 years! So he could give us some fun behind-the-scenes insights. Did you know for example that there was an actual Coca Cola machine installed in one of the shuttles? That was to test the effects of carbonation in space. But since Coca Cola is a commercial company, NASA was not allowed to talk about that 😉

Oh and don’t you just love these vintage posters?

Love these vintage graphic posters #nasa

A post shared by Roy Cornelissen (@roycornelissen) on

NASA is recruiting #nasa

A post shared by Roy Cornelissen (@roycornelissen) on

NSBCon 2015 Recap

This past week I’ve been in Dallas,TX for the second edition of NSBCon 2015, the official NServiceBus conference.

[TL;DR]
It was a blast, I found the quality of the sessions and the activities very good and I met some nice and highly competent people. Oh, and great food!

As soon as the slides and videos are available online, I will add links.

Pre-Con Workshop
The week started out with a full day Advanced Saga Masterclass by Andreas Øhlund. Although most of the content was already familiar to me, I still had some nice takeaways from the day. The most important one is around integration patterns with external non-transactional resources. When dealing with non-transactional resources like web services in an NServiceBus architecture, it’s wise to place the interaction in a separate endpoint, and handling a command that you send from the Saga.

My takeaway was that you should leave the technical details of the web service interaction inside that integration endpoint. If an error occurs, just let NServiceBus handle it so you get First Level Retries and Second Level Retries for free. Only report back to the Saga with a functional reply, such as a Tracking# in case of a shipping provider. This way the Saga stays clean and functional, as does the integration handler.

FullSizeRender 6

Another important lesson is that a Saga are a good fit when there’s an aspect of Time in your domain logic. For example: a buyer’s remorse policy (the ability to cancel an order within x minutes). For logic like this, the RequestTimeout feature of a Saga really shines. You could state that if a Saga does not contain at least one timeout, you probably shouldn’t be using a Saga; instead you could just as well put it in a regular message handler.

The day ended in great company at Casa Rita’s Mexican Restaurant with a fantastic Briskett Burrito. (Hey, I’m a foodie)

 

Conference day 1
The first day of the regular conference was already packed with nice sessions. Udi’s keynote was sort of a State-of-the-Union on what Particular has been up to for the past year. Lots of work has been done on the internals of NServiceBus, more on that later. Most striking was probably the announcement that – a year after being introduced at NSBCon 2014 – ServiceMatrix is being discontinued.

To be honest, I am not really surprised and also not sorry for it. I’ve never believed in dragety-droppy modelling tools for building software and frankly I felt Particular was trying to go with that craze a little bit too much. As Udi explained, a tool like that will get you 80-90% there, but it’s the nitty gritty details in that last 10% that will break you up. So it’s back to the model of development that I’ve always liked so much about NServiceBus: put the developer in the driver’s seat.

That’s not to say that there is no demand for visual tools. Some of the efforts that have gone into ServiceMatrix are now being transformed into another form of visualisation, one that I much prefer: visualisation of your finished system as it runs. In other words: living documentation. I’ve always been a bigger fan of using simple tools for modelling: PowerPoint (yes I said it, I’m a PowerPoint architect), or much rather even: pencil & paper or a whiteboard. No modelling tool has ever really appealed to me, not the UML ones and especially not the “graphical coding” ones (looking at you Windows Workflow Foundation and BizTalk). Just stick with boxes and arrows and start coding, is my style.

NServiceBus V6
After Udi’s keynote, Particular solution architect extraordinaire Daniel Marbach took us through the new NServiceBus V6 release. V6 is all about embracing async/await, which means that an important chunk of NServiceBus Core was rewritten from the ground up to be async all the way.

Daniel did a great job of explaining why Particular did this. Ever since the introduction of the TPL and the async/await keywords, Microsoft has been pushing towards async code more and more. This is most apparent in the cloud, where all IO operations (Azure Storage Queues, Azure Service Bus, SQL Azure, etc) have an async API. Up till now, handlers in NServiceBus were synchronous, and made you implement a single method:

void Handle (MessageType message);

This makes it hard to consume async API’s for IO, because marking a void method as async is evil. Furthermore, the NServiceBus Core is not aware of any async code, so strange things can happen if you’re not careful. This lead the team to the decision that V6 should be a breaking change in order to go fully async. The interface for a handler now looks like this:

Task Handle(MessageType message, IMessageHandlerContext context);

You must now return a task (or Task.FromResult(0) if your implementation does not require async), and you receive an IMessageHandlerContext implementation that you can use to send or publish messages. No more public IBus Bus { get; set; }. This is done so that there is no more dependency on state across multiple threads. NServiceBus will make sure that you have the correct instance. It is also important to note that the use of ThreadLocal for caching is dangerous because of the introduction of async/await. All in all, an excellent talk by Daniel, who wrapped his lessons in a story about a Swiss Chocolate Factory. Gotta love the Swiss.

More interesting info on async/await and ThreadLocal can be found here:

[https://www.youtube.com/watch?v=4uWzIM1U-VA] Presentation about the pitfalls of async/await and the SynchronizationContext. Highly recommended, even if only because of the creative format.

[http://www.particular.net/blog/the-dangers-of-threadlocal] The dangers of ThreadLocal

IMG_9776

Akka.NET
Andrew Skotzko from Petabridge did a riveting, high octane presentation about Akka.NET and the Actor Model. I’ve briefly looked at the actor model before and am interested in exploring it more, especially after this session. One of the things I’ve been wondering about for a longer time is how the actor model fits in with NServiceBus.

In his session, Andrew mentioned that Akka could be a great producer or consumer for NServiceBus. In Andrew’s words: “Akka is about Concurrency, NServiceBus is about Reliability”. I’d have to explore this some more but frankly I don’t really see a great fit as of yet. One of my main concerns with Akka is that remote messaging between actors is not reliable. It is supposed to be light weight and location transparent, but the model compromises on reliability. Akka has an “at most once” delivery guarantee, which doesn’t exactly guarantee anything. For communication between actors, Akka provides location transparency, i.e. you just use an interface to send a message, and the receiving actor can be either in memory or on a remote machine. Hmm, where have we seen this fail before? At least NServiceBus is always clear on the fact that when you send a message, it’s inherently remote. And NServiceBus has your back in making sure the message arrives.

So, I’m not yet really seeing the point of using an actor model inside, or alongside NServiceBus services, but it requires more investigation.

This seems to be the best place to start: http://LearnAkka.net

I must say though, both Andrew and Aaron Stannard from Petabridge are both extremely passionate and helpful. They’re very nice guys and we had good fun over a couple of beers.

Death to the Distributor
Sean Feldman
from Particular talked us through a preliminary version of a new routing component in the NServiceBus plumbing which allows them to eliminate the Distributor component when you’re on MSMQ transport and want to scale out. A nice and short talk in which Sean showed a promising solution for decentral routing, with a pluggable strategy (you could write your own distribution logic if you’d like). With that basis, combined with realtime health info from endpoints, dynamic routing and commissioning and decommissioning of nodes will become possible. Interesting stuff that’s in the works.

There were also two interesting case studies on the first day: Building the Real-Time Web with NServiceBus and SignalR by Sam Martindale and a more high level session called Decomposing the domain with NServiceBus by Gary Stonerock II

Combining SignalR with NServiceBus has been a hobby of mine for a longer time, so the idea was already familiar to me. It was nice to see the application that Sam and his team put together: a multi-user graphical web application for “composing” and budgeting luxury homes that relies on SignalR and NServiceBus for on-the-fly budget calculation and distribution to multiple users at once. Sam was so nice to do a shout out of my earlier blogpost about the NServiceBus backplane for SignalR. With thanks to Ramon Smits of Particular, the sample has now been upgraded to the latest stable versions of both NServiceBus and SignalR. Thanks Ramon!

Gary’s session was interesting as well, sharing his journey designing a system for Medical Trials on a logical architectural level. Some key takeaways for me were:

  • In modelling your domain logic, make sure that you model it for success (i.e. Logical Success Modelling). Try to factor out the edge-cases and exceptions by asking more questions about the business logic. You will end up with much simpler domains.
  • Defer naming things; Don’t name services, domains or classes until you are more clear about its responsibilities. You will end up with much clearer names. Udi calls this “Things Oriented Architecture” in his ADSD course.

Hackathon!
Then it was time for the Hackathon! The assignment: come up with the most over-engineered Hello World application based on the NServiceBus building blocks. I teamed up with Anette, Daniel and Adam and after a couple of beers we came up with project Ivory Xylophone:

FullSizeRender 14
See? Pencil & paper FTW!

By sending a tweet with hashtag #ivoryxylophone, we set off a system that sends a message to a Saga that converts all the characters in the message to Morse code, gathers the characters, converts them back to plain text and sends the message to a handler that tweets out the message on Twitter. All NServiceBus message would go over a transport based on Git commits (…). Apart from the Git transport, we got it working end-to-end.

IMG_9745
Mob programming

We got second place, just after the awesome Slack transport by Mark Gould.

IMG_9770
Demo time for Ivory Xylophone

Conference day 2
Ted Neward kicked off day 2 with his keynote session “Platform Oriented Architecture“. He opened by establishing that the software industry has been through several cycles of inventing the same wrong solutions for the same problems multiple times. We’ve seen other people speak about that and frankly, he’s right. The nice thing about Ted’s talks was that he did a shot at how the future of architecture should look. He concludes that most of us are building a platform of some sorts. And in order to succeed, you need all of the good things that we’ve established: the 4 tenets of SOA are still a good idea, we still need to mind the 8 fallacies of distributed computing, but the most important thing is that a platform should have a clearly defined Domain and Context. Meetup, Uber, Yelp, AirBnb are all platform but each has its specific domain and give meaning to technology choices in their own context.

All About Transports
Swedish Chef Andreas Öhlund gave a great talk comparing the different transport options that NServiceBus gives, packed in a tasty tale of a Swedish Meatball company. I really liked his stylish slides, kudos! His message was important: different transports have very different characteristics and you should choose wisely. Do you choose a decentralised model with MSMQ or a broker style transport like SQL Server, Azure Service Bus or RabbitMQ? Talking about RabbitMQ – one does not simply install RabbitMQ and be done with it. It takes care to make RabbitMQ reliable (clustering) and you must be careful when you send messages inside a transaction that might fail, or you’ll end up with ghost messages. Andreas’ talk could be a great blogpost in itself. I hope Particular puts it on their blog soon.

Other interesting talks were Jimmy Bogard‘s Integration Patterns With NServiceBus where he shared some lessons learned about integrating legacy systems with newer NServiceBus systems, dealing with big files and his interesting Routing Slip Pattern.

Kijana Woodard had a funny and insightful talk about Things Not To Do With NServiceBus. I like seeing a talk like this as it shows that Particular isn’t just shoving NServiceBus down everyone’s throat as the end-all solution for everything. It’s not a golden hammer, so there are definitely cases where it doesn’t fit.

IMG_9760 2
Beef ribs!

Again, a great day, which ended in the fantastic Brazilian Steakhouse Boi Na Braza. Did I mention I’m a foodie?

Day 3: Unconference
One of the things I enjoyed the most was the Unconference day. A day where participants set the agenda and get to do the talking. We collaborated on an agenda for the day and ended up doing multiple parallel tracks of discussions and knowledge sharing. I participated in discussions about Security & NServiceBus, UI Composition. Akka.NET & the Actor Model, Saga & Domain Concepts and Microservices. Got a ton of new insights. My sketchy notes might not be as meaningful to you as they are to me, but still…

All in all, NSBCon was well worth the trip to Dallas. All the Particular folks are very approachable, hospitable and helpful, the participants were great discussion partners and the quality of the sessions was very good.

Thoughts on the Xamarin Evolve 2014 keynote

Wow, Xamarin certainly pulled off a great one in the Evolve 2014 keynote today. I had to miss the conference this year but I sat behind my MacBook watching the keynote in high anticipation regardless.

Evolve2014Keynote

The keynote was a rollercoaster ride, and the team can be very proud of what they have achieved. Xamarin is clearly on a roll! Let’s go over today’s highlights (at least, for me)…

The vibe
Evolve 2013 was a fantastic conference, mostly because of the awesome vibe. The Xamarin team was visibly proud, and the whole atmosphere during the conference made it great to be a part of. From the tweets in the #XamarinEvolve stream, it seems that they pulled it off again this year, despite the much larger scale. Kudos to Nat, Miguel and their team for that!

The great vibe was also noticeable in the keynote. It’s really great to see a CEO and CTO on stage – who are themselves just geeks like us – radiate with pride and excitement. And a little bit nervous as well 🙂

The Digital Business
One important thing that was recognized in the keynote was that the Digital Business is becoming top priority for C-level executives in the enterprise. This enables interesting scenarios for mobility and cloud to change the way employees do their day to day work.

Avanade mentioned in the keynote that CxO’s are focusing on reach, recognising the fragmentation in the mobile arena regarding devices, mobile OS-es and the variety of device flavours. BYOD is happening, which means that a good cross platform scenario is very important.

At the same time, user experience is a huge part of the story. As Nat rightly remarked:

Your app, even if it’s an enterprise app, is next to the best apps in the world on someones phone.

As a result of the consumerization of IT, users have come to expect top notch UX from their enterprise apps as well. Just as smooth as their consumer apps. Needless to say that the reason why I love Xamarin is that they bridge cross platform development and native experience in the best way I’ve seen.

IBM partnership and Mobile Middleware
Mobile middleware is becoming a real necessity in the enterprise. Opening up enterprise backend systems to mobile devices isn’t just like regular EAI – Enterprise Application Integration. We have to deal with very different connectivity scenarios, new security threats, and performance constraints that come with mobile devices. This opens up opportunities for new and interesting architectural styles and cloud based backends. A company that – IMO – gets this very well is KidoZen.

IBM is now also stepping into this new world of mobile with their Worklight product. Very interested to see where the Xamarin/IBM integration is going.

Xamarin Forms Partners
Xamarin.Forms is a very promising framework, in which Xamarin balances cross platform development and native user experience in a very elegant way.

The contributions from the Xamarin.Forms partners fully brings the framework to life, with awesome powerful controls. Charts, document handling, advanced user inputs, etcetera. This is a very nice step towards adulthood for Xamarin.Forms.

Xamarin Profiler
With these constrained mobile devices, performance efficiency is very important. For this reason, you’ll find yourself spending a lot of time running your apps through profilers to get out all the jitters and memory leaks. Xamarin now has a great profiler that actually looks at the app from a Mono/.NET point of view. Can’t wait to play with it!

xamarin_profiler_mac@2x

What I really like about the new tools is that Xamarin is taking their own advice to heart: create native experience on the target platform. This means that the Mac versions of the tools have the distinct OSX style, and the Windows versions have that recognizable “Metro” look (I still call it Metro). It’s the details that matter, and I like it.

Xamarin Android Player
Every Android developer knows how excruciating the Android emulator is to use. Although it’s an accurate emulator, it’s dreadfully slow. Many have already defaulted to using Genymotion, although that may cause integration problems, for example with VirtualBox if you have a Windows VM running in Parallels on your MacBook like me.

hero-screenshot@2x

The Xamarin Android Player is much faster, and integrates neatly with other IDE’s that speak ADB.

Now, the player won’t excuse you from testing with real devices, but this greatly improves the developer experience! Wow, well done Xamarin!

Xamarin Sketches
You could expect from Xamarin that they’d take Roslyn and do something great with it. Xamarin Sketches is a nice REPL like tool that helps you draft up C# snippets, have them executed immediately and park them as snippets. Web development style immediate feedback with C# development!

I love how Xamarin brings the IDE closer and closer to Brett Victor’s vision in his Inventing On Principle talk, similar to what Apple did with their Swift Playground.

XamarinInsights

In addition, the real time integration with the emulators, where you immediately see code changes being executed, is a huge productivity boost! Amazing piece of engineering from the Xamarin team!

C# Test Automation
Now finally we can write our automated UI tests in C#!

Xamarin Insights
A good solution for monitoring the stability and quality of your apps, out there on all those devices, is crucial. It helps to detect problems and keep the quality and user experience on a high level. Moreover, monitoring your apps behaviour can give you a lot of new insights.

There are several solutions in the market that can help you track errors, and even do a bit of performance monitoring. Services like Crashlytics, Crittercism, Raygun and even my favourite APM tool New Relic all have mobile offerings.

The problem with these is that most of them hook into native API’s to do their work. This means that you’ll need a C# binding for their SDK’s to use them in your Xamarin app. For example, Raygun has a component in the Xamarin Component Store you can use. Still, catching errors won’t give you all the details you might be looking for as a C# developer. You’ll want to have the full .NET/Mono stack trace and more details from the Xamarin environment that you won’t get if you don’t have a “Xamarin native” SDK.

Furthermore, monitoring app performance will be difficult, again since most APM SDK’s hook into extension points in the underlying native framework. With the New Relic SDK for iOS for example, you’ll find yourself trying to hook measurements onto Objective-C methods, selectors and other extension points, whereas you really want to know how your C# method is doing. These SDK’s also make it difficult to instrument shared code, since their API’s are usually platform specific. Again, a “Xamarin native” SDK is lacking here. I really hope New Relic has a Xamarin compatible SDK on their roadmap. But now, luckily Xamarin has taken up the challenge themselves…

Enter Xamarin Insights! I’ve already had the privilege of playing with the platform a little bit, and things look very promising. There is still some work to be done on the performance monitoring part, but the error tracking and alerting feature is shaping up very nicely.

XamarinSketches

Conclusion
Xamarin is growing up fast. With the addition of Test Cloud, Insights and the new Profiler, they’re building a great one-stop solution for mobile development. Sketches, C# test automation and the fantastic new Android Player make the developer experience even more delightful.

Congratulations to the whole Xamarin team!

NSBCon 2014 recap

Update: Particular has put up an awesome recap page for NSBCon London. All session videos are available there as well! And be sure to check out the excellent intro video.

NSBCon 2014, the first official NServiceBus conference at Skills Matter in London was a great success. I really enjoyed the sessions and hallway discussions with the participants about how they were using NServiceBus. Mark and I had the opportunity to share our experiences with NServiceBus in a session. Here are some of my personal highlights.

Barbecoa
Bear with me, I’ll get to technical NServiceBus stuff, but being a foodie, I can’t resist posting food pics as well. But if you’re really boring and don’t care about great food, you can skip the fun.

This was my second visit to London and we had a little bit of time to spend in the evenings to explore London. I arrived a day earlier than Mark to attend the ADSD Unconference on June 26th. My colleagues Marcel and Sander were also in town for a large ALM project they’re doing, so we decided to meet up and go for diner. Gordon Ramsay was out of our league, but luckily Jamie Oliver was close by with his excellent BBQ/grill restaurant Barbecoa. Nice ambience and the dishes were simple yet very refined and tasty.

Jamie Oliver's Barbecoa

Wood plank-smoked duck, cherries, maple dressing, red mizuna and pecans

Unpulled pork, Caraway slaw, jalopeno cornbread

Barbecoa brownie, Raspberry & Pink Peppercorn Sorbet & Aerated Chocolate

Barbecoa's butchery



Starter: Wood plank-smoked duck, cherries, maple dressing, red mizuna and pecans – excellent and playful taste combination between the smoked duck, sweet cherries and earthy pecans

Main: Unpulled pork, Caraway slaw, jalopeno cornbread – wow this pork butt was tender, and the combination with the spicy jalopeno cornbread was excellent

Dessert: Barbecoa brownie, Raspberry & Pink Peppercorn Sorbet & Aerated Chocolate – I love the use of pepper or other spices with fruit, made the sorbet really come alive; and chocolate brownies… no need to say more

Right around the corner was Barbecoa’s Butchery, where all the meat is dry-aging. Very nice. After dinner, I had a quick stroll along the Thames and St. Paul’s Cathedral.

And the conference hadn’t even started 🙂

ADSD Unconference 
In February 2012, I attended Udi Dahan’s Advanced Distributed Systems Design course. Most attendees will confirm that this course is quite mind twisting if you have been brainwashed with the “Service Oriented Architecture = Web Services” dogma the whole time. Nowadays I think messaging and asynchronous systems are a bit hipper with all these cloud platforms taking off, but chaining web services into a ball of mud together was still all the rage at the time.

The unconference was an interesting way to get ADSD alumni together to discuss their experiences applying the techniques from the course. An unconference is an interesting format, where topics are determined by the participants, and then discussed in free format sessions.

We saw an impressive example of a composite web UI implementation by Lars Corneliussen from Faktum Software – BTW, I checked, but he’s not some distant Scandinavian cousin 🙂 Anyway, we discussed UI composition, whereby data from separate services is combined at the UI level. One of the interesting challenges I see is applying this pattern with mobile apps. Given the latency and low bandwidth that mobile apps have to deal with, I think it’s better to do the composition at the API level and prepare highly optimized resources for the app to communicate with.

Andreas OhlundThe Particular team also facilitated a couple of great discussions. A discussion about Ops got me interested in Splunk, for holistic and pro-active monitoring of all sorts of events across a distributed system. I definitely need to check that out. Also, Indu Alagarsamy had a nice discussion about Routing Slips vs. Process Orchestration with Saga’s. Have a look at Jimmy Bogard’s blog for a great description of different Saga / messaging patterns. Danny Cohen coined the term “Bolshevik” for centralized process orchestration. I’m going to use that term from now on 🙂

One of the insights was that – in a way – routing slip is “Bolshevik” as well, as a routing slip also has a predefined, sequential route. I tend to agree with that, though the Routing Slip pattern can be useful for having messages flow across specific endpoints only.

I really enjoyed the nice discussions at the ADSD Unconference and appreciated the willingness to share experiences and lessons learned by all participants. Having them face-to-face in a small group also really helps.

London
Mark arrived shortly after I finished the unconference. We went for a nice long walk along the Thames to visit some highlights in London. Might as well make good use of your time, right?

St. Paul's Cathedral and Millennium Bridge

London skyline

Tower Bridge

Southwark Bridge


NSBCon Day 1
IMG_5954The first day of NSBCon started off with a nice breakfast at Skills Matter. What a great location and a nice environment for tech conferences like NSBCon. Udi Dahan kicked off the day with a presentation about the past, present and future of NServiceBus. There were a couple more old timers in the room that also started using NServiceBus at version 1.x, just like me 🙂 Udi reminded us how awful the website and logo used to look at the time, and he sincerely apologized for ILMerge-ing all the external dependencies into NServiceBus. Yep, it was bad, but the team has made NServiceBus a very slick and solid product over the past few years!

Info Support was prominently visible as well as one of the event’s sponsors.

The rest of the program was a nice mixture of case studies with NServiceBus, technology deep dives and theory. It was nice to see how NServiceBus is used at big companies like Wonga (Charlie Baker’s session) to handle large amounts of payments and Spotlight (Dylan Beattie’s session) where it even plays a role in video encoding.

Most prevalent from almost all of the session was how important it is to have decent monitoring across your entire system. Luckily the new tools from Particular can come a long way in giving insight in a message driven system, but I think that you can’t do without decent, holistic monitoring. Dashboards that give insight into both the technical stuff that goes on in your system and functional checks.

This was also one of the points that Mark and I highlighted on our Best Practices session. It was an honor to present at this first official NServiceBus conference. We got some nice feedback afterwards. The hallway discussions afterwards are always so valuable.

James Lewis gave a great talk about Managing Microservices and Yves Goeleven taught us about using NServiceBus in an Azure cloud. I really like using the Azure platform, cloud architecture brings a whole set of new challenges to the table.

The day ended for us with a nice speaker diner. It was great to spend some time with the whole Particular team and the other speakers to share experiences. You don’t get that many NServiceBus users from across Europe together in one room that easily.

NSBCon day 2
After a nice espresso at the Goswell Road Coffee Shop, the second day started with a deep dive into the Particular Service Platform by Danny Cohen. He explained how the separate components work together to monitor, diagnose and even design distributed systems with NServiceBus. I especially like the role of ServiceControl, which can serve as a nice extension point for your custom monitoring needs as well. New Relic feed, anyone? I have blogged about ServiceControl and ServicePulse before.

To use Danny’s words: “I’ll let you take in the coolness for a minute”

The other sessions were very enjoyable as well. A look at the new pipeline architecture in NServiceBus 5 by Indu Alagarsamy and John Simons was very nice. I really like the new model, based on the Russian Doll Pattern. Mark and I already saw some nice opportunities for replacing things in our implementation with these new style behaviors.

Greg Young and Szymon Pobiega showed an impressive integration of Event Store and NServiceBus. Event Store is another product I definitely want to check out. Greg is a great presenter as well.

Jan Ove Skogheim took us on the journey he made with his customer, migrating a complex, web service infested system to a message driven architecture with NServiceBus. Some nice insights there as well. In trying to get the team into the right mindset, Jan Ove was very keen on using the right terminology. “When someone said ‘service’, I slapped them in the face” 🙂

And Andreas Öhlund gave some nice insights into the internal development process at Particular. He quoted Netscape’s founder while explaining why releases are sometimes delayed: “Don’t ship crap”. I completely agree.

What struck me was that Andreas used this image in his presentation:

Slap!

So, both Jan Ove and Andreas use slapping… Perhaps some Scandinavian custom, but let me be the first to coin an official term for this methodology: Slap Driven Development. Interesting concept that I might try at work some time. You heard it first here!

In closing
NSBCon 2014 was a big success. Udi was visibly very proud to have a first official conference for his brainchild and rightly so. He has built a great company and community around NServiceBus. Looking forward to NSBCon 2015 already!