Tải bản đầy đủ (.pdf) (519 trang)

Addison wesley understanding dot NET 2nd edition may 2006 ISBN 0321194047

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (3.58 MB, 519 trang )

Understanding.NET,SecondEdition
ByDavidChappell
...............................................
Publisher:AddisonWesleyProfessional
PubDate:May15,2006
PrintISBN-10:0-321-19404-7
PrintISBN-13:978-0-321-19404-6
Pages:336

TableofContents|Index

Microsoft's.NETisrevolutionizingWindows-basedsoftwaredevelopment.Sinceitsinitial
releasein2002,.NEThaschangedsignificantly,becomingthefoundationforanew
generationofWindowsapplications.The.NETFrameworkandVisualStudio,thetwocore
aspectsofthisinitiative,provideamultilanguageenvironmentinwhichdeveloperscan
createWebservices,graphicaluserinterfaces,andotherkindsofapplications.Takenasa
whole,the.NETtechnologieshavechangedthewaynearlyeveryWindowsapplicationis
built.
Nowfullyupdatedforversion2.0ofthe.NETFrameworkandVisualBasic2005,
Understanding.NET,SecondEdition,isaconciseguidetothelandscapeofWindows
development.Marginnotes,detaileddiagrams,andlucidwritingmakethisbookeasyto
readandnavigate,whileanalysissectionsexplorecontroversialissuesandaddress
commonconcerns.DavidChappell'sindependentperspectiveandstraightforward
descriptionsclarifybothhowthe.NETtechnologiesworkandhowtheycanbeused.
Coverageincludes
Anoverviewof.NETanditsgoals
TheCommonLanguageRuntime(CLR)
The.NETlanguages,includingC#,VisualBasic,andC++
The.NETFrameworkclasslibrary
BuildingWebApplicationswithASP.NET
AccessingDatawithADO.NET


.NETframeworkintegrationwithSQLServer2005
Thekeytousinganewtechnologyistounderstandthefundamentals.Thisbookprovides
therobustfoundationdevelopersandtechnicalmanagersneedtomaketherightdecisions


andmaximizethepotentialofthisrevolutionaryframework.


Understanding.NET,SecondEdition
ByDavidChappell
...............................................
Publisher:AddisonWesleyProfessional
PubDate:May15,2006
PrintISBN-10:0-321-19404-7
PrintISBN-13:978-0-321-19404-6
Pages:336

TableofContents|Index












































Copyright
PraiseforDavidChappell'sUnderstanding.NET,SecondEdition
IndependentTechnologyGuides
Preface
Chapter1.Introducing.NET
The.NETFramework
VisualStudio2005
Conclusion
Chapter2.TheCommonLanguageRuntime
BuildingManagedCode:TheCommonTypeSystem
CompilingManagedCode
OrganizingManagedCode:Assemblies
ExecutingManagedCode
Conclusion
Chapter3..NETLanguages
C#
C++
Conclusion
Chapter4.Surveyingthe.NETFrameworkClassLibrary
AnOverviewoftheLibrary
FundamentalNamespaces
Conclusion
Chapter5.BuildingWebApplications:ASP.NET
ASP.NETApplications:Basics































ASP.NETApplications:BeyondtheBasics
Conclusion
Chapter6.AccessingData:ADO.NET
Using.NETFrameworkDataProviders
UsingConnectionandCommandObjects
AccessingDatawithDataReaders

AccessingDatawithDataSets
Conclusion
Chapter7.BuildingDistributedApplications
ASP.NETWebServices:System.Web.Services
.NETRemoting:System.Runtime.Remoting
EnterpriseServices:System.EnterpriseServices
FinalThoughts
AbouttheAuthor
Index


