DevExpress Sydney Meetup – Dec 1


Powerhouse MuseumThis year our DevExpress Sydney Meetup is going to be held at the Powerhouse Museum on December 1. It’s a great time to share your thoughts (good or bad), grab a beer and some snacks and let the team show you through some of the great new features in v17.2. There are limited seats so be sure to reserve your spot by registering here.

I’ve already had some people request Meetups in other states, but we need numbers, so register your interest if you’re outside Sydney by sending a quick email to¬†clientservices@devexpress.com – the more people that show an interest, the more likely I can make it happen.

DevExpress v17.2 will be released over the coming weeks and we will be presenting the What’s New webinars, but I’d prefer to see you in person at the Powerhouse ūüôā

 

Closure; the missing piece


White jigsaw puzzleWhile doing a code review this week, the developer asked me if we could refactor some TypeScript. Basically take some repetitive client side code, pop it into a new file and make it easier to implement elsewhere.  The project is using the powerful DevExpress ASPxGridView control in a lot of places (multiple controls on a page and multiple pages) and in batch edit mode. The users wanted the ‘Save / Cancel’ panel to be at the top of the screen instead of the default location in the grid footer. Simple enough process, we can create a user control to handle a couple of nicely themed ASPxButtons, link to a helper class for the common work on the grid and we should be done.

First we take a look at the original markup, the client side client event is being wired to a TypeScript method


Inside the TypeScript file, the method was doing some checks and calling another method on the grid control, gvTemplates.UpdateEdit(); This is where the repetition was, each grid had its own ‘save’ method.

helper.saveGrid = function ( ) {
        gvTemplates.UpdateEdit();
}

In order to optimise the code, we have to pass in the name of the grid being edited, then find the grid in the DOM and execute the method on it.

The first part was to update the markup to call to the helper class


The key difference here is the introduction of the brackets into the assignment, we are no longer just pointing the click event to our TypeScript method, but actually executing it, which is bad. This is where the closure comes in. For more information about closures I suggest you read the following article from Julian Bucknall.

For our needs, the code should look something like this

helper.saveGrid = function (gridId: string) {
        return function (s, e) {
            var grid: ASPxClientGridView = ASPxClientControl.GetControlCollection().GetByName(gridId);
               grid.UpdateEdit();
      }
}

The ‘gridId’ parameter is going to contain the grid’s client side ID, the saveGrid() method then returns a function that is passed back to the click event handler on the button. There are a few cool things going on with the new code. Firstly (and this is where you can come unstuck very quickly) is the use of the parameter that is passed in. The inner function can use the value from the outer function. The second thing to note is the nice helper class provided by DevExpress to get access to the control, so you don’t need to go searching through the DOM. Code cleaned, duplication removed and a much nicer way to handle calls from multiple controls and/or pages.

While this serves as a very quick tutorial on being able to call common methods, I really want to highlight a) the power of the closure, b) the frustration they can cause to JavaScript / TypeScript beginners.

For more detailed information on closures and best practices please see these fantastic articles:

Caught out with closures

The module pattern

Approaching Angular 2 from a WebForms perspective


hires-small

Omelettes anyone?

Sometimes we spend so long working in a technology it is a difficult to make a switch. If it ain’t broke, don’t fix it, right!? ¬†The problem is, the world moves on. Using server side technologies like ASP.NET WebForms is something I still love to do, add a few DevExpress components onto a page, set the properties, bind some data and boom, almost no code and I have a working web application. There are many debates scattered on the internet about WebForms been deprecated, that they are evil, I simply disagree. Now, if you are wanting to target a wider range of web servers and operating systems, use .Net Core, have light weight UI then you would start looking at some of the popular frameworks like Angular 2. Herein lies the dilemma, how does someone with many years experience as a WinForms and WebForms developer make the jump to a client side driven application? I’m pleased you asked…

Julian and I are presenting a free webinar on this exact topic on November 3. Specifically we will take an existing WebForms application and create an Angular 2 version using the DevExtreme Web controls.

