1 get started with c#

20

Click here to load reader

Upload: tuan-ngo

Post on 10-May-2015

487 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: 1   get started with c#

Introduction C#

[email protected]

Page 2: 1   get started with c#

Pitfalls of C/C++

Difficult for beginners to learn

Cannot test code until it is compiled

Difficult to debug without expensive debugging tools

Takes longer time to develop

Database connectivity is complicated

Problems in modification of data

Difficulty in implementation

Do not contain any framework

Page 3: 1   get started with c#

Need for a New Language

Simple, powerful tool for building interoperable, scalable, robust applications. Complete object-oriented architecture powerful component-oriented development Allow access to many features previously available only in C++ Familiarity to programmers coming from C or C++ Write application target both desktop and mobile.

Page 4: 1   get started with c#

Purpose of C#

.NET Framework is a massive expandable library.

C# is a high level language which let programmers focus on the main problem rather than dealing with things like portability, serialization …

C# provides a simple, efficient, productive, object-oriented language.

Page 5: 1   get started with c#

Why .NET?

Application architecture has changed.

INTERNET world Compete JAVA

Page 6: 1   get started with c#

Why .NET?

Bill toilet

Page 7: 1   get started with c#

.Net Framework

Language-neutral component library Code Modules Organized Specialized Execution environment CTS CLR Provide consistent object-oriented programming environment Minimize software deployment and versioning conflicts by providing a code-execution environment Promote safe execution of code by providing a code-execution environment Provides a consistent developer experience across varying types of application such as Window-based app and Web-based app.

Page 8: 1   get started with c#

.Net Framework Components

Common Language Runtime (CLR) Memory management Code execution Error handling Code safety verification Garbage collection .NET Framework Class Library (FCL) comprehensive object-oriented collection of reusable type.

Page 9: 1   get started with c#

Architecture of .NET Framework

Page 10: 1   get started with c#

Other components of .NET Framework

Page 11: 1   get started with c#

Other components of .NET Framework

Common Language Specification (CLS) set of rules that any .NET language should follow to create application that are interoperable with other languages Common Type System (CTS) describes how data types are declared

Page 12: 1   get started with c#

Microsoft Intermediate Language (MSIL)

The code written in a .NET compatible language is compiled, the output code is in the form of MSIL.

MSIL is composed of a specific set of instructions that indicate how the code should be executed

Page 13: 1   get started with c#

Common Language Runtime (CLR)

When a code is executed for the first time, the MSIL code is converted to a code native to the operating system. This is done at runtime by the Just-In-Time (JIT) compiler in CLR.

CLR is virtual machine component that is used to convert the MSIL code to the machine language code.

Page 14: 1   get started with c#

Basic features of C#

Object-oriented

Type-safety Checking

| Uninitialized variables cannot be used.

Garbage Collection

Standardization by ECMA (European Computer Manufacturers)

Generic Types and Methods

Page 15: 1   get started with c#

Applications of C#

Gaming applications

Large-scale enterprise applications

Mobile applications for pocket PCs, PDAs and cell phones

Simple standalone desktop applications such as Library Management

Complex distributed applications

Page 16: 1   get started with c#

Advantages of C#

Cross Language Support

Common Internet Protocols

XML, SOAP

Simple Deployment

A assembly is self-describing collection of code and resource

XML Documentation

Comments can be place in XML format and then used to document the code.

Page 17: 1   get started with c#

Memory Management

In C, C++, the allocation and de-allocation of memory is done manually. It is time-consuming and difficult.

The C# language provides the feature of allocating and releasing memory using automatic memory management.

No need to write code to allocate or to release memory.

Increase the code quality and enhances the performance and the productivity.

Page 18: 1   get started with c#

Garbage Collection

Automatic memory management is done with the help of a garbage collector

Garbage collection is the automatic reclaiming of memory from objects that are no longer in scope.

Two steps:

- Determine which obj

will not be access in the future.

- Reclaim the storage used by those.

Page 19: 1   get started with c#

Visual Studio 2010

Visual Studio 2010 Ultimate

Visual Studio 2010 Premium

Visual Studio 2010 Professional

Visual Studio 2010 Express Products

Visual Studio Team Foundation Server 2010

Page 20: 1   get started with c#

Visual Studio 2010 Comparison