Copyright
Manyofthedesignationsusedbymanufacturersandsellersto
distinguishtheirproductsareclaimedastrademarks.Where
thosedesignationsappearinthisbook,andthepublisherwas
awareofatrademarkclaim,thedesignationshavebeenprinted
withinitialcapitallettersorinallcapitals.
Theauthorandpublisherhavetakencareinthepreparationof
thisbook,butmakenoexpressedorimpliedwarrantyofany
kindandassumenoresponsibilityforerrorsoromissions.No
liabilityisassumedforincidentalorconsequentialdamagesin
connectionwithorarisingoutoftheuseoftheinformationor
programscontainedherein.
Thepublisheroffersexcellentdiscountsonthisbookwhen
orderedinquantityforbulkpurchasesorspecialsales,which
mayincludeelectronicversionsand/orcustomcoversand
contentparticulartoyourbusiness,traininggoals,marketing
focus,andbrandinginterests.Formoreinformation,please
contact:
U.S.CorporateandGovernmentSales

(800)382-3419

ForsalesoutsidetheUnitedStatespleasecontact:
InternationalSales

LibraryofCongressCataloging-in-PublicationData
Chappell,David(DavidWayne)
Understanding.NET/DavidChappell.2nded.
p.cm.


Includesbibliographicalreferencesandindex.
ISBN0-321-19404-7(pbk.:alk.paper)
1.Microsoft.NETFramework.2.Internetprogramming.3.Computersoftw

QA76.76.M52C482006
005.2'768dc22
Copyright©2006DavidChappell
Allrightsreserved.PrintedintheUnitedStatesofAmerica.This
publicationisprotectedbycopyright,andpermissionmustbe
obtainedfromthepublisherpriortoanyprohibited
reproduction,storageinaretrievalsystem,ortransmissionin
anyformorbyanymeans,electronic,mechanical,
photocopying,recording,orlikewise.Forinformationregarding
permissions,writeto:
PearsonEducation,Inc.
RightsandContractsDepartment
75ArlingtonStreet,Suite300
Boston,MA02116
Fax:(617)848-7047

TextprintedintheUnitedStatesonrecycledpaperatRR
DonnelleyinCrawfordsville,Indiana.
Firstprinting,May2006

Dedication
ToAvaandLauren,jewelsinthenight.




PraiseforDavidChappell's
Understanding.NET,SecondEdition
"DavidChappell'sUnderstanding.NET,SecondEdition,
containsexcellentcoverageoftheCLR,classlibrary,
ASP.NET,ADO.NET,anddistributedapplications.Itisstill
thebesttechnicaloverviewof.NETtodate,andI
recommendittoanyonemakingthetransitionto.NET."
DaveCorun
DirectorofMicrosoftTechnologies
CatalystITServices
"David'scoverageofallthings.NETisextensiveand
thorough.EvenregularusersofVisualStudiowilllearn
somethingabout.NETthattheydidn'tknow."
HarryPierson
ArchitectureStrategyTeam
MicrosoftCorporation
"Understanding.NET,SecondEdition,willgivemanagers
theknowledgeandvocabularytheyneedtocommunicate
withtheirdevelopers.Developerslookingtoobtainahighlevelviewofthe.NETFrameworkbeforegoingintoeach
topicindepthwillalsobenefitfromthisbook.Thisbook

helpsdevelopersgetabird's-eyeviewof.NETFramework
beforetheyengageinthelonglearningcurverequired.
Thisbookisverywellorganizedandtechnicallyaccurate."
CesarBermudez
MCAD,MCSD,MCDBA,MCSA,MCSE,MCTS,MCT,A+,iNet+,CIW
President
DotNetArchitects,Inc.


"DavidChappellhasanastuteunderstandingofMicrosoft
technologyandanabilitytoexplaincomplexsystemsina
waythatisbothenticingandthoroughlyeducational.The
secondeditionofhisbook,Understanding.NET,shows
thatheremainsoneofthebesttechnologyauthorsinthe
business."
RichardMonson-Haefel
AuthorandSeniorIndustryAnalyst
BurtonGroup


IndependentTechnologyGuides
DavidChappell,SeriesEditor
TheIndependentTechnologyGuidesofferserioustechnical
descriptionsofimportantnewsoftwaretechnologiesofinterest
toenterprisedevelopersandtechnicalmanagers.Thesebooks
focusonhowthattechnologyworksandwhatitcanbeused
for,takinganindependentperspectiveratherthanreflectingthe
positionofanyparticularvendor.Theseareidealfirstbooksfor
developerswithawiderangeofbackgrounds,theperfectplace
tobeginmasteringanewareaandlayingasolidfoundationfor

