software development case study: c# and beyond the pl gao zhang ph.d. university relations manager...

38
Software Development Case Stu Software Development Case Stu dy: dy: C# and Beyond the PL C# and Beyond the PL Gao Zhang Ph.D. Gao Zhang Ph.D. University Relations Manager University Relations Manager Microsoft Research Asia Microsoft Research Asia

Upload: violet-ryan

Post on 11-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Software Development Case Study: Software Development Case Study: C# and Beyond the PLC# and Beyond the PL

Gao Zhang Ph.D.Gao Zhang Ph.D.

University Relations ManagerUniversity Relations Manager

Microsoft Research AsiaMicrosoft Research Asia

Page 2: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

OutlineOutline

A Programmer’s PracticesA Programmer’s Practices A Powerful LanguageA Powerful Language Beyond a Program LanguageBeyond a Program Language

C#: Build the 3-tier Distributed ApplicationC#: Build the 3-tier Distributed Application Rich User ExperienceRich User Experience Powerful ComponentPowerful Component Easier Data AccessEasier Data Access

Beyond the Programming LanguageBeyond the Programming Language Big PictureBig Picture Tester is CriticalTester is Critical Good DocumentGood Document

Page 3: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Who is he?Who is he?

Dr. Dobbs’ Journal Dr. Dobbs’ Journal Excellence in Programming Excellence in Programming Award on April 11, 2002 Award on April 11, 2002

#1 Programmer in the #1 Programmer in the worldworld

Began to program when he is a hBegan to program when he is a high school student in Denmark igh school student in Denmark

Anders Hejlsberg Anders Hejlsberg

Page 4: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

A Real StarA Real Star

Create Borland together with Philippe KahnCreate Borland together with Philippe Kahn Develop Turbo Pascal, with a great feature of Develop Turbo Pascal, with a great feature of

in-memory Compiler and Borland Pascalin-memory Compiler and Borland Pascal Write Pascal Compiler in compiling language, Write Pascal Compiler in compiling language,

Create Delphi Create Delphi 1996 to Microsoft1996 to Microsoft Architect of Visual J++ and the Windows Architect of Visual J++ and the Windows

Foundation Classes Foundation Classes Distinguished Engineer Distinguished Engineer Chief designer of C# and a collaborator on Chief designer of C# and a collaborator on

the .NET Framework the .NET Framework

Page 5: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Part 1: Part 1:

3-tier Distributed 3-tier Distributed Application ArchitectureApplication Architecture

Page 6: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

20002000

C#C# : : Web ServiceWeb Service

Interactive WebInteractive Web

WindowsWindows

19901990GUIGUI

MS-DOSMS-DOS

19811981PCPC

19951995InternetInternet

C: C: StructureStructure

FunctionFunction

C++: C++: ClassClass

IE, IISIE, IISASP: ASP: Html, XML, ComHtml, XML, Com

Development of Software Development of Software ArchitectureArchitecture

.NET.NET

Page 7: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

C# Build User InterfaceC# Build User Interface

Page 8: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Win FormWin Form

Page 9: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Mobile WebMobile Web

Page 10: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

C#: Enhance the classC#: Enhance the class

First component oriented language in the First component oriented language in the C/C++ familyC/C++ family Properties, methodsProperties, methods Attribute, Interface, Delegation, EventAttribute, Interface, Delegation, Event

Page 11: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

TerrariumTerrarium:: Write a Write a ecosystem gameecosystem game

Page 12: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Structural ProgramStructural Program

Terrarium(){... AntMove() { ... }

TigerMove() { ... }...}

Page 13: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Use DUse Delegateselegates

Movedelegate ?

AntMove(){...}

TigerMove(){...}

Terrarium(){...AnimalMove();...}

Page 14: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

How Events WorkHow Events Work

MoveEvent

AntMove(){ Subscriber...}

TigerMove(){ Subscriber...}

Terrarium(){...Publish(Move);...}

Page 15: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

How XML Web Service worksHow XML Web Service works

<CheckUserAccountResponse> <CheckUserAccountResult>

boolean</CheckUserAccountResult>

</CheckUserAccountResponse>

<CheckUserAccount > <UserName> gzhang </UserName> <Password> test </Password></CheckUserAccount>

<?xml version="1.0" encoding="utf-8"?>

Page 16: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Case: Terrarium by MicrosoftCase: Terrarium by Microsoft

Page 17: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Terrarium Scenario Terrarium Scenario Microsoft Game

Zone Server

Internet Firewall

XMLXML

XMLXMLXML

XML

XML

Page 18: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Book back Book back Ticket in Ticket in ShanghaiShanghai

MyBank .NET visit ScenarioMyBank .NET visit Scenario

Billing Billing Web ServiceWeb Service

MyBank .NETMyBank .NET

InternetInternet

Book HotelBook HotelIn BeijingIn Beijing

ICBC BeijingICBC Beijing

HangzhouHangzhouShanghaiShanghai

MaryMary

HTMLHTML

HTML + HTML +

XMLXML

Page 19: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Enterprise Application: Online Book StoreEnterprise Application: Online Book Store

Page 20: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia
Page 21: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

.NET : J2EE.NET : J2EE

C# : JavaC# : Java

Page 22: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Pet Shop Contest: J2EE and .NETPet Shop Contest: J2EE and .NET

Page 23: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Developer ProductivityDeveloper Productivity: 1/3 code: 1/3 code

Total Lines Total Lines of Codeof Code

1500015000

75007500

1000010000

50005000

25002500

1750017500

1250012500Java Pet StoreJava Pet Store

Lines of Code RequiredLines of Code Required

3,484

.NET Pet Shop.NET Pet Shop

14,273

Data TierData Tier

684412

ConfigConfig

56

2,566

User User InterfaceInterface

