+ All Categories
Home > Documents > C-Jumpstart Module 7.pdf

C-Jumpstart Module 7.pdf

Date post: 02-Apr-2018
Category:
Upload: edmundo-lozada
View: 222 times
Download: 0 times
Share this document with a friend

of 25

Transcript
  • 7/27/2019 C-Jumpstart Module 7.pdf

    1/25

    Programming in C# Jump StartJerry Nixon | Microsoft Developer EvangelistDaren May | President & Co-founder, Crank211

  • 7/27/2019 C-Jumpstart Module 7.pdf

    2/25

    07 | Advanced C#, Part 3Jerry Nixon | Microsoft Developer EvangelistDaren May | President & Co-founder, Crank211

  • 7/27/2019 C-Jumpstart Module 7.pdf

    3/25

    Interacting with the File System Working with REST Services

    Module Overview

  • 7/27/2019 C-Jumpstart Module 7.pdf

    4/25

    MVA

    Interacting with the File System

  • 7/27/2019 C-Jumpstart Module 7.pdf

    5/25

    Show existing data to user Integrate user-provided data Serialize objects out of memory Persist data across sessions Determine environment configuration

    Why read or write to the file system?

  • 7/27/2019 C-Jumpstart Module 7.pdf

    6/25

    This is simplified with Framework methods; open / sh

    File.WriteAllText / ReadAllText Open for reading to keep open and keep writing Open as stream for large payloads and realtime proc

    How do we write to files? (027)

  • 7/27/2019 C-Jumpstart Module 7.pdf

    7/25

  • 7/27/2019 C-Jumpstart Module 7.pdf

    8/25

    Get Windows folder with Environment Special Folders Get the Current folder with File.IO Get Current Direct Use Isolated Storage dedicated to the current applica Anything Else. Caveat: Windows Store App developm

    How do we find files? (027)

  • 7/27/2019 C-Jumpstart Module 7.pdf

    9/25

  • 7/27/2019 C-Jumpstart Module 7.pdf

    10/25

    Iterate through files using GetFiles() Rename / Move with System.IO methods Get File Info with Syetem.UI.FileInfo

    How do we modify files? (027)

  • 7/27/2019 C-Jumpstart Module 7.pdf

    11/25

  • 7/27/2019 C-Jumpstart Module 7.pdf

    12/25

    MVA

    Leveraging Web Services

  • 7/27/2019 C-Jumpstart Module 7.pdf

    13/25

    Web Services encapsulate implementation Web Services expose to disparate system Web Services allow client systems to communicate se

    Web protocols (HTTP, GET, POST, etc)

    Web Services are important to Service Oriented Arch With and without metadata

    Loose coupling

    What are Web Services?

  • 7/27/2019 C-Jumpstart Module 7.pdf

    14/25

    SOAP is a standard for returning structured data fromService as XML Envelope

    Header

    Body

    SOAP handling is a built-in feature of Visual Studio

    What is SOAP?

  • 7/27/2019 C-Jumpstart Module 7.pdf

    15/25

  • 7/27/2019 C-Jumpstart Module 7.pdf

    16/25

    REST is becoming a common, industry standard REST does not require XML parsing REST does not require a message header REST is generally human-readable REST uses less bandwidth thank SOAP REST services typically return XML or JSON JSON is JavaScript Object notation

    JSON is becoming a common, industry standard

    JSON is generally a lighter payload than XML (or SOAP)

    What is REST?

  • 7/27/2019 C-Jumpstart Module 7.pdf

    17/25

  • 7/27/2019 C-Jumpstart Module 7.pdf

    18/25

    REST Services and Serialization

  • 7/27/2019 C-Jumpstart Module 7.pdf

    19/25

    MVA

    Asynchronous Programming

    Wh t i h i ?

  • 7/27/2019 C-Jumpstart Module 7.pdf

    20/25

    Asynchronous maximizes resources on multicore systallowing units of work to be separated and complete

    Asynchronous programming frees up the calling systespecially a user interface, as to not wait for long ope

    What is asynchronous programming?

    Wh t i th C# ASYNC/AWAIT k d

  • 7/27/2019 C-Jumpstart Module 7.pdf

    21/25

    Async and await simplify asynchronous programming Async and await allow asynchronous code to resembstructure of synchronous code. Methods marked with async may return Task. The async keyword instructs the compiler to allow aw The await keyword instructs the method to return. The await keyword instructs the compiler to resume ewithin the same context after the operation is comple

    What is the C# ASYNC/AWAIT keywords

  • 7/27/2019 C-Jumpstart Module 7.pdf

    22/25

  • 7/27/2019 C-Jumpstart Module 7.pdf

    23/25

    Mod le Recap

  • 7/27/2019 C-Jumpstart Module 7.pdf

    24/25

    Interacting with the File System Working with REST Services

    Module Recap

  • 7/27/2019 C-Jumpstart Module 7.pdf

    25/25

    2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Office, Azure, System Center, Dynamics and other product names are or may be registered trathe 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 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 tprovided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTA


Recommended