RoguePlanetoid.com Picks – DDD North 2017

Standard

DDD North is a developer event held each year in the North of England, October 14th 2017 saw this year’s event in Bradford at Bradford University where dozens of Microsoft platform developers gathered to attend the various sessions, meet up with fellow developers and more!

The power of mentoring – Simone Cuomo

Mentor – an experienced and trusted adviser, not defined by higher qualification, age or company position. Can be just a Mentor about a specific subject, you could be an expert on GIT or Accessibility.

  • Multiple – Have multiple mentors to support different skills
  • Reverse – flips the traditional model
  • Two Way – Both parties exchange mentoring on different skills
  • Virtual – Mentoring using new technologies to replace face to face.

Important People – Bill Gates, Mark Zuckerberg, Richard Branson, Elon Musk – these all try to push the boundaries, their success based on their mentors and they accept that they need support. Mark Zuckerberg’s mentor at the start was Steve Jobs.

Where Things Go Wrong – Think you know it all – Entrepreneurs with mentors show that they are willing to learn open to different perspectives and adaptable to change – Richard Branson.

Accepting your weakness is strength of his own – Simone Cuomo

Imposter Syndrome – Think know so much less than you do compared to others, 33% of young people are affected, people with good skills are the most affected and women are the most affected. We think we only know a little and everyone else knows the rest, but reality is people know about the same as each other but just about different things. Spend time with someone who might not be able to share their knowledge, get them to share what they know, support them in a social way and find out their best skills and that can become a trusted advisor to you and become your Mentor about a subject. Remember how hard it was to figure stuff out in the first place, and how you were able to learn the things you learned.

In learning you will teach, and in teaching you will learn – Phil Collins

Skill Chart – Fix, Create, Improve, Teach. More time means more time to know what you didn’t know, you’ll think you know everything before you find out there’s stuff you didn’t know. Someone can be really good at something but can they teach it, you can have someone to support that person to make them better to share their knowledge – understand boundaries, be able to teach and find your place.

End of Full Stack – Starting to specialise, there are things like accessibility that may require specialised knowledge , you can’t be the guru of everything. Need find people that you can trust that you can support.

Software Craftsmanship –work towards Mentor Craftsmanship, lead by example – do it yourself no matter your position, cure the imposter syndrome – no separation of junior or senior (or intermediate), accept your weakness – don’t make excuses for your position and what you don’t know about, inspire people – hard to define but can do something without purpose or reward, just own happiness or satisfaction, bring the greater good.

They do one, one-to-one every month and the prepare throughout the month by noting down things as they happen throughout that month, things they did well, things they didn’t do well. You can be directional, don’t need to undermine anything provided externally, can just be supportive and help foster mentoring, either way. Can help to admit you don’t know something, and can keep yourself grounded.

Meta-Programming in C# 101 – How Stuff Works – David Whitney

Metaprogramming? Sounds scary! Reflection is looking at the metadata at runtime e.g. properties, types, methods etc. Using GetType that’s Metaprogramming – ZOMG!

Reflection is inspecting the state of application at runtime, the “type” type is useful even if you didn’t realise. Type is one part of a rich meta-model – the model of your model, this is a series of types that describe the types in memory, the API is reasonable consistent to access info of items such as properties and types etc. Metaprogramming is the glue that holds this all together, things like Entity Framework are using Metaprogramming.

Write your own test framework in an hour – archetypal example of metaprogramming. Test Framework instrument code and build test for Test Runner that then uses reflection to execute them and get the results. Test: Code Discovery, Execution, Assertion, Result Gathering and Assertion. Have a simple “TestFinder” – loads the Assembly full of Test, then use reflection to find those tests, find the possible “TestFixture” (Class Decorator) with custom attributes, then get the Test Methods from those fixtures, then get all methods that have the custom attribute called “Test” (Method Decorator). Activate – Execute these by creating an instance and invoke the type object, then passing in the instance then return the pass result if it worked, if there was an exception, return a failure. Test Reporter just outputs the Test Result as a “.” If failed or “x” if successful. Assertion Library is glorified If statement, everything else is just normal code, complexity comes from Setup and Teardown or things like SpecFlow.