furtherstudy.Theyalsogointoenoughdepthtoenable
technicalmanagerstomakegooddecisionswithoutdelvingtoo
deeplyintoimplementationdetails.
Thebooksinthisseriescoverabroadrangeoftopics,from
networkingprotocolstodevelopmentplatforms,andarewritten
byexpertsinthefield.Theyhaveafreshdesigncreatedto
makelearninganewtechnologyeasier.Alltitlesintheseries
areguidedbytheprinciplethat,inordertouseatechnology
well,youmustfirstunderstandhowandwhythattechnology
works.


TitlesintheSeries
BrianArkills,LDAPDirectoriesExplained:AnIntroductionand
Analysis,0-201-78792-X
DavidChappell,Understanding.NET:ATutorialandAnalysis,0201-74162-8
EricNewcomer,UnderstandingWebServices:XML,WSDL,
SOAP,andUDDI,0-201-75081-3


Preface
Writingtheprefaceforabook'ssecondeditionisfunitmeans
thatpeoplethoughtthefirsteditionwasusefulenoughto
warrantanupdate..NEThaschangedinsignificantwayssince
thisbookfirstappearedin2002,changesthatarereflectedin
thisnewedition.Sinceitsoriginalrelease,the.NETFramework
hasbecomethefoundationforanewgenerationofWindows
applications.Developersandthepeoplewhopaytheirsalaries
steppeduptothechallengeofadoptingthisnewenvironment,
andtheresulthasbeenbettersoftware.

Still,newpeoplecometo.NETeveryday.Likethefirstedition,
thegoalofthisbookistohelpdevelopersandtheirmanagers
understandthisbignewworld.

WhoThisBookIsFor
.NETishuge.Thereareplentyofbooksthatprovidedetailed
examinationsofeachfacetofthisenormoustechnologycrystal,
plentyofbookswithhardcore,hands-oninformation.Thisisn't
oneofthosebooks.Ibelievestronglythatunderstanding.NET
asawholeisessentialbeforedelvingmoredeeplyintoany
singlepartofthetechnology.Accordingly,mygoalhereisto
provideabroadoverviewofthe.NETtechnologies.
Ifyou'relookingforabig-pictureintroductiontothewholeof
.NET,thisbookisforyou.Whetheryou'readeveloperjust
gettingstartedwith.NET,atechnicalmanagerwhoneedsto
makedecisionsaboutthesetechnologies,orastudentseeing
someoftheseideasforthefirsttime,thisbookshouldbea
usefulguide.Thereisenoughdetailheretosatisfymanypeople
completely,whileotherswillusethisbookasastepping-stone
tomorespecificknowledge.Inanycase,Ihopethebook's
organizationandcontentmakeiteasierforyoutocometogrips


withthismassoftechnology.

FactandOpinion
Graspinganewtechnologyrequireslearningthefundamentals.
Whatareitsmainparts?Howdotheywork?Howdotheyfit
together?Butreallyunderstandingatechnologyrequiresmore
thanthis.Youneedtoknownotjusthowthingsworkbutalso

whythey'reimportant,howtheycomparetowhat'sgone
before,andwhatmighthappennext.
Thisbookaimsatprovidingallofthesethings.Inthetextitself,
I'vetriedhardtoremainstrictlytutorial,focusingsolelyon
describingwhat.NETis.Intheperspectiveboxes,Igivesome
broaderviewsonvariousaspectsofthetechnology.Inevery
case,theperspectiveexpressesmyviewofwhythingsarethe
waytheyareorwhatthefutureislikelytohold.Byseparating
theobjectivefromthesubjective,Ihopetomakeiteasierfor
youtodistinguishbetweenthetwo.Byprovidingopinionaswell
asfact,Ihopetomakethisbookbothmoreinterestingand
moreenlightening.

