Upload
violet-ryan
View
213
Download
0
Embed Size (px)
Citation preview
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
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
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
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
Part 1: Part 1:
3-tier Distributed 3-tier Distributed Application ArchitectureApplication Architecture
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
C# Build User InterfaceC# Build User Interface
Win FormWin Form
Mobile WebMobile Web
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
TerrariumTerrarium:: Write a Write a ecosystem gameecosystem game
Structural ProgramStructural Program
Terrarium(){... AntMove() { ... }
TigerMove() { ... }...}
Use DUse Delegateselegates
Movedelegate ?
AntMove(){...}
TigerMove(){...}
Terrarium(){...AnimalMove();...}
How Events WorkHow Events Work
MoveEvent
AntMove(){ Subscriber...}
TigerMove(){ Subscriber...}
Terrarium(){...Publish(Move);...}
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"?>
Case: Terrarium by MicrosoftCase: Terrarium by Microsoft
Terrarium Scenario Terrarium Scenario Microsoft Game
Zone Server
Internet Firewall
XMLXML
XMLXMLXML
XML
XML
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
Enterprise Application: Online Book StoreEnterprise Application: Online Book Store
.NET : J2EE.NET : J2EE
C# : JavaC# : Java
Pet Shop Contest: J2EE and .NETPet Shop Contest: J2EE and .NET
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
Performance:Performance: 28 times faster 28 times faster Scalability: Scalability: 6 times more users6 times more users
Beyond the Programming Beyond the Programming LanguageLanguage
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
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”
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
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."
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
Do You Have Your own Experience Do You Have Your own Experience Project?Project?
thanksthanks
.NET .NET 的安全模式的安全模式
Role-Based SecurityRole-Based Security Evidence-Based SecurityEvidence-Based Security
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"
Assembly-provided EvidenceAssembly-provided Evidence
PolicyPolicyEvaluatorEvaluator
Assembly A3Assembly A3
PermissionPermissionRequestsRequests
SecuritySecurityPolicyPolicy
EvidenceEvidence
G3G3G3G3
HostHost
Assembly A2Assembly A2 G2G2
G1G1Assembly A1Assembly A1
Assembly A3Assembly A3
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
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
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
COM+ application hosting serviced COM+ application hosting serviced components components