The goal is to show how a C# (or VB) developer with a background in WebForms can get started in the client side world. As with most of my presentations lately, we will also be using TypeScript.

Take part in the fun by Registering here,  seats are limited.

DDD Perth: Lessons learnt


MapDDD Perth was held last weekend in, you guessed it Perth, a sleepy little city in Western Australia. It still makes me smile when sharing with overseas friends that they don’t quite understand the size of our beautiful country.
It’s a 45 hour drive, or a 5 hour flight from Brisbane to Perth. The flight is relatively short in comparison to my travels to USA, UK, Europe or Russia, but still a little longer than than travelling to New Zealand.

The conference was amazing, you only have to check out the twitter feed or the DDD Perth Flickr to see what went down, but there were some important lessons to be learnt.

Double check all numbers before transferring money

As sponsor for the after party, I had to transfer funds to ‘My Place¬†Perth‘ (great place to visit by the way, especially on Karaoke night eh Lana!) since the Heritage Bank app does not allow you add new payee’s (for what reason I will never understand), the browser had to be used, navigating a bank web site on an iPhone 6 Plus is not the easiest thing to do. Attempt #1 – add all information, wait for SMS from bank to finalise the transaction, go to messages screen to get the conformation number, switch back to web browser and catch the ‘back’ button, therefore wiping out all data added! Attempt #2 – add all information, again wait for SMS from bank, carefully swap between message app and browser and enter code. All this time having a friend read back the account number and BSB to send to from a pdf invoice received on email. Celebrate the small victory of getting this far, then email a copy of the receipt to venue. Happy days! though short lived! ¬†The owner of My Place gently advised that when she had checked the receipt it was apparent I had entered a 6 instead of 5 in the account number! GAH! So in order to keep the peace, I paid the invoice again, this time via my card. It was not a small amount, and then¬†I had to go chasing the banks to see where my original payment had gone, however, that had to be a job for Monday since banks (for some reason) don’t work Saturday nights. After a number of calls on Monday, I was quietly assured the money will bounce back to my account sometime in the week.

Don’t leave things in your hotel room

The morning after a big party, my brain was not yet firing on all cylinders, 6am and time to get ready to head to the airport. I remember so vividly putting my Bose QC20 headphones (the only noise cancelling headphone I recommend for long flights) on the back of the chair, then noticing they had fallen off, thinking to myself “don’t forget to pick those up”. ¬†I arrived at the airport with that niggling feeling, you know, the one where you think you have forgotten something. First sign of a bad day in progress was the ‘Priority Check-In’ taking longer than normal check-in and bag drop, this is not a usual thing, in fact the service provided by Virgin Australia is the main reason I continue to fly with them on as many trips as I can. Finally, I checked my bag and headed to the Virgin Australia lounge looking forward to some breakfast before the long flight home (which was actually shorter than the one over, but seemingly longer because I had to add 2 hours back on the clock).¬†Lounge closed! WTF, after a quick tweet, Virgin Australia confirmed – no lounge on weekends in Perth! Okay, off to the coffee shop for a sandwich. As I sat wondering why I had that feeling, it struck me, NO, I DIDN’T!? but of course I did, the headphones were still sitting under the chair in the hotel room. I remembered I had just received an email with the settlement account from them, so I replied straight to that advising exactly what had happened and where they were. Boarded the plane and headed home. Monday, nothing from the hotel, so Tuesday morning I rang, a brief chat to house keeping explaining the whole story and I was promised a call back. A short 15 minutes later I got the promised call. “Sorry Mr Usher, we checked and there is no sign of your headphones”. ¬†Oh well, it’s my dumb mistake anyway, but I don’t understand why they were not found. In the meantime a survey email came across my desk from AccorHotels and I took the time to share my thoughts with the COO of the group. ¬†Approximately 30 minutes after my first call from the hotel, a lovely lady named Heather, Housekeeping Manager, called and advised my headphones had been located, yay! I’m not going to go into details here, but in short they ‘turned up’. I received an apology for the late reply to my Sunday email, and to the time it had taken to find them, I also received an email from the operations manager in Perth again apologising and confirming a policy review, hmm. My faith in AccorHotels restored, and my trusty Bose QC’s making the journey (albeit alone) back to sunny Queensland.