Acknowledgments
I'monceagainhumbledbythewillingnessofpeopletohelp
withprojectslikethis.Forthissecondedition,thanksgo
especiallytomyreviewers:HarryPiersonatMicrosoft,Richard
Monson-HaefeloftheBurtonGroup,andDaveCorunatCatalyst
ITServices.Theyallreadeverychapterandmademanyuseful
suggestions.ThanksalsotoRalphSquillaceandTedPattison,
whoansweredkeyquestionsatimportantmoments.Everybody
whohelpedwiththefirsteditiononceagainhasmyheartfelt
thanks:BobBeauchemin,KeithBrown,CoriDay,Ted
Demopoulos,BillEstrem,JeannineGailey,KitGeorge,Greg
Hack,RobHoward,MaximLoukianov,JuvalLöwy,Peter
McKiernan,YahyaH.Mirza,JohnD.Mitchell,Christophe


Nassare,EricNewcomer,DavidSceppa,AaronSkonnard,and
MikeWoodring.

AtAddison-WesleyI'mgratefultoElizabethPeterson,Stephane
Nakib,JanaJones,andKarenGettmanforallthey'vedonefor
meandfortheIndependentTechnologyGuidesseries.I'malso
thankfulfortheeffortsofKristinWeinberger,firstmyeditor,
nowmyfriendand(remarkably)neighbor,whooriginally
broughtmetoAddison-Wesley,andforthehardworkofNancy
Hendryx,thecopyeditorforthisedition.
Thelistofacknowledgementsinthisbook'sfirsteditionended
withDianaCatignani,pointingouthowmuchpoorermylife
wouldbewithouther.She'snowDianaChappell,motherofour
twobeautifuldaughters.Wordscannotexpressthepovertythat
wouldensuewereshenotmywife.
DavidChappell
SanFrancisco
March2006





1.Introducing.NET
What'srequiredtocreategoodsoftware?Whileit'spossibleto
writefirst-ratecodeinalmostanyenvironment,creatinggood
softwareismucheasierwhentherightplatformandtoolsare
available.FormostWindowsdeveloperstoday,thatplatformis
definedby.NET.Whiledefining.NETclearlywasoncea
challenge,it'snowclearthatthe.NETlabelrefersprimarilyto
twothings.Theyare:
The.NETFramework,whichconsistsoftheCommon
LanguageRuntime(CLR)andthe.NETFrameworkclass

library.TheCLRprovidesastandardfoundationforbuilding
applications,whilethe.NETFrameworkclasslibraryoffersa
largesetofstandardclassesandothertypesthatcanbe
usedbyany.NETFrameworkapplicationwritteninany
language.
VisualStudio,anintegrateddevelopmentenvironment
(IDE)forcreatingWindowsapplications.Whilethistoolcan
beusedtobuildsoftwarethatrunsdirectlyonWindows,its
mainfocusishelpingdeveloperscreate.NETFramework
applications.VisualStudiosupportsseveralprogramming
languagesforcreatingtheseapplications,includingC#[1],
VisualBasic(VB),andC++.
[1]Pronounced"Csharp,"asinthemusicalnote.

The.NETFrameworkandVisualStudioarethemaincomponentsof.NET


Perspective:.NET'sNamingJourney
Itmakessensetodaytothinkofthename".NET"asprimarilyreferringtothe
.NETFrameworkandVisualStudio.Thingsweren'talwayssosimple,however.
When.NETwasfirstannouncedinthesummerof2000,Microsoftappliedthe
termtoabroadrangeofthings.Today's.NETtechnologieswereincluded,of
course,butsowereseveralotherthings.ManyofMicrosoft'sserverproducts,
includingSQLServerandBizTalkServer,weregroupedtogetherasthe.NET
EnterpriseServers,forexample,andawhollyseparateefforteventuallyknown
as.NETMyServiceswaslaunched.Therewaseventalkaboutapossible
Windows.NETandOffice.NETsometimeinthefuture.
Butwasthereacommontechnicalunderpinningforallofthesethings?Sadly,
theanswerwasno.WhenMicrosoftfirstsprang.NETontheworld,ittreatedthe
termasabroadbrand,onethatcouldbeappliedtoprettymuchanythingthe

