C# class - Seattle Central College

Download Report

Transcript C# class - Seattle Central College

CSC 298
Introduction to C#
C# A 1
What to expect in this class
 Background: knowledge of an object oriented
language of the C++, Java, … family. No need
to know inheritance.
 Outcome: how to program in C# (syntax,
inheritance, libraries, using some .NET
features: ASP.NET, Web Services,
ADO.NET…)
 Class organization:
 Lectures, lab practice with sample code,
homework assignments, tests and quizzes
 class web site
www.seattlecentral.org/faculty/flepeint/csharpC# A 2
Why are we learning C#?
 A modern language
 object oriented, “portable”, secure
 A better C++?
 some features of C++ are overly complex
(e.g. multiple inheritance)
 C# doesn't include any of these
 C# features a garbage collector
 Open the doors of .NET, the Microsoft
initiative.
C# A 3
What is .NET? (1)
 Microsoft latest approach to programming
 CLR: common language runtime. The
virtual machine that executes the .NET
application. It understands only
Intermediate Language (IL).
 A .NET application can be written in any
language as long as it can be compiled
into IL (C#, VB.NET, J#, FORTRAN, …)
 .NET framework offers many libraries to
make computing across a network easy
(use of XML to convey information
between machines).
C# A 4
What is .NET? (2)
 Distributed computing: Companies can expose
their services through the web (Web services)
 practically, in a program one can seamlessly
use objects (methods + data) that reside on
a computer across a network.
 .NET offers powerful tools to use databases
 Microsoft sells many servers (e.g. Biztalk) to
help companies publish their services with
.NET. We will use IIS.
 Old fashioned applications (running only on
one computer) can still be developed with
.NET.
C# A 5
The Common Language Runtime
Mac ?
Unix (e.g.
FreeBSD)
Windows
Source
Code
(.cs file)
C#
Compiler
IL code
CLR
(.exe file) (JIT compiler
JIT: Just in Time)
C# A 6
Lexicon
 CLR: Common Language Runtime
 IL: Intermediate language
 FCL: Framework Class Library, the set of all


classes available to the .NET programmer.
CLS: Common Language Specification, the
features of the CLR that must be implemented
by a language to run on .NET (C# goes beyond
the CLS).
CTS: Common Type System, describes how
types are defined and how they behave (=rules
to define classes…)
C# A 7
Resources
 Text: Liberty’s C# - a good reference but not
required.
 VS.NET framework is available via MSDNAA (a
very good deal!)
 Enormous amount of resources
 within Visual studio documentation
 msdn.microsoft.com
C# A 8