1,881

5,891

Middle Middle TierTier

863

5,404

Page 24: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Performance:Performance: 28 times faster 28 times faster Scalability: Scalability: 6 times more users6 times more users

Page 25: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Beyond the Programming Beyond the Programming LanguageLanguage

Page 26: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

DeveloperDeveloper

In Hejlsberg’s view: great developers vs. good In Hejlsberg’s view: great developers vs. good developersdevelopers The ability to see the big pictureThe ability to see the big picture Have the course of the software mapped out in one’Have the course of the software mapped out in one’

s heads head Pursue it while being flexible enough to make adjusPursue it while being flexible enough to make adjus

tments when required for the sake of producing quatments when required for the sake of producing quality softwarelity software

Page 27: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

TesterTester

Developers are not the only ones who make a Developers are not the only ones who make a product a success.product a success.  "Testers are critical”"Testers are critical”

Page 28: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

A Diverse MyBank .NET Team StructureA Diverse MyBank .NET Team StructureIn Chongqing UniversityIn Chongqing University

Zhang Lei, CS, UndergraZhang Lei, CS, Undergraduate, PMduate, PM

Li Jia, Applied Chemistry,Li Jia, Applied Chemistry, Graduate, Dev. Graduate, Dev.

Li Ying, CS, UndergraduaLi Ying, CS, Undergraduate, Dev.te, Dev.

Liu Yi, CS, UndergraduaLiu Yi, CS, Undergraduate, Testte, Test

Yang Liang, CS, UndergYang Liang, CS, Undergraduate, Testraduate, Test

Pu Yao, Finance, DocumPu Yao, Finance, Documentent

Page 29: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

DocumentDocument

And so is good documentation," he said. "Our And so is good documentation," he said. "Our task is not done when we deliver the code." task is not done when we deliver the code."

Page 30: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Successful Peer Team model in Successful Peer Team model in MSCenter Development by Tianjin UniversityMSCenter Development by Tianjin University

PMPM

Ling XiaomiLing Xiaomingng

Dev.Dev.

Qi YaFengQi YaFeng

TestTest

Yao HaifengYao Haifeng

ContentContent

Ling RanLing Ran

Page 31: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Do You Have Your own Experience Do You Have Your own Experience Project?Project?

thanksthanks

Page 32: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

.NET .NET 的安全模式的安全模式

Role-Based SecurityRole-Based Security Evidence-Based SecurityEvidence-Based Security

Page 33: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Debug EngineDebug Engine

JIT CompilerJIT Compiler& Verification& Verification

ApplicationApplicationDirectoryDirectory

ApplicationApplicationDirectoryDirectory

SetupSetupCopyCopy

BrowserBrowser

Download Download CacheCache

Download Download CacheCache

GlobalGlobalAssemblyAssembly

Cache (GAC)Cache (GAC)

GlobalGlobalAssemblyAssembly

Cache (GAC)Cache (GAC)

AssemblyAssemblyon Target on Target MachineMachine

AssemblyAssemblyon Target on Target MachineMachine

Common Language RuntimeCommon Language Runtime

AssemblyAssemblyAssemblyAssembly

DEVELOPMENTDEVELOPMENT DEPLOYMENTDEPLOYMENT

InstallInstall

EXECUTIONEXECUTION

AssemblyAssemblyLoaderLoader

PolicyPolicyEvaluatorEvaluator

Class Class LoaderLoader

NativeNativecode code NativeNativecode code

Code Code ManagerManager

Garbage CollectionGarbage Collection

Exception ManagerException Manager

Thread SupportThread Support

PermissionPermissionEnforcementEnforcement

Policy<?xml version="1.0" encoding="utf-8" ?><configuration> <mscorlib> <security> <policy> <PolicyLevel version="1"> <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="Nothing" Name="All_Code" Description="Code group grants no permissions and forms the root of the code group tree."> <IMembershipCondition class="AllMembershipCondition" version="1"/> <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust"

Page 34: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Assembly-provided EvidenceAssembly-provided Evidence

PolicyPolicyEvaluatorEvaluator

Assembly A3Assembly A3

PermissionPermissionRequestsRequests

SecuritySecurityPolicyPolicy

EvidenceEvidence

G3G3G3G3

HostHost

Assembly A2Assembly A2 G2G2

G1G1Assembly A1Assembly A1

Assembly A3Assembly A3

Page 35: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Run-time SecurityRun-time Security

Behavior constrained by least trustworthy Behavior constrained by least trustworthy component.component.

Dynamic authorization assessmentDynamic authorization assessment

A1A1

A2A2

A3A3 R/W Files

no file access

XCan’t access files because A2 lacks authorization

G3

G2

R/W FilesG1

Page 36: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

Managed Extensions of C++Managed Extensions of C++

Upward compatible language extensions to Upward compatible language extensions to C++C++ New keywords follow ANSI conventions e.g., New keywords follow ANSI conventions e.g., __g__g

cc

Support staged migration to .NET FrameworSupport staged migration to .NET Frameworkk Recompile on common language runtimeRecompile on common language runtime Mix IL and Native in a single EXE or DLLMix IL and Native in a single EXE or DLL Make managed on class by class basisMake managed on class by class basis

Page 37: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

COMCOM

COM+COM+

MTSMTS

OriginsOrigins

COM+ provides complimentary services COM+ provides complimentary services to .NET objectsto .NET objects

COM+ provides services oriented toward COM+ provides services oriented toward middle-tier, large-scale distributed middle-tier, large-scale distributed applications applications

.NET.NET

COM+ COM+ ServicesServices

Page 38: Software Development Case Study: C# and Beyond the PL Gao Zhang Ph.D. University Relations Manager Microsoft Research Asia

COM+ application hosting serviced COM+ application hosting serviced components components