companywasdoing.TheresultwasagooddealofconfusionamongMicrosoft's
customers.
Thankfully,thestoryhasgottenmuchsimpler.The.NETEnterpriseServersare
nowconsideredpartoftheWindowsServerSystem,andsothey'velostthe.NET
tag..NETMyServicesfadedfromthescene,whilethebrandingboffinsin
Redmonddecidedagainsttackingthe.NETbrandontoeitherWindowsorOffice.
Today,whensomebodysays".NET,"they'rereferringtothe.NETFrameworkand
VisualStudio.

Variousversionsexistforbothofthesetechnologies.The
versionsdescribedinthisbookarethosereleasedbyMicrosoft
inlate2005:version2.0ofthe.NETFrameworkandVisual
Studio2005.




The.NETFramework
Theheartof.NETisthe.NETFramework.Firstreleasedin
2002,itbroughtenormouschangetothelivesofthosewho
writeWindowssoftwareandthepeoplewhomanagethem.
Figure1-1showstheFramework'stwomainparts:theCLRand
the.NETFrameworkclasslibrary.A.NETapplicationalways
usestheCLR,anditcanalsousewhateverpartsoftheclass
libraryitrequires.

Figure1-1.The.NETFrameworkconsistsofthe
CommonLanguageRuntime(CLR)andthe.NET
Frameworkclasslibrary.


The.NETFrameworkisafoundationforcreatingWindowsapplications


EveryapplicationwrittenusingtheFrameworkdependsonthe
CLR.Amongotherthings,theCLRprovidesacommonsetof
datatypes,actingasafoundationforC#,VB,andallother
languagesthattargetthe.NETFramework.Becausethis
foundationisthesamenomatterwhichlanguagetheychoose,
developersseeamoreconsistentenvironment.

TheCLRprovidesacommonbasisforall.NETlanguages


Perspective:The.NETFrameworkvs.theJavaEnvironment

Mainstreamsoftwaredevelopmenttodayhassplitlargelyintotwocamps.
Microsoft,promotingthe.NETFramework,isinone,whilemostothervendors
backingtheJavaenvironmentareintheother.Eachtechnologyhasitsfansand
detractors,andeachhasasubstantialinstalledbasetoday.
Thesecompetingworldsarestrikinglysimilar.Toseehowsimilar,comparethe
figureabovewithFigure1-1.Bothenvironmentssupportthesamekindsof
applications,andbothprovidealargestandardlibrarytohelpbuildthose
applications.TheJavalibrary,mostlyknowntodayasJava2EnterpriseEdition
(J2EEorjustJEE)includesJavaServerPages(JSP)forWebscripting,Swingfor
buildingGUIs,JAX-WS(formerlyJAX-RPC)forWebservicesbased
communication,EnterpriseJavaBeans(EJB)forbuildingscalableserver
applications,JDBCfordatabaseaccess,andotherclasses.Thesetechnologies
areanalogoustothe.NETFramework'sASP.NET,WindowsForms,ASP.NETWeb
Services,EnterpriseServices,andADO.NET,respectively.TheJavavirtual
machineisalsomuchlikethe.NETFramework'sCLR,andeventhesemanticsof

thedominantlanguagesMicrosoft'sC#andVBvs.Javaarequitesimilar.
Therearealsodifferences,ofcourse.Oneobviousdistinctionbetweenthetwois
thattheJavaenvironmentrunsondiverseoperatingsystems,whilethe.NET
FrameworkfocusesonWindows.Thetrade-offhereisclear:Portabilityisgood,
butitpreventstightintegrationwithanyonesystem,andintegrationisalso
good.Youcan'thaveeverything,atleastnotallatthesametime.Also,Javabasedproductsareavailablefrommultiplevendors,whileonlyMicrosoft
providesthe.NETFramework.DifferentJavavendorscanprovidedifferent
extensionstothecorespecifications,sodeveloperscangetsomewhatlocked
intoasinglevendor.Still,portabilityacrossdifferentJavaplatformsispossible,
whilethe.NETFrameworkunambiguouslytiesyourapplicationtoMicrosoft.
Thisbifurcationandthecompetitionitengendersareultimatelyagoodthing.


