|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如果英语好,口才好,加上女孩子的优势说不定有机会进去做做别的工具)想写点甚么工具,可是又有点懒,先放草稿,否则今后又健忘了:
1.Address相似于假造表的内存地点
2.binding对应着CLR范例
3.Contract代表接口。
C#中没有真正意义上的早绑定。
地点有关代码。
代办署理形式。
依照严厉意义上的夙兴绑定来讲,好比C言语在编译的时分,编译器就能够晓得某个办法所对应的物理地点。可是C#中,办法在编译时都是一个ILtoken,指向的都是CLR中的JIT函数。在运转第一遍的时分,JIT才天生nativecode,这时候才有真实的地点,并把地点前往给响应的援用。因而假如依照这个界说来讲,C#中没有真正意义上的早绑定。可是,我们这里接纳编译时编译器晓得响应的范例来举动当作夙兴绑定,假如用的是多态特征,如虚办法等,那末就是编译时晓得部分范例信息的静态绑定。
和夙兴绑定绝对应的,就是晚绑定。编译时编译器对范例的信息一窍不通。
Developerscouldmanuallyplaceobjectsinseparateprocesses,yetiftheobjectsweredistributedacrossmultipleprocesses
ormachinestherewasnowayofusingrawC++fortheinvocations,sinceC++
requireddirectmemoryreferencesanddidnotsupportdistribution.Developershad
towritehostprocessesandusesomeremotecalltechnology(suchasTCPsockets)to
remotethecalls,butsuchinvocationslookednothinglikenativeC++callsanddidnot
benefitfromobjectorientation.
Thesolutionfortheproblemsofobjectorientationevolvedovertime,involvingtechnologies
suchasthestaticlibrary(.lib)andthedynamiclibrary(.dll),culminatingin
1994withthefirstcomponent-orientedtechnology,calledCOM(ComponentObject
Model).Componentorientationprovidedinterchangeable,interoperablebinarycomponents.
Withthisapproach,insteadofsharingsourcefiles,theclientandtheserver
agreeonabinarytypesystem(suchasIDL)andawayofrepresentingthemetadata
insidetheopaquebinarycomponents.Thecomponentsarediscoveredandloadedat
runtime,enablingscenariossuchasdroppingacontrolonaformandhavingthat
controlbeautomaticallyloadedatruntimeontheclient’smachine.Theclientonly
programsagainstanabstractionoftheservice:acontractcalledtheinterface.Aslong
astheinterfaceisimmutable,theserviceisfreetoevolveatwill.Aproxycanimplement
thesameinterfaceandthusenableseamlessremotecallsbyencapsulatingthelow-level
mechanicsoftheremotecall.Theavailabilityofacommonbinarytypesystemenables
cross-languageinteroperability,soaVisualBasicclientcanconsumeaC++COM
component.Thebasicunitofreuseistheinterface,notthecomponent,andpolymorphic
implementationsareinterchangeable.Versioningiscontrolledbyassigninga
uniqueidentifierforeveryinterface,COMobject,andtypelibrary.
WhileCOMwasafundamentalbreakthroughinmodernsoftwareengineering,most
developersfounditunpalatable.COMwasunnecessarilyuglybecauseitwasbolted
ontopofanoperatingsystemthatwasunawareofit,andthelanguagesusedforwriting
COMcomponents(suchasC++andVisualBasic)wereatbestobject-orientedbutnot
component-oriented.Thisgreatlycomplicatedtheprogrammingmodel,requiring
frameworkssuchasATLtopartiallybridgethetwoworlds.Recognizingtheseissues,
Microsoftreleased.NET1.0in2002..NETis(intheabstract)nothingmorethan
cleaned-upCOM,MFC,C++,andWindows,allworkingseamlesslytogetherundera
singlenewcomponent-orientedruntime..NETsupportsalltheadvantagesofCOM
andmandatesandstandardizesmanyofitsingredients,suchastypemetadatasharing,
dynamiccomponentloading,serialization,andversioning.
(.NET,Java,etc.)usetheclientthreadtojumpintotheobject.Howcanyoupossibly
takea.NETthreadandgiveittoaJavaobject?Thesolutionistoavoidcall-stack
invocationandinsteadtousemessageexchange.Thetechnologyvendorscanstandardize
theformatofthemessageandagreeonwaystorepresenttransactions,security
credentials,andsoon.Whenthemessageisreceivedbytheotherside,theimplementation
oftheplumbingtherewillconvertthemessagetoanativecall(ona.NETora
Javathread)andproceedtocalltheobject.Consequently,anyattempttostandardize
theplumbinghastobemessage-based.
内容参考自《程序员的自我教养》《CLRVIAC#》《ProgrammingWCFService》
前天傍晚我发表了《net网页编程的跨平台就是一句谎言。》,原本就是周末闲来无事,发表一篇略带争议性的博文让大家都来吵吵架,发表自己的看法,根本就没想着谁把谁打倒,一个行业或者是技术阵营是无法用短期口水仗打到对手的。 |
|