MVC Framework – Divides software into unconnected parts to separate applications but can make the intent of the application difficult. Model > updates > View > sees > User > uses > Controller > manipulates > Model > repeat. MVC is just a framework that calls user code – just inspects URL and loads controller and runs some code – just like a test framework, then gets some results and outputs this. MVC really just started as a “HttpHandler” that process requests – the lowest level in MVC, a basic handler. MVC is metaprogramming bound to HTTP, when handler is constructed use Metaprogramming to look for types that end with “Controller” – cache this into a list so can refer to them later so don’t need to repeat this lookup, then it’s all about “ProcessRequest” method, from context, get controller, pick method, create instance and execute method. MVC uses sensible defaults – it just works, for example when the controller is null then can just return a “HomeController” -based on the URL passed in to get any existing controller from the path of this object. “PickMethod” can use the incoming URL to get the method, if no matching Action method is found default on “Index”. You can use Model Binder to convert a request to a Model using reflection, without Views this is essentially a Web API Framework.

IOC Containers – Inversion of Control, core of it is Create, (Register Type), “SelectType”. Registration API can add types to a dictionary in it’s most basic form. Create – looks for constructors with the most parameters and try to satisfy this, look through all the dependencies, call the method to fulfil the dependencies over and over, which does risk recursion issues. Container finds all the things you’re looking for and creates them, can build a simple IOC container that just works for a small app.

None Framework / Real World Metaprogramming Examples – Do the right thing by default, have simple conventions, help introduce strong conventions to help with programming, can forcefully implement an approach that uses reflection and have paths defined by classes for example and have regular patterns so things just work. Auto-wiring components, common to have lots of lines of wired up bindings, end of putting it at the bottom. Use method to get all the types where classes are not abstract and where there are interfaces for the same type then can register them all in one go, don’t manually register them all again! Protecting code quality, every class should follow a naming convention e.g. all Factory classes end with “Factory” – you can have a Unit Test that checks that Factories have the right naming convention using metaprogramming to check all classes in a Namespace and see’s what name it has before it’s checked in. Test will help diagnose issues as exceptions with reflection can be hard to figure out.

What’s the point of this talk? Metaprogramming has a reputation of being scary! But it’s not. Reflection has reputation of being slow but it’s not as slow as it used to be and can always cache this data so it’s only done once. Don’t be scared, there’s a benefit of predictability in your code, can remove repetition and reduce code to the bare minimum even down to nothing. Lots of really cool stuff uses metaprogramming, should make the obvious thing work and not make the right thing not obvious and not be too secret or “magical” – make the magic obvious, you can mature meta programming libraries over time.

JavaScript Services: Building Single Page Applications with ASP.NET Core – Sandeep Singh

This is a fairly new part of ASP.NET Core. Find out where we are with development, hoe to get started with JavaScript services, various SPA features. Web Development before 2009 – HTML, CSS, JS, Server Side, Database. Modern Front End (2017) – Libraries (e.g. Angular, React, jQuery), Architecture (Flux, Redux, MVC), JavaScript (TypeScript, ES2017, CoffeeScript), Build/Bundling (webpack, gulp/grunt, rollup), Module Loaders (ES6 imports, System.JS, AMD, CJS), Package Managers (npm, yarn, bower).

Building SPAs can be complex… Q. How can ASP.NET Core help? It has something called JavaScript Services allows you to build client side using JavaScript Frameworks – “SpaTemplates”, “SpaServices”, “NodeServices” with the latest tools on Visual Studio 2017 these are available on File > New Project.

Can do “dotnet new” with angular and other templates, can install more “SpaTemplates” to allow you to use more templates such as Aurelia and Vue. Four main areas of “SpaServices” include webpack middleware, hot module replacement, server-side pre-rendering, routing helpers.

Web pack – is a module bundler, takes lots of files like “.sass” and dependent JavaScript files and packages these up to be served to the client. Web Pack has better-structured support and make it easier to organise code. Web Pack has entry points for where to start bundling, module loaders – how to transform assets, plugins and how to bundle them and output for where to output bundle. Hot Module Replacement – Web Pack can also do module replacement – will change code running in browser without refreshing the page, it injects the correct change into the correct place and only refreshes this. Can use the dot net core watcher to rebuild CS files when they have been changed. With hot module replacement you can make changes and see them update instantly. You don’t lose state and can develop on the fly and any errors just get displayed when using React. You can add other modules to handle other file types easily, just have to remember to rebuild if changing this configuration.

Server-side Pre-rendering – Isomorphic JavaScript or run the same JavaScript on the server than on the client. Solve slow initial load time, improved SEO, enable content preview on social networks, fall-back support for older browsers. This is implemented as a tag helper and can improve performance and then hook up event handlers once this has loaded.