Bothcampshavehadgoodideas,andeachhasborrowedfromtheother.Having
onecompletelydominanttechnology,whetherthe.NETFrameworkorJava,
wouldproduceastultifyingmonopoly,whilehavingadozenviablechoiceswould
leadtoanarchy.Twostrongcompetitors,eachworkingtooutdotheother,isjust
right.

Applicationswritteninany.NETlanguagecanusethecodein
the.NETFrameworkclasslibrary.Amongthemostimportant
technologiesprovidedinthislibraryarethefollowing:
ASP.NET:Classesfocusedonbuildingbrowser-accessible
applications.
WindowsForms:ClassesforbuildingWindowsgraphical
userinterfaces(GUIs)inanyCLR-basedprogramming
language.
ASP.NETWebServices(alsocalledASMX):Classesfor
creatingapplicationsthatcommunicatewithother
applicationsusingWebservices.

EnterpriseServices:Classesthatprovidedistributed
transactions,objectinstancecontrol,andotherservices
usefulforbuildingreliable,scalableapplications.
ADO.NET:Classesfocusedonaccessingdatastoredin
relationaldatabasemanagementsystems(DBMS).

The.NETFrameworkclasslibraryprovidesstandardcodeforcommonfunctions


The.NETFrameworkclasslibrarycontainsmuchmorethanthis
shortlistindicates.Amongtheotherservicesitprovidesare
supportforcreatingandworkingwithXMLdocuments,avariety
ofsecurityservices,andmechanismsforinteroperatingwith
applicationsbuiltusingolderWindowstechnologiessuchasthe
ComponentObjectModel(COM).

The.NETFrameworksupportsvariouskindsofapplications

Asthisshortdescriptionsuggests,the.NETFrameworkclass
librarycanbeusedtocreatemanydifferenttypesof
applications.Andbecausealloftheservicesinthislibraryare
builtontheCLR,applicationscancombinethemasneeded.A
browserapplicationbuiltusingASP.NET,forexample,mightuse
ADO.NETtoaccessstoreddataandEnterpriseServicesto
performdistributedtransactions.

A.NETFrameworkapplicationconsistsofmanagedcode

Softwarethatusesthe.NETFramework(andthusreliesonthe
CLR)isreferredtoasmanagedcode.AsFigure1-2shows,an

applicationcanbebuiltsolelyfrommanagedcode,relying
entirelyontheCLRandtherelevantpartsofthe.NET
Frameworkclasslibrary.Anapplicationcanalsobebuiltfroma
combinationofmanagedcodeandordinaryunmanagedcode,
withthetwointeractingasnecessary.Thissecondoption,
shownontherightsideofthefigure,isespeciallyimportantfor
existingapplications.MostnewWindowsapplicationscreated
todayarebuiltwhollyinmanagedcode,butitcanalsobe


usefultoextendpre-.NETapplicationswithmanagedcode.And
althoughit'snotshowninthefigure,it'sstillpossibletocreate
newWindowsapplicationsentirelyinunmanagedcodeusingthe
.NETFrameworkisn'tobligatory.

Figure1-2.Anapplicationcanbebuiltentirely
frommanagedcodeorfromacombinationof
managedandunmanagedcode.

Managedcodeistypicallyobject-oriented,sotheobjectsit
createsandusesareknownasmanagedobjects.Amanaged
objectcanuseandinheritfromanothermanagedobjectevenif
thetwoarewrittenindifferentlanguages.Thisfactisakey
partofwhatmakesthe.NETFrameworkclasslibraryan
effectivefoundation:ObjectswritteninanyCLR-basedlanguage
caninheritandusetheclasslibrary'scode.Giventhe
fundamentalroleplayedbytheCLR,understandingthe.NET
Frameworkbeginswithunderstandingthisruntime
environment.


Managedcodeistypicallybuiltusingmanagedobjects


TheCommonLanguageRuntime
Builtfromscratchtosupportmodernapplications,theCLR
embodiesacurrentviewofwhataprogrammingenvironment
shouldbe.Whileit'shardtoclaimcompleteoriginalityforany
ideaincomputersciencetoday,itisfairtosaythatthis
essential.NETtechnologytakesaninterestingnewapproachto
programminglanguages.

