Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

22
C# Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

description

C#. Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net. Agenda. Language Features Development Environment Performance Total Cost of Ownership (TCO). Hello World. using System; class Hello { static void Main() { Console.WriteLine("Hello world"); } }. VB. C++. C#. J#. - PowerPoint PPT Presentation

Transcript of Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

Page 1: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

C#

Paul StubbsMCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

Page 2: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

Agenda Language Features Development Environment Performance Total Cost of Ownership (TCO)

Page 3: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

Hello World

using System;using System;

class Helloclass Hello{{ static void Main() {static void Main() { Console.WriteLine("Hello world");Console.WriteLine("Hello world"); }}}}

Page 4: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

Operating SystemOperating System

Common Language RuntimeCommon Language Runtime

Base Class LibraryBase Class Library

ADO .NET and XMLADO .NET and XML

ASP .NETASP .NETWeb Forms Web ServicesWeb Forms Web Services

Mobile Internet ToolkitMobile Internet Toolkit

WindowsWindowsFormsForms

Common Language SpecificationCommon Language Specification

VBVB C++C++ C#C# J#J# ……V

isual Studio .N

ET

Visual S

tudio .NE

T

.Net Framework

Page 5: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

Design Goals Component Oriented

Properties, methods, events Design-time and run-time attributes Integrated documentation using XML No header files, IDL, etc.

Everything is an Object

Page 6: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

Design Goals Garbage Collection

No memory leaks Versioning

Built into the framework Exceptions

Baked into the language and framework Type Safe

No unsafe casts

Page 7: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

Design Goals Multi-Platform

Win32 , Win64 Rotor

FreeBSD Mono

GNU/Linux , Unix, Mac OS X, Solaris Multi-Language

Over 20 languages supported

Page 8: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

Interoperability No need to rewrite everything Interop with COM+, XML, SOAP, DLL

and other .Net assemblies Use .Net assemblies from COM C++

Pointers (in unsafe code) Unsigned integers Can only be run from FullyTrusted code

Page 9: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

C# only Delegates

Provide callbacks Eventing model Type safe function pointers Multicast Asynchronous

Page 10: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

C# only Enumerations

Group together user defined constants Type Safe

Structs (value types) Created on the stack Passed by value No need to garbage collect

Page 11: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

C# only Foreach

Iterate through arrays, collections and classes

Consistent and concise

String[] months = {“Jan”,”Feb”,”Mar”,”Apr”,”May”};

Foreach{string month in months}Console.WriteLine(“The month is “ + month);

Page 12: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

C# only Properties

Accessed as if it were a field Same as getter and setter pattern Maintains relationship between get and

setFoo.setSize(getSize() + 1);Label.getFont().setBold(true);

Foo.size++;Label.font.bold = true;

Java/C++

C#

Page 13: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

C# only Preprocessor Directives Runtime code generation Pass by reference Variable length parameter lists Explicit Interface Implementation

Page 14: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

Development Tools Visual Studio .Net

Rich Client development Web Client development Mobile Client (WAP) development Windows CE (PocketPC) development Office 11 (soon) development XML/XSL development Integrated Source Control

Page 15: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

Visual Studio .NET

Page 16: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

Performance / Pet Shop

Page 17: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

Maintainability / Pet Shop

Page 18: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

Affordability Windows on Intel delivers more bang

for the buck than the Mainframe or UNIX-based servers

Visual Studio .NET Less code End to End Debugging XCOPY deployment Integrate existing code Use existing developers skills

Page 19: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net
Page 20: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

Summary C# and Java are very similar Power of C++ simplicity of VB C# is a standard

ECMA-334 C#, ECMA-335 CLI, ISO Robust Development Environment High Performance Lower cost

Page 21: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

Links MaineBytes .Net User Group

http://www.MaineBytes.com Pet Shop benchmark test

http://www.middleware-company.com/j2eedotnetbench/

Comparison of C# and Java http://www.25hoursaday.com/

CsharpVsJava.html (80 page white paper)

Page 22: Paul Stubbs MCSD, MCSE 4.0, MCP+I, MCT, MCAD .Net

Links Mono

http://www.go-mono.com Rotor

http://www.corel.com/ssclii/