Routing Helpers – An MVC app has routes, allows for fall-back route, handle 404, routing order matters – static files, MVC route, SPA fall-back, not a silver bullet if client-side routes complex e.g. /test.sub. This is enabled on start-up to Map the SPA fall-back route.

Have “Microsoft.AspNetCore.SpaServices” then “Microsoft.AspNetCore.NodeServices” for services that are dependant on this have a dependency on Node.js but you can use it by itself. Fast and robust way to execute JS on server at runtime, “SPAService” uses library to implement features, access to vast NPM ecosystem, can be used outside of ASP.NET Core. Console application can use these features if needed as well. Can use “NodeServices” to pass in a HTML and convert this as PDF using some JavaScript and HTML PDF library, you could also use other features as well such as audio manipulation or anything that Node can do.

Deployment – “dot net publish”, the webpack is executed with a production flag where it will do all the minification and will take care of everything for you so don’t have to worry about it.

SpaTemplates are useful for rapid prototyping, webpack great for streamlining DC, “NodeServices” allow access to NPM and packages not available in the .NET ecosystem, can be used with an existing Single Page Application.

Become a chatbot builder with Microsoft Bot Framework – James Mann

Why Chatbots? Distribution – over 4 billion global user using messaging platforms, 6 out of the top 10 apps used globally are messaging apps. You can get your service out easily to all these users as they already have what they need. There’s a messaging ecosystem such as Skype, Slack, Teams etc. There’s a virtual assistant device ecosystem such as Cortana, Alexa and Google Home. 2016 was the year of the Chatbot. Use Cases are everywhere – Customer Service, Shopping Experience, Help Desk and Employee Support. Could provide automatic responses as 1st Line Support to deal with common issues, let people book holidays at work via chat bots.

What is a Bot Framework? Bot framework allows you to build, host and maintain one chatbot and target multiple channels, such as all the current popular platforms and any new ones that appear too. Bot Framework Architecture – your bot’s web service ASP.NET Web API and Bot Builder SDK to provide the plumbing, Bot Connector – provided by Framework and includes messages, states, sessions etc and Channels are all those supported and configurable by Bot Framework.

Your first chat bot! Register your chat bot via the Bot Framework Portal and give it the web API end-point and connects the registration to your Chat Bot, then you can build your Chatbot using C# or Node.js, Distribute – that can be on Facebook, Skype and more.

dev.botframework.com – you can sign up and get resources such as the SDK and Tools including Visual Studio Project templates and Bot Framework Emulator. Use nGrok to create a publicly accessible end point to a local endpoint for testing with other services – you get an ngrok.io end point and can change the configuration online to be this Endpoint for those services.

Modelling your conversation – you can use tools that offer different flexibility or effort to implement – can use QnA which is good for Questions and Answers, FormFlow is good for data capture / web forms scenarios, Dialogs which is good for multi-layered conversations, or Bespoke by rolling your own system but need to take into account scaling and session management.

Dialogs – entry point of a Chat Bot application is the main dialog and need to create decisions from there e.g. Check Balance, Make Payment, this then transitions into the relevant dialog such as Make Payment Dialog – where it says what to pay but maintains data in the main dialog. Dialog Transitions are used to maintain this with “Context.Wait” which waits for a user to send a message in the same dialog, “Context.Call()” call another Dialog and add it to the top of the stack or with “Context.Forward()” once dialog is done then “Context.Done()” is called to complete that part of the dialog / conversation. Need to maintain state and status of conversation – it serialises it to Blob Storage and can keep state and persist that between invocations.

Form Flow – Allows collection of information e.g. Parking Enquiry Chatbot, it makes it easy to automatically convert a class of values into a conversation and present the needed fields as questions, can use attributes to set wording of a question, the order the values are provided – these Prompt Attributes can be localised or set to use RegExs and can get the user to confirm. Proactive Messaging is way you can respond to conversations when an event has happened.

QnA Maker – can add intelligence and machine intelligence. Build, train and publish Q&A bots based on existing FAQs “qnamaker.ai”, you can import this via a file, URL or enter it manually which is then processed with machine learning and can then create a trained bot to then to use as an API end point that can be used by a Chat Bot. The FAQ source had the QnA extracted, indexed and ranked then through the Microsoft Bot Framework as a Chat Bot on any of the supported Channels, this is a simple as setting a Subscription Key and Knowledge Base Id in an Attribute.