Don’t use the phrase ‘guy’ when you meant ‘guys & gals’

Cq1AIj7UAAApeOi

Before the conference I had¬†sent a tweet to a couple of high profile people, namely Pip Marlow – Microsoft Australia MD, and Richard Branson (wonder if we can get that Lounge policy changed?), in support of women in tech, I am a strong advocate that more women should be involved and find it too dominated by men! After being heralded in the opening notes for my push (thank you Pip for your feedback, it’s a shame Mr Branson didn’t weigh in on the subject), I made the faux pas of using the singular, masculine phrase ‘guy’ during my talk. Thanks to Michelle¬†for pointing that out publicly!

T1

A big weekend, well done to Rob Moore, Jake Ginnivan and the¬†team for pulling everything and everyone together. I met some fantastic people, made some great new friends and some important lessons learnt, but all’s well that ends well.

 

CodeRush for Roslyn… unveiled


April 2014,¬†I wrote a post about CodeRush vs ReSharper. At the time Roslyn was a hot topic, Microsoft were open sourcing their compiler technology, DevExpress wanted to take advantage of that while JetBrains didn’t (and for compelling reasons). Two and a bit years later the wrapper is about to be removed from the offical public release of CodeRush for Roslyn. Here’s what we expect:

  • Lightweight
  • Blistering Fast
  • Feature Rich

Since the announcement of the webinar next week there have been a number of social media posts questioning the position of CRR against other productivity tools such as ReSharper. The brains behind the original CodeRush product, Mark Miller made it clear that there is no reason developers cannot have both tools installed.

From a features perspective:

  • Analyse Code Coverage
  • Tons of Visual Studio Helpers
  • 60+ Refactorings
  • Code Providers
  • Debug Visualizer
  • IntelliRush
  • Decompiler
  • Intelligent Symbol Search
  • Member Organisation
  • Unit Testing
  • Code Cleanup
  • Navigation
  • Structural Highlighting
  • Code Analysis

My job is to invite you to be the judge, join me August 2, 10am PST; to see all the new features, the speed and intuitive way CodeRush for Roslyn can improve your productivity as a developer. Of course, the session will be recorded, but if you join live, you can ask your questions in realtime ūüôā

I’ve been a CodeRush (classic) user for over a decade, and more than happy to show how I personally use the features to make my development more productive.

Register Here

Webinar: Debugging a PhoneGap / Cordova App


DevExpress

 

 

 

 

DevExtreme has to be one of my favourite tools to create mobile apps, but it’s not without some caveats. The biggest one being debugging. The simulator is an amazing piece of software except for when you need to run some PhoneGap plugins, or access device specific features. So what is the best way to handle these scenarios? Join Julian M Bucknall and myself on March 28 and learn how to use GapDebug while running your application in real-time on a device or virtual machine.

PhoneGap

Webinar: Is Data Too Hot To Handle?


 

dataIt’s time to start cranking out some webinars. Julian and I are starting off a series of JavaScript / PhoneGap / DevExtreme presentations covering the things that have driven us mad over the last few months. ¬†It’s one thing to get into mobile development, but another to maintain your sanity once you commence.

It goes without saying that every application needs data, and some need it there and then, whereas others can wait for it to arrive across the web. In this presentation we will look at using data in your mobile DevExtreme app, especially that data which has to reside on the device. They will discuss what storage options are available out of the box and how to choose one, how to implement a custom data store, how to use local storage on the device, and even take a look at on-device debugging techniques.

Anyone who is looking to build a data based app (erm.. that should be everyone) needs to see what we uncovered in our research, it will save you a ton of time!

Don’t be shy, just register here and join Julian and I for a fun filled, fast paced look at handling data on mobile devices using JavaScript.