Bill Campbell, UMB Microsoft's.NET C# and The Common Language Runtime.

Slides:



Advertisements
Similar presentations
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 12 Introduction to ASP.NET.
Advertisements

CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics C# Language &.NET Platform 12 th -13 th Lecture Pavel Ježek.
CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics C# Language &.NET Platform 6 th Lecture Pavel Ježek
C# Language Report By Trevor Adams. Language History Developed by Microsoft Developed by Microsoft Principal Software Architect Principal Software Architect.
Chapter 1: Computer Systems
C#: Data Types Based on slides by Joe Hummel. 2 UCN Technology: Computer Science Content: “.NET is designed around the CTS, or Common Type System.
CS 4800 By Brandon Andrews.  Specifications  Goals  Applications  Design Steps  Testing.
The Java Programming Language
C#.NET C# language. C# A modern, general-purpose object-oriented language Part of the.NET family of languages ECMA standard Based on C and C++
Outline Java program structure Basic program elements
History  We first begin with Java which was released in 1995 by Sun Microsystems  Initially Java was 100% interpreted at runtime and was very slow 
C#/.NET Jacob Lewallen. C# vs.NET.NET is a platform. Many languages compile to.NET: –VB.NET –Python.NET –Managed C++ –C#
Peter Juszczyk CS 492/493 - ISGS. // Is this C# or Java? class TestApp { static void Main() { int counter = 0; counter++; } } The answer is C# - In C#
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Programming Handheld and Mobile devices 1 Programming of Handheld and Mobile Devices Lecture 20 Microsoft’s Approach 3 – C# Rob Pooley
Platforms and tools for Web Services and Mobile Applications Introduction to C# Bent Thomsen Aalborg University 3rd and 4th of June 2004.
Differences between C# and C++ Dr. Catherine Stringfellow Dr. Stewart Carpenter.
Programming in C# Language Overview
CS 192 Lecture 3 Winter 2003 December 5, 2003 Dr. Shafay Shamail.
1 Identifiers  Identifiers are the words a programmer uses in a program  An identifier can be made up of letters, digits, the underscore character (
Java: Chapter 1 Computer Systems Computer Programming II.
Java Language and SW Dev’t
Java2C# Antonio Cisternino Part II. Outline Array types Enum types Value types  differences from classes  boxing and unboxing Delegate types  Base.
Web Services Week 2 Aims: Getting started with creating simple C# applications within Visual Studio.NET Objectives: –An introduction to the syntax of C#.NET.
Distributed Systems (236351) Tutorial 1 - Getting Started with Visual Studio C#.NET.
Introduction to Java University of Sunderland CSE301 Harry R. Erwin, PhD.
The Java Programming Language
C#C# Introduction CS3260 Dennis A. Fairclough Version 1.0 Introduction CS3260 Dennis A. Fairclough Version 1.0.
C# D1 CSC 298 Elements of C# code (part 2). C# D2 Writing a class (or a struct)  Similarly to Java or C++  Fields: to hold the class data  Methods:
Hoang Anh Viet Hà Nội University of Technology Chapter 1. Introduction to C# Programming.
C# EMILEE KING. HISTORY OF C# In the late 1990’s Microsoft recognized the need to be able to develop applications that can run on multiple operating system.
Introduction to C#. Why C#? Develop on the Following Platforms ASP.NET Native Windows Windows 8 / 8.1 Windows Phone WPF Android (Xamarin) iOS (Xamarin)
Computing with C# and the.NET Framework Chapter 2 C# Programming Basics ©2003, 2011 Art Gittleman.
AUC Technologies Projects Consulting, Development, Mentoring, and Training Company.NET Basic Fundamentals Presented By : Muhammad Atif Hussain Deputy Manager.
C# C1 CSC 298 Elements of C# code (part 1). C# C2 Style for identifiers  Identifier: class, method, property (defined shortly) or variable names  class,
ITF11006.NET The Basics. Data Types – Value Types – Reference Types Flow Control – Conditional – Loop Miscellaneous – Enumerations – Namespaces Class.
Chapters 2 & 3. .NET Software development model that allows applications created in disparate programming languages to communicate Universal data access.
Managing C++ CHRIS DAHLBERG MID-TIER DEVELOPER SCOTTRADE.
CHARLES UNIVERSITY IN PRAGUE faculty of mathematics and physics C# Language &.NET Platform 9 th Lecture Pavel Ježek
Object Oriented Software Development 4. C# data types, objects and references.
Introduction to C# By: Abir Ghattas Michel Barakat.
Quick Review of OOP Constructs Classes:  Data types for structured data and behavior  fields and methods Objects:  Variables whose data type is a class.
Introduction to C# Anders Hejlsberg Distinguished Engineer Developer Division Microsoft Corporation.
Session 02 Module 3: Statements and Operators Module 4: Programming constructs Module 5: Arrays.
User Interface Programming in C#: Basics and Events Chris North CS 3724: HCI.
© 2011 Pearson Education, publishing as Addison-Wesley Chapter 1: Computer Systems Presentation slides for Java Software Solutions for AP* Computer Science.
1 Problem Solving  The purpose of writing a program is to solve a problem  The general steps in problem solving are: Understand the problem Dissect the.
C++ Lesson 1.
C# for C++ Programmers 1.
C# - OOP TTU IT College , Autumn SEMESTER Andres käver.
Working with Java.
Jim Fawcett CSE775 – Distributed Objects Spring 2009
Microsoft .NET 3. Language Innovations Pan Wuming 2017.
Application Foundation
Computing with C# and the .NET Framework
CS360 Windows Programming
Reserved Words.
Introduction to C# AKEEL AHMED.
C# In many ways, C# looks similar to Java
.NET and .NET Core 5.2 Type Operations Pan Wuming 2016.
Programming in C# CHAPTER 1
null, true, and false are also reserved.
Conditional Statements
Introduction to Java Programming
JavaScript Reserved Words
Module 2 Variables, Assignment, and Data Types
Programming Language C Language.
Quiz Points 1 Rules Raise your hand if you know the question
Agenda Types and identifiers Practice Assignment Keywords in Java
Jim Fawcett CSE681 – Software Modeling and Analysis Fall 2006
Presentation transcript:

Bill Campbell, UMB Microsoft's.NET C# and The Common Language Runtime

Bill Campbell, UMB Correspondence Java (J2EE).Net Family of Standards Family of Products Cross platform Windows Java C# (VB, C++, Jscript) & others & others JSPASP+

Bill Campbell, UMB Correspondence (cont) Java (J2EE).Net JDBC.ADO EJBDCOM+ IIOP, SOAP (xml) Remoting, SOAP Several Vendors One vendor

Bill Campbell, UMB C# a language for programmers From C and C++ From C and C++ Managed Data (garbage collection) Managed Data (garbage collection) Larger than Java Larger than Java (80 vs 50 keywords)(80 vs 50 keywords) Preprocessing directives, #ifdef etc.Preprocessing directives, #ifdef etc. Operator overloadingOperator overloading Syntactic sugar (convenience)Syntactic sugar (convenience)

Bill Campbell, UMB Everybody's an Object Type Value Type Ref Type Scalar Enumeration Class Interface Structure (stack allocated) (heap allocated) Delegate

Bill Campbell, UMB Choice in Scalars sbytefloatchar bytedoublebool shortdecimal ushortintuintlongulong

Bill Campbell, UMB Scalars are structs int is really syntax for Int32 struct Int32 {...} so, e.g. 56.ToString()

Bill Campbell, UMB keywords abstract as base bool break byte case catch char checked class const continue decimal default delegate do double else enum event explicit extern false final fixed float for foreach goto if implicit in int interface internal is lock long namespace new null object operator out override params private protected public readonly ref return sbyte sealed short sizeof stackalloc static string struct switch this throw true try typeof uint ulong unchecked void volatile while

Bill Campbell, UMB foreach foreach (int elem in intArray) {…} foreach (BankAccount acct in accounts) {…}

Bill Campbell, UMB Properties mimic field syntax Temperature t = New Temperature(...);... double c = t.DegreesCelsius;... t.DegreesCelsius = 0.0; double f = t.DegreesFarenheit; // 32.0

Bill Campbell, UMB Behave like getters and setters public double DegreesCelsius {get{ return degreesCelsius; }set{ degreesCelsius = value; }}

Bill Campbell, UMB DegreesFahrenheit Property public double DegreesFahrenheit {get{ return 9.0/5.0*DegreesCelsius ; }set{ DegreesCelsius = 5.0/9.0*(value-32.0); }}

Bill Campbell, UMB Indexers public class BitSet { ulong word; ulong word; public bool this[int position] public bool this[int position] {get{ if (position 63) if (position 63) throw new IndexOutOfRangeException(); else else return word & (1 << position) != 0; }...}

Bill Campbell, UMB Properties and Indexers Ubiquitous button.Size "cat".length => 3 "cat"[1] => 'a' hashtable["key"] = "value";... hashtable["key"] => "value"

Bill Campbell, UMB Boxing and Unboxing Like Java, Collections of (Reference) Objects hashtable["one"] = (object) 1; // 1 boxed hashtable["one"] = (object) 1; // 1 boxed int one = (int) hashtable["one"]; // unboxed int one = (int) hashtable["one"]; // unboxed

Bill Campbell, UMB Delegates and Events Type safe callbacks Button button = new Button("Press Me"); button.Click += new System.EventHandler(button_Click);... private void button_Click(object sender, System.EventArgs e) { }

Bill Campbell, UMB Attributes For marking up your program [Serializable] class BankAccount {... } [Flags, Serializable]You can define your own public enum FileAttributes {They can have arguments ReadOnly = 0x0001, ReadOnly = 0x0001,...Your program can act...Your program can act Encrypted = 0x4000 upon them at run time Encrypted = 0x4000 upon them at run time}

Bill Campbell, UMB Common Language Runtime (CLR) Visual Basic Visual Basic C++ C++ JScript  CLR (JIT)  native code JScript  CLR (JIT)  native code C# C# (others) CLR a model (others) CLR a model

Bill Campbell, UMB Common Type System Your language can talk to all the others so long as it supports: boolshort ulong charint floatlong doublebyte

Bill Campbell, UMB CLR Entities Assemblies are logical collections of program parts (classes, interfaces, etc.) Assemblies are logical collections of program parts (classes, interfaces, etc.) Contain ALL the metadata required for an application (so it doesn't have to go in registries)Contain ALL the metadata required for an application (so it doesn't have to go in registries) One assembly can be physically captured by several (.exe or.dll) filesOne assembly can be physically captured by several (.exe or.dll) files Support versioningSupport versioning Can operate under one of several publishing policies (eg bug fixes vs. new versions)Can operate under one of several publishing policies (eg bug fixes vs. new versions) Namespaces are purely logical Namespaces are purely logical

Bill Campbell, UMB CLR Implementation CLR has a real assembly language CLR has a real assembly language assembly P -ildasm  -ilasm  P assembly P -ildasm  -ilasm  P CLR is a beautiful target for compilers CLR is a beautiful target for compilers Implemented using a "just in time" compiler Implemented using a "just in time" compiler Generational garbage collector Generational garbage collector

Bill Campbell, UMB How to learn about this stuff Internet Internet Good books (Microsoft Press) Good books (Microsoft Press) Download the MS Framework SDK Download the MS Framework SDK Borrow Visual Studio.net under the msdnaa program here at umb (You must be a student and adhere to the licensing agreement.) Borrow Visual Studio.net under the msdnaa program here at umb (You must be a student and adhere to the licensing agreement.) Take one of my summer courses: CS650 or CS697a (both limited in size) Take one of my summer courses: CS650 or CS697a (both limited in size)