Luis.ai – this is a tool for Natural Language processing, Utterance (input) – is a spoken or written message e.g. what was said, the Intent (output) what was the user intending to do, Entities (Output), what was the outcome that was intended needed to change such as set temperature for a Home Automation Chat Bot, can have a more Intelligent Chat Bot where there is a Luis Dialog and then via luis.ai get the Intents and Entities from the Utterance that was delivered to make it a more natural input with output that can be used to control elements such as heating for Temperature and more.

Create an account at dev.botframework.com, Download the Emulator + Node/C# SDK and start providing a conversation interface to your existing apps!

Enhancing your enterprise with modern Windows apps – James Croft

What is a modern application? Old applications aren’t touch friendly and elements or button tend to be too small for this. New applications such as Edge or Paint 3D are modern applications with larger input types.

Why UWP? Responsive design capabilities, allows for cross Windows 10 device deployment of single binary to Desktop, Tablet, Phone, Surface, HoloLens, Xbox and more to come! Controls built and design for multiple and new input types such as Gestures and Gaze, take advantage of newer APIs only available for UWP but still get access to some of the classic Win32 APIs.

Improvement in the App Mode – well defined structure to an app, communicate between other UWP apps, apps can be distributed from the Windows Store – automatically update on devices when new versions are available. Enterprise ready store available for distributing to business – an easier way of distributing and licensing, even simpler just distribute the “appx” and provides clean install and uninstall.

Converting apps with the Desktop Bridge, designed to migrate Win32 (classic) apps to UWP – WinForms or WPF – allows you to reuse the code, features and skills. It still runs as Win32 but is a wrapper for the app and allows access to the new APIs in UWP – Cons :some APIs make the app exclusive to desktop only e.g. Spotify , Pro – provides a step along the way to a full UWP application.

Crossing the Bridge, steps to Universal Windows Platform – create desktop “appx” package, enhance with windows 10 APIS available for desktop package, extend for more advanced capabilities in UWP, Migrate your UI to modern XAML, complete migration for true UWP

Bring your code, build your UWP – most code that is in a library can be used in UWP, using third-party NuGet packages in your Win32 app, if not possible you’ll find most code can be re-implemented for UWP using Windows APIS and this frees up development for the UWP specific XAML UI.

Get started with Windows Template Studio – Launched at Build, open-source in GitHub, Makes I easier to get started building apps for UWP, designed for all developer scenarios including LOB and follows best practices in development. Is a Visual Studio Extension you can install from the Marketplace and creates an application from parts such as Navigation Pane or use a Framework like MVVM Basic. Then you can add pages such a Settings Pages and Web Views or a Master / Detail page and will do all the necessary binding / code for these.

Take advantage of open source projects – community driven projects for you to use, UWP Community Toolkit provides easy to use helpers, controls & services including Microsoft Graph. UI for UWP from Telerik designed by control experts and is completely open source and includes controls such as forms, charting, gauges and data grid for free, or pay for support – which are enterprise level controls.

Going the extra mile – modern apps aren’t just Windows – you should also be considering cross platform, bring your .NET skills, learn platform UI and with Xamarin.Forms bring your XAML skills and it provides shared UI and shared code across all supported platforms. Business are more likely to adopt applications if they can choose the device they want to use.

Future proofing with .NET standard – designed to make it easer to transfer code between all flavours of .NET, support added for UWP providing a small set of APIS which was extended in 2.0 with thousands of APIS by targeting the Windows 10 Fall Creators Update

Taking advantage of “universal” Windows Platform – going portable with one device was possible with Continuum on Windows 10 Mobile. Providing experiences with ink – with pen-enabled devices, and can do it in one line of XAML for canvas or two for the Ink Toolbar, plus can add more features such as Ink Analysis. Take advantage of Surface Hub – designed to be collaborative and is a niche product but there is demand for apps for the product. Building custom experiences for mixed reality – this is the biggest extreme for UWP, blending real world objects with digital objects and is designed for the Enterprise space. There are also third-party headsets that run on the same platform of Windows Mixed Reality. Building custom experienced for mixed reality such as Trimble for architectural models, it also allows for adjustments to the models and allow these to be easily visualised. Black Marble have build a 3D application for Scene of Crime analysis, built in Unity.

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s