WhattheCLRDefines
Thinkabouthowaprogramminglanguageistypicallydefined.
Eachlanguagecommonlyhasitsownuniquesyntax,itsownset
ofcontrolstructures,auniquesetofdatatypes,itsownnotions
ofhowclassesinheritfromoneanother,andmuchmore.The
choicesalanguagedesignermakesaredrivenbythetarget
applicationsforthelanguage,whoitsusersaremeanttobe,
andthedesigner'sownsensibilities.

There'swidespreadagreementonthefeaturesamodernprogramminglanguage
shouldoffer

Yetmostpeopleagreeonmuchofwhatamoderngeneralpurposeprogramminglanguageshouldprovide.Whileopinions
onsyntaxdiffersomedeveloperslovecurlybraces,othersabhor
themthere'swidespreadagreementonwhatsemanticsa


languageshouldoffer.Giventhis,whynotdefineastandard
implementationofthosesemantics,thenallowdifferent

syntaxestobeusedtoexpressthosesemantics?


LookingBackward:WindowsDNAandCOM
Formostofthe1990s,applicationdevelopersintheMicrosoftenvironmentrelied
onasetoftechnologiesthatbecameknownasWindowsDNA.Those
technologiesincludedtheComponentObjectModel(COM)andDistributedCOM
(DCOM),alargergroupofCOM-basedtechnologiesknowncollectivelyasCOM+,
supportforcreatingbrowserapplicationsusingActiveServerPages(ASP),data
accesssupportwithActiveXDataObjects(ADO),andothers.Themost
commonlyusedlanguagesforbuildingWindowsDNAapplicationswereVBand
C++,bothsupportedbyearlierversionsofVisualStudio.
Tensofthousandsofapplicationsbasedonthesetechnologiesareinproduction
today,providingsolidevidenceofWindowsDNA'ssuccess.Yetthetechnologies
WindowsDNAincludesweredevelopedindependentlyoveraperiodofseveral
years.Becauseofthis,theintegrationamongthemwasn'tascompleteasit
mighthavebeen.Forexample,whiletheWindowsDNAenvironmentlet
developersusevariousprogramminglanguages,eachlanguagehasitsown
runtimelibraries,itsowndatatypes,itsownapproachtobuildingGUIs,and
otherdifferences.Applicationswrittenindifferentlanguagesalsoaccessed
systemservicesindifferentways.C++applicationscouldmakedirectcallsto
theoperatingsystemthroughtheWin32interface,forinstance,whileVB
applicationstypicallyaccessedtheseservicesindirectly.Thesedifferencesmade
lifechallengingfordevelopersworkinginmorethanonelanguage.COM,by
definingcommonconventionsforinterfaces,datatypes,andotheraspectsof
interactionamongdifferentsoftware,waseffectivelytheducttapethatheldthis
complexenvironmenttogether.
Byprovidingacommonfoundationthatcanbeusedfromalllanguages,the
.NETFrameworksignificantlysimplifiedlifeforWindowsdevelopers.Applications
builtonthe.NETFrameworkdon'tfacemanyoftheproblemsthatCOM

addresses.NETFrameworkapplicationsallusetheCLR,forexample,which
definesacommonapproachtointerfacesandotherdatatypesandsotheglue
betweendifferentlanguagesthatCOMprovidesisnolongernecessary.Thisis
whyCOMtechnologyisn'tusedinbuildingpure.NETFrameworkapplications.
Instead,developerscanbuildsoftwarethatinteractsinamorenaturaland
substantiallysimplerway.
Forthemostpart,thearrivalofthe.NETFrameworkwasthedeathknellfor
WindowsDNAandCOM.It'stakenquiteawhilefororganizationstomigrateto
thenewworldof.NET,andmanyapplicationsbuiltwiththeseolderWindows
technologiesarestillinproduction.Still,withfewexceptions,seriousnew
Windowsdevelopmenttodayuses.NET,notWindowsDNA.


×