net and c n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
.NET and C# PowerPoint Presentation
Download Presentation
.NET and C#

Loading in 2 Seconds...

play fullscreen
1 / 38

.NET and C# - PowerPoint PPT Presentation


  • 129 Views
  • Uploaded on

.NET and C#. Peter Groenewegen Vrije Universiteit pgroene@few.vu.nl. . NET and C#. .NET. Part 1. Partner Apps. Partner Services. MS Apps. MS Services. User Interface. User Experience. Compound Document. Universal Canvas. File System. XML Store. APIs. Building Blocks.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about '.NET and C#' - jerome


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
net and c

.NET and C#

Peter Groenewegen

Vrije Universiteit

pgroene@few.vu.nl

net and c1

.NET and C#

.NET

Part 1

the net evolution

Partner Apps

Partner Services

MS Apps

MS Services

User Interface

User Experience

Compound Document

Universal Canvas

File System

XML Store

APIs

Building Blocks

PC and other devices

PC

Windows Platform

.NET Platform

The .NET Evolution

As big a transition as from DOS to Windows

slide4

Many devices

WebServices

Simpler programming model

.NET
many devices
Many Devices

Intel

Win32

universal runtime

Winforms

intermediate language
Intermediate Language
  • All languages are compiled to an intermediate language
intermediate language1

libraries

libraries

libraries

runtime

runtime

runtime

Intermediate Language

Computer Language

Intel

PPC

6502

intermediate language2
Intermediate Language

Computer Language

libraries

Intermediate Language

runtime

Intel

PPC

6502

intermediate language3

runtime

runtime

runtime

libraries

libraries

libraries

Intermediate Language

C#

Perl

Pascal

libraries

MSIL

runtime

Intel

PPC

6502

slide11

Many devices

WebServices

Simpler programming model

.NET
web services
Web Services

DCOM

ASP

SOAP

ASP+, Webforms

Biztalk

web services1

<html>

…</html>

???????

Web Services

ASP

web services2
Web Services

Webservice

Webservice

Webservice

Webservice

web services3
Web Services

DCOM location transparency does not hold on the web

CORBA

DCOM

CORBA implementations are not compatible

CORBA

DCOM

CORBA

DCOM

CORBA and DCOM are not compatible

CORBA

CORBA

web services4
Web Services

Functionality for development and management of .NET services:

  • Application Center 2000: Extreme reliability and scalability
  • Internet Security & Acceleration Server: Firewall and proxy server
  • Commerce Server: analyzing site usage
  • BizTalk Server 2000: Business process orchestration & Business-to-business document interchange using XML
  • SQL Server 2000: Easy-to-use database systems with native Extensible Markup Language (XML) support
  • Host Integration Server 2000: Integration with host systems and their data
  • Mobile Information 2001 Server: Integration with mobile devices
slide17

Many devices

WebServices

Simpler programming model

.NET
simpler programming model
Simpler programming model

ComponentBased

Java

C#

Cobol

Object Oriented

Haskell

Python

Perl

C++

VB

simpler programming model1
Simpler programming model
  • Cross-language implementation inheritance
  • Cross-language exception handling
  • Cross-language debugging
  • ASP+ pages in any language
  • Client-side scripts in any language
  • Languages include
  • Perl, Python, COBOL, Pascal, Oberon, ...
  • Haskell, Mercury, Eiffel, …
  • C, C++,C#, …
versioning
Versioning

Office 2000SP1

Leisure suit Larry

The programmer was aware of a bug and thought he was smart to use the feature

X.dll

Version 2001

X.dll

Version 1949

Salary

Implementation relied on “secret” API removed in new version

what else
What else...
  • Free standards
  • XML
  • Performance
  • Backwards compatibility
  • Lots of code ready to use
  • ...
the net evolution1

Partner Apps

Partner Services

MS Apps

MS Services

User Interface

User Experience

Compound Document

Universal Canvas

File System

XML Store

APIs

Building Blocks

PC and other devices

PC

Windows Platform

.NET Platform

The .NET evolution

DOS  Windows =

Windows  .NET

net and c2

.NET and C#

C#

Part 2

slide24
C#

Not MS alternative for Java

Language for programming.NET framework

Which is MS alternative forJVM 

hello world
Hello World

using System;

class Hello

{

static void Main() {

Console.WriteLine("Hello world");

}

}

DEMO

csc HelloWorld.cs

ildasm HelloWorld.exe

c program structure
C# Program Structure
  • Namespaces
    • Types, namespaces
  • Type declarations
    • Classes, interfaces, structs, enums, delegates
  • Members
    • Fields,methods, constants, properties, events, indexers, operators, constructors, destructors

package

inner classes

Java Beans

void finalize ()

boxing unboxing
Boxing/Unboxing
  • Boxing
    • Allocates box, copies value into it
  • Unboxing
    • Checks type of box, copies value out

int i = 123;

object o = i;

int j = (int)o;

123

i

System.Int32

o

123

123

j

value types
Value Types
  • Struct type
    • struct Point { int x, y; }
  • Simple type
    • int i;
  • Enums type
    • enum State { Off, On }

Everything is really an object

refrence types
Refrence types
  • Interface type
  • Delegate type
  • Class type
  • Array type
unsafe code
Unsafe code
  • Unsafe code
    • Low-level code without leaving the box
    • Enables unsafe casts, pointer arithmetic
  • Declarative pinning
    • fixed statement
  • Basically “inline C”
unsafe code1
Unsafe code

class FileStream: Stream

{

int handle;

public unsafe int Read(byte[] buffer, int index, int count) {

int n = 0;

fixed (byte* p = buffer) {

ReadFile(handle, p + index, count, &n, null);

}

return n;

}

[dllimport("kernel32", SetLastError=true)]

static extern unsafe bool ReadFile(int hFile,

void* lpBuffer, int nBytesToRead,

int* nBytesRead, Overlapped* lpOverlapped);

}

properties
Properties
  • Properties are “smart fields”
    • Natural syntax, accessors, inlining

class Borrel { private int start; public int Start {get { return start; }set {

if (value < 1700 || value > 2400)

Console.WriteLine(“Invalided time”);

else

start = value; } }}

class Demo { public static Main () {

Borrel b = new Borrel();

b.Start = 1745;

int start = b.Start;

}}

indexers
Indexers
  • Indexers are “smart arrays”
    • Can be overloaded

class Borrel { private Dictionary participants; public Borrel() { participants = new Dictionary(); } public bool this[String name] { get { return (participants.Contains(name) && (bool)participants[name]); } set { participants.Add(name,value); } }}

class Demo { public static void Main () { Borrel b = new Borrel (); b[“Peter”] = true; Console.WriteLine(b[“Bill”]); }}

dogs demo
Dogs Demo

Thanks Roger and Eric Sessions!

using System;namespace VirtualDog { public class Dog { public virtual void RollOver () { Console.WriteLine("Scratch my tummy."); Bark(); } public virtual void Bark () { Console.WriteLine("WOOF WOOF (Dog)"); } }}

import VirtualDog;var d = new Dog();var m = new Mopje();d.RollOver();m.RollOver();

Imports SystemNamespace VirtualDog Public Class Mopje : Inherits Dog Public overrides Sub Bark () Console.WriteLine("WOEF WOEF (Mopje)") End Sub End ClassEnd Namespace

what more
What more?
  • Versioning
  • XML comments (Demo?)
  • Conditional compilation
  • ...
references and more info
References and more info
  • C# session by Tony Goodhew, TechEd 2000
  • .NET session Eric Meijer
  • C# session Eric Meijer
  • http://www.cs.vu.nl/~pgroene/Vakken/Oop/oop.html