Other news? async and await Anonymous types (var, dynamic) Tuples Object instantiation Extension methods UCN Teknologi/act2learn1FEN 2014.

Slides:



Advertisements
Similar presentations
Sml2java a source to source translator Justin Koser, Haakon Larsen, Jeffrey Vaughan PLI 2003 DP-COOL.
Advertisements

Developer Knowledge Sharing Eric Sun Dec, What programming language did you learn in school and since then? Now, its time to refresh …
Optional Static Typing Guido van Rossum (with Paul Prescod, Greg Stein, and the types-SIG)
Dynamic internals. Introductions  Alexandru Ghiondea  C# Compiler QA  
.NET 3.5 – Mysteries. NetFx Evolution NetFx 1.0 C# 1.0, VB 7.0, VS.NET NetFx 1.1 C# 1.1, VB 7.1, VS 2003 NetFx 2.0 C# 2.0, VB 8.0, VS 2005 NetFx 3.0 C#
Overview of.NET Framework Sanjay Vyas. Whats New In Base Class Library Declaration & consumption of extensibility points Monitoring for new runtime extension.
How to be a C# ninja in 10 easy steps. Benjamin Day.
Road Map Introduction to object oriented programming. Classes
Evan Korth New York University Computer Science I Classes and Objects Professor: Evan Korth New York University.
C++ data types. Structs vs. Classes C++ Classes.
Terms and Rules Professor Evan Korth New York University (All rights reserved)
(c) University of Washington03-1 CSC 143 Java Inheritance Reading: Ch. 10.
Managed Code Generics Language Integrated Query Dynamic + Language Parity C# VB 11.0 Windows Runtime + Asynchrony C# VB 7.0 C# VB.
Eric Vogel Software Developer A.J. Boggs & Company.
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
Joe Hummel, PhD Technical Staff: Pluralsight Adjunct Professor: UIC, LUC
Ceg860 (Prasad)L6MR1 Modularity Extendibility Reusability.
Mads Torgersen, Microsoft.  Language INtegrated Query  An open multi-language query facility  Uses cool language stuff  Points into the future.
Consuming REST Services from C# SoftUni Team Technical Trainers Software University
CSE 219 Computer Science III Program Design Principles.
1 Classes and Controls CE-105 Spring 2007 By: Engr. Faisal ur Rehman.
How to be a C# ninja in 10 easy steps Benjamin Day.
Parallel Programming: Responsiveness vs. Performance Joe Hummel, PhD Microsoft MVP Visual C++ Technical Staff: Pluralsight, LLC Professor: U. of Illinois,
Session 08 Module 14: Generics and Iterator Module 15: Anonymous & partial class & Nullable type.
Hoang Anh Viet Hà Nội University of Technology Chapter 1. Introduction to C# Programming.
Created By: Kevin Cherry. A library that creates a display to run on top of your game allowing you to retrieve/set values and invoke methods.
CSE 425: Data Types I Data and Data Types Data may be more abstract than their representation –E.g., integer (unbounded) vs. 64-bit int (bounded) A language.
OOP: Encapsulation,Abstraction & Polymorphism. What is Encapsulation Described as a protective barrier that prevents the code and data being randomly.
WHO WILL BENEFIT FROM THIS TALK TOPICS WHAT YOU’LL LEAVE WITH ASP.NET developers, including Web Forms & MVC History of async programming in.NET How async.
Object Oriented Software Development
Python Functions.
Asynchronous Web Services Writing Asynchronous Web Services SoftUni Team Technical Trainers Software University
Upcoming Presentations ILM Professional Service – Proprietary and Confidential ( DateTimeTopicPresenter March PM Distributed.
Programming with Java © 2002 The McGraw-Hill Companies, Inc. All rights reserved. 1 McGraw-Hill/Irwin Chapter 5 Creating Classes.
Interface: (e.g. IDictionary) Specification class Appl{ ---- IDictionary dic; dic= new XXX(); application class: Dictionary SortedDictionary ----
Data Parallelism Task Parallel Library (TPL) The use of lambdas Map-Reduce Pattern FEN 20141UCN Teknologi/act2learn.
PROGRAMMING IN C#. Collection Classes (C# Programming Guide) The.NET Framework provides specialized classes for data storage and retrieval. These classes.
PHP vs. Python. Similarities are interpreted, high level languages with dynamic typing are Open Source are supported by large developer communities are.
Method Overriding Remember inheritance: when a child class inherits methods, variables, etc from a parent class. Example: public class Dictionary extends.
FEN 2014UCN Teknologi/act2learn1 Object-Oriented Programming “ The Three Pillars of OOP”: Encapsulation Inheritance Polymorphism The Substitution Principle.
Personalizing Web Sites Nasrullah. Understanding Profile The ASP.NET application service that enables you to store and retrieve information about users.
C# Fundamentals An Introduction. Before we begin How to get started writing C# – Quick tour of the dev. Environment – The current C# version is 5.0 –
C# Present and Future Marita Paletsou Software Engineer.
C# 5.0 Alex Davies 22 nd December What we will cover C# 5.0,.NET 4.5, Visual Studio 11 Caller Info Attributes Upgrade from synchronous to asynchronous.
THE FUTURE OF C#: GOOD THINGS COME TO THOSE WHO ‘AWAIT’ Joseph Albahari SESSION CODE: DEV411 (c) 2011 Microsoft. All rights reserved.
CE-105 Spring 2007 By: Engr. Faisal ur Rehman
Part 1: Overview of LINQ Intro to LINQ Presenter: PhuongNQK.
DotNetSpider Editor Hefin Dsouza
The Future of C# and Visual Basic
/* LIFE RUNS ON CODE*/ Konstantinos Pantos Microsoft MVP ASP.NET
Names and Attributes Names are a key programming language feature
Async or Parallel? No they aren’t the same thing!
Microsoft .NET 3. Language Innovations Pan Wuming 2017.
New Features of C# Kuppurasu Nagaraj Microsoft Connect 2016
Array Array is a variable which holds multiple values (elements) of similar data types. All the values are having their own index with an array. Index.
Generics, Lambdas, Reflections
Functional Programming with Java
Object Oriented Practices
.NET and .NET Core 5.2 Type Operations Pan Wuming 2016.
.NET and .NET Core 9. Towards Higher Order Pan Wuming 2017.
12 Asynchronous Programming
AVG 24th 2015 ADVANCED c# - part 1.
6 Delegate and Lambda Expressions
1.2 Key Concepts and Walkthroughs
Tonga Institute of Higher Education
Groovy.
C++ data types.
Threads and concurrency / Safety
Presentation transcript:

Other news? async and await Anonymous types (var, dynamic) Tuples Object instantiation Extension methods UCN Teknologi/act2learn1FEN 2014

Asynchronous calls in C# Two new keywords making it easier to do asynchronous calls (methods running in separate threads) have been added to the new version of C# (5.0,.NET 4.5, VS 2012): – async – await UCN Teknologi/act2learn2 demos\CS-code\Async-Web Example by Joe Hummel, PhD FEN 2014

Asynchronous calls in C# The sequential version blocks until the web response is received: UCN Teknologi/act2learn3FEN 2014

Asynchronous calls in C# Methods accessing the remote site are declared async. It will run in its own thread. The return type must be Task. The await suspends the caller until the called method returns. UCN Teknologi/act2learn4FEN 2014

Anonymous types var is strongly typed: – The compiler infers the type. – Used with LINQ (and also misused a lot) dynamic is weakly typed: – Typing is done runtime. – Dangerous! – Useful when interacting with for working with python code, or old VB6 / COM objects, or… – Great for working with objects created through reflection View demos\VarVsDynamicdemos\VarVsDynamic UCN Teknologi/act2learn5FEN 2014

Tuple Tuples represent – tuples (up to 8 values) Can be used when a method wants to return more than one value (for instance a part of an object or a database row). View demos\TupleExampledemos\TupleExample Can also be achieved using structs, but remember: structs are value types. UCN Teknologi/act2learn6FEN 2014

Anonymous types Can be used as an alternative to tuples. Fields may be named View demos\AnoTypesdemos\AnoTypes UCN Teknologi/act2learn7FEN 2014

Easy object instantiation An easy way to call a default constructor View demos\ObjectCreationdemos\ObjectCreation Requires read/write properties. UCN Teknologi/act2learn8FEN 2014

Extension methods An easy way to add a method to an existing class (assemply). View demos\ExtensionMethodExampledemos\ExtensionMethodExample Note, we are not violating encapsulation. The extension method can only access public methods and properties of the class. UCN Teknologi/act2learn9FEN 2014

Other New stuff Highlights… – System.Diagnostics.Contracts: view exampleview example – System.Numerics.BigInteger – System.Numerics.Complex – System.Collections.Concurrent : queue, stack, dictionary, … – … UCN Teknologi/act2learn10FEN 2014

Is it good news? Generics Delegates and lambdas TPL async and await Anonymous types (var, dynamic) Tuples Object instantiation Extension methods System.Diagnostics.Contracts System.Numerics.BigInteger System.Numerics.Complex System.Collections.Concurrent UCN Teknologi/act2learn11FEN 2014

Tak for denne gang UCN Teknologi/act2learn12FEN 2014