Robert Green | Technical Evangelist Dmitry Lyalin | Product Marketing Manager.

Slides:



Advertisements
Similar presentations
Building Scalable Web Apps with Windows Azure Name Title Microsoft Corporation.
Advertisements

Data Access Layer (DAL) App Logic Database View Web Service App Logic Trust Boundary.
Building Web APIs in Windows Azure Name Title Microsoft Corporation.
Ronnie Saurenmann Principal Architect Microsoft Switzerland
Meet Jeremy Thake Jeremy recently joined Microsoft as Technical Product Manager for the Visual Studio Developer story for Office 365 development.
05 | Data Access with Entity Framework Bruno Terkaly | Technical Evangelist Bret Stateham | Technical Evangelist.
Multitenant Model Request/Response General Model.
App development in SharePoint 2013 LIVE Introducing Cloud App Model Cloud-hosted Apps Experiences from the Field.
Robert MacLean BBD Software Get Ready For The Cloud TRACK: Cloud & ALM.
> Utilize Windows Azure as integrated component of xRM solutions > Introduce new xRM capabilities in Dynamics CRM “5” > Demonstrate rapid development.
Getting Started with Windows Azure Name Title Microsoft Corporation.
Service Interfaces Atom & AtomPub Atom-Enabled Data Services Drill Down: Windows Live Spaces Photos Data Services Framework Wrap-up.
08 | What’s Next and Resources Jon Galloway | Tech Evangelist Christopher Harrison | Head Geek.
Project “Astoria” first announced in Mix 2007 Shared early prototypes, got tons of feedback Now we’re talking about the real deal Production quality bits,
SQL Server SQL Azure Visual Studio“Quadrant” SQL Server Modeling Services Entity Framework ADO.NET“M”/EDM Data Services …
Azure Services Platform Update James Conard Sr. Director Developer & Platform Evangelism Microsoft Corporation.
“I type in my browser to watch a movie” “My friend mentions the TV series Breaking Bad over a coffee.
demo Instance AInstance B Read “7” Write “8”
Why data services? Common challenges when creating rich web applications Creating rich web applications with data services Future scenarios & roadmap.
Building a real-world, Internet- scale stock trading application Naveen Prabhu Quadwave Consulting Pvt. Ltd.
customer.
Building State of the art presentation tiers Nauzad Kapadia
Nikhil Kothari Software Architect Microsoft Corporation Session Code: WUX312.
06 | HTTP Services with Web API Bruno Terkaly | Technical Evangelist Bret Stateham | Technical Evangelist.
04 | Business Analyzer Brian Meier| Senior Lead Program Manager.
Demo Fest of Some Leading Store Apps Module 2.
07 | Advanced WCF Topics Bruno Terkaly | Technical Evangelist Bret Stateham | Technical Evangelist.
05 | Xamarin Forms, kódosztási technikák Farkas Bálint | Technical Evangelist | Microsoft.
Data Access Methodologies: When to choose what (ADO.NET, Entity Framework, WCF Data Services) Wriju Ghosh Lead Partner Consultant, Microsoft.
Cloud Roadshow. Advanced Web Development using Angular with Office 365 APIs.
Course Agenda Deep Dive into the Building Blocks and Services of the SharePoint Platform Module 1: Developing Advanced Workflow Scenarios in Office 365.
The cutting edge event for ITPros and Devs December 7-8, 2013 Athens, Greece Fix it once use it everywhere Elias Markelis MCT, Windows Phone Enthusiast.
Part time at Arcanic and freelance consultant Mostly backend development Past few years focus has been on Windows Phone and Windows Store (Windows 8/8.1)
Introduction to Windows Azure AppFabric
About Bill Bill Baer (ˈbɛər)
6/2/2018 4:08 AM BRK3327 Ten things you didn't know about building .NET UWP apps in Visual Studio 2017 Daniel Jacobson Program Manager – Visual Studio.
Office 365 Development July 2014.
Build data-driven collection and list apps using XAML
End to end app development ASP.NET, WCF, WF, EF, & RIA Services
Building real-time web apps with WebSockets using IIS, ASP.NET and WCF
Office 365 Development.
Azure Active Directory
Office 365 Development July 2014.
Developer Patterns to Integrate Silverlight 4.0 with SharePoint 2010
MIX 09 11/23/2018 6:07 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Windows Azure Keenan Newton 3-021
TechEd /6/2018 8:16 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
TechEd /9/2018 4:17 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
TechEd /15/2019 8:08 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
What’s new for Windows 8 Devs Part 2
Pablo Castro Software Architect Microsoft Corporation
Office 365 Development.
Building Metro style apps with XAML with .NET
TechEd /22/2019 9:22 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Build /23/2019 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
From Development to Production: Optimizing for Continuous Delivery
Building and Migrating Modern Enterprise Line of Business Applications
Microsoft Office 4/3/2019 Deep Dive into native Universal App development with the Office 365 APIs Speaker name Title Microsoft Corporation © 2012 Microsoft.
Brandon Bray Principal Group Program Manager Microsoft Corporation
XAML Deep Dive for Windows & Windows Phone Apps Jump Start
Accessing Web Services in Silverlight 4
Enterprise Developer Camp Jumpstart
What’s new in Visual Studio 2012
07 | Introduction to Authentication
Day 2, Session 2 Connecting System Center to the Public Cloud
Office 365 Development.
Bringing existing managed code into Metro style apps
Erik Porter Program Manager ASP.NET Microsoft Corporation
Tech Ed North America /6/2019 2:07 PM Required Slide
9/14/2019 6:51 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Presentation transcript:

Robert Green | Technical Evangelist Dmitry Lyalin | Product Marketing Manager

02 | Adopt a Services Architecture Dmitry Lyalin | Product Marketing Manager

Our scenario Asynchronous programming Portable class libraries Inversion of control Model-View-ViewModel (MVVM) WCF & Web API OData We’re only touching on each of these—there is a lot more out there! Module Overview

Our Scenario

Typical line-of-business application Create & submit reports View past reports Approve reports (if manager) Our scenario: expense reporting

Corporate Network Application topography Expenses DB (SQL) Expenses services (WCF on Windows Server) UI (WPF) Active Directory

DEMO Expenses App

Async, PCLs, IoC

Expense reporting backlog Improve architecture, maintainability, and quality –Adopt a services architecture Improve accessibility, scalability, and operations –Move to the cloud Update the user experience –Build a more modern-looking user experience Expand device support –Companion apps for Windows Store and Windows Phone

Asynchronous programming Critical for responsive UI, scale, & user satisfaction Traditionally a challenge due to manual requirements APIs often inconsistent –Polling –Callbacks –Events –Begin/End Progress and cancellation often not supported Error reporting unpredictable

Introducing async & await async makes your method asynchronous –Expects “await” in body –Only top-level methods (main, event handlers, etc) should be “async void” await makes the rest of your method a callback

Introducing async & await Paradigm being applied across all Microsoft platforms –Microsoft internal guidelines recommend Async for any API that could take longer than 50ms to complete Enables consistent progress, cancellation, and error infrastructure –Note that API support for progress and/or cancellation itself varies

Using async APIs with await FileOpenPicker picker = new FileOpenPicker(); picker.FileTypeFilter.Add(".jpg"); StorageFile file = await picker.PickSingleFileAsync(); IRandomAccessStream stream = await file.OpenAsync(...); BitmapDecoder decoder = await BitmapDecoder.CreateAsync(stream); decoder. …

Exposing an async API Return a Task or Task “async” is not necessary, unless you are using “await” within the method

Building an async API examples public Task RequestDataAsync(Uri uri) { return Task.Run ( () => { WebClient webClient = new WebClient(); return webClient.DownloadString(uri); }); } // Create Tasks when you have no other choice. public Task RequestDataAsync(Uri uri) { var tcs = new TaskCompletionSource (); WebClient webClient = new WebClient(); webClient.DownloadStringCompleted += (_, args) => { tcs.SetResult(args.Result); }; webClient.DownloadStringAsync(uri); return tcs.Task; } // Example of wrapping Async/Completed. public async void Method(string[] args) { MyClass instance = new MyClass(); string result = await instance.RequestDataAsync(new Uri("...")); } public Task RequestDataAsync(Uri uri) { WebClient webClient = new WebClient(); return webClient.DownloadStringTaskAsync(uri); } // Rely on underlying Tasks whenever possible.

Additional async resources Async'ing Your Way to a Successful App with.NET – Creating Async Libraries That Are Modular, Reusable and Fast, in Microsoft Visual C# and Visual Basic –

Portable class libraries (PCLs) One source One project One binary Multiple platforms!

What can I use and where? Feature.NET Framework Windows Store Silverlight Windows Phone Core√√√√ LINQ√√√√ IQueryable√√√7.5 and higher Dynamic keyword4.5 and higher√√ Managed Extensibility Framework (MEF) √√√ Network Class Library (NCL)√√√√ Serialization√√√√ Windows Communication Foundation (WCF) √√√√ Model-View-View Model (MVVM)4.5 and higher√√√ Data annotations4.0.3 and 4.5+√√ XLINQ4.0.3 and 4.5+√√√ System.Numerics√√√

PCL tips Consider the platform tradeoffs from pulling in new libraries –Also check out NuGet for similar/updated packages supporting more platforms The more you do in PCLs, the broader that functionality can be leveraged

PCL tips Be careful about building PCLs too directly for a single consumer if others are planned, such as: –Assuming one auth model (like Basic) when other scenarios (AD, Oauth, etc) could be well supported with a little more planning –User selection of a file on desktops is significantly different from devices Abstract platform services as interfaces, and require those dependencies to be provided by the consumer –File access, UI, system services, etc.

Inversion of control (IoC) The Hollywood Principle –“Don’t call us, we’ll call you” Objects rely on their dependencies from the outside –Data connections –Algorithms –Platform-specific services Dependencies are usually provided as abstractions –IExpenseRepository –INavigationService –IPlatformService Enables thorough automated testing

IoC patterns Factory Dependency injection –Constructor –Parameter –Setter Service locator is considered an anti-pattern in many circles, but is sometimes the most cost-effective options –Framework requires parameterless constructors –No support from MVVM libraries

DEMO IoC and Testing

Model-View-ViewModel (MVVM)

MVVM refresher Design/development separation Code reuse Multiple views on the same logic View-logic testability Model View (XAML) View Model

MVVM overview View –User interface –Navigate to views –Interaction layer ViewModel –Application logic –Service calls –Data management Model –Simple representation of data –No logic or functionality Model View (XAML) ViewModel Data Bindings Commands

Data binding View - XAML –Text=“{Binding MyProperty}” ViewModel - C# –INotifyPropertyChanged View (XAML) ViewModel Data Bindings

Commands View XAML –Command=“{Binding MyCommand}” ViewModel - C# –ICommand –DelegateCommand –RelayCommand View (XAML) ViewModel Commands

Portable MVVM structure Portable Class Libraries Application Services ViewModels (limited or abstract) Models Views (XAML) App Lifecycle Navigation ViewModels (Storage, Alerts, Timers)

DEMO MVVM

No philosophy is perfect, especially not MVVM Understand the benefits of MVVM frameworks –PRISM –MVVM Light –Many others… Rely on tested patterns –Commanding –Dependency Injection –Inversion of Control –Observer –Repository –Service Locator –Many others… MVVM tips

Data Services

External services Always a good idea to abstract Protect DB calls –Even a simple service layer is worth it When in doubt, use a standard –SOAP, REST over HTTP, etc Use a service bus to traverse network boundaries –Internet client relying on an intranet service, for example

Windows Communication Foundation vs. Web API WCF –Multiple transport protocols –Multiple encodings WS-* standards Supports Request-Reply, One Way, and Duplex message exchange patterns Web API (preferred for new projects) –HTTP only –Supports a wide variety of media types (XML, JSON, etc) –Uses basic protocol and formats including HTTP, WebSockets, SSL –Is request/response due to nature of HTTP, but more patterns available via SignalR and WebSockets integration

OData, the Open Data Protocol A standardized protocol built on HTTP Uses the REST methodology Designed for formats like XML, ATOM, and JSON Provides a uniform way to represent metadata Client data context-friendly Great ecosystem of tools and developers Available via WCF Data Services and Web API

Summary

Asynchronous programming Portable class libraries Inversion of control Model-View-ViewModel (MVVM) WCF & Web API OData Summary

Asynchronous Programming in the Microsoft.NET Framework 4.5 – H302#fbid=kt1W5OJuY58 Modernizing WPF Line-of-Business Applications – B325#fbid=kt1W5OJuY58 Understanding Dependency Injection and Those Pesky Containers – B207#fbid=kt1W5OJuY58 Resources

Using Portable Class Libraries – H323#fbid=kt1W5OJuY58 Getting Started with MVVM – MVVM Resources

©2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.