Assembly vs DLL
Ib lub tsev qiv ntawv yog ib phau ntawm cov peev txheej uas tuaj yeem siv los tsim cov ntawv thov. Lub tsev qiv ntawv feem ntau yog ua los ntawm cov txheej txheem subroutines, kev ua haujlwm, cov chav kawm, qhov tseem ceeb thiab hom. Thaum lub sij hawm sib txuas cov txheej txheem (feem ntau yog ua los ntawm ib tug linker), cov tsev qiv ntawv thiab executables ua siv rau ib leeg. DLL cov ntaub ntawv yog cov tsev qiv ntawv cov ntaub ntawv uas txuas dynamically. DLL yog tsim los ntawm Microsoft. Tab sis vim muaj qee qhov teeb meem tam sim no nrog DLL cov ntaub ntawv, Microsoft tuaj nrog cov ntaub ntawv sib dhos (nrog. NET moj khaum). Cov ntaub ntawv sib dhos zoo ib yam li DLLs lub cev, tab sis lawv muaj ntau qhov sib txawv sab hauv.
DLL yog dab tsi?
Dynamic Link Library (feem ntau hu ua DLL) yog kev siv lub tsev qiv ntawv sib koom tsim los ntawm Microsoft. Nws siv.dll,.ocx lossis.drv extensions thiab lawv tau siv hauv Microsoft Windows thiab OS/2 operating systems..dll yog siv los ntawm cov ntaub ntawv DLL li niaj zaus. Thiab.ocx txuas ntxiv yog siv los ntawm cov tsev qiv ntawv uas muaj ActiveX tswj thiab.drv txuas ntxiv yog siv los ntawm cov ntaub ntawv keeb kwm tsav tsheb. Cov ntaub ntawv DLL yog tib yam li Windows EXE cov ntaub ntawv (Portable Executable cov ntaub ntawv ntawm 32-ntsis / 64-ntsis Windows, thiab Kev Ua Haujlwm Tshiab ntawm 16 ntsis Windows). Yog li ntawd, ib qho kev sib txuas ntawm cov lej, cov ntaub ntawv thiab cov peev txheej tuaj yeem muaj nyob hauv DLL cov ntaub ntawv (ib yam li hauv EXE cov ntaub ntawv). Raws li qhov tseeb, cov ntaub ntawv cov ntaub ntawv nrog DLL cov ntaub ntawv hom yog hu ua cov peev txheej DLLs. Icon tsev qiv ntawv (nrog.icl txuas ntxiv) thiab cov ntaub ntawv font (nrog.fon thiab.fot extensions) yog cov piv txwv ntawm cov peev txheej DLLs.
Cov khoom hu ua ntu ua rau DLL thiab txhua ntu muaj nws tus yam ntxwv xws li nyeem nkaus xwb / sau tau thiab ua tau / tsis ua tiav. Code seem yog executable, thaum cov ntaub ntawv seem yog tsis executable. Cov tshooj cai tau muab faib thiab cov ntaub ntawv seem yog ntiag tug. Qhov ntawd txhais tau tias tag nrho cov txheej txheem siv DLL yuav siv tib daim ntawv theej, thaum txhua tus txheej txheem yuav muaj nws tus kheej daim ntawv theej ntawm cov ntaub ntawv. Lub tsev qiv ntawv tseem ceeb rau Windows yog kernel32.dll, uas muaj cov haujlwm hauv paus (cov ntaub ntawv thiab kev nco txog kev ua haujlwm) ntawm Windows. COM (Component Object Model) yog qhov txuas ntxiv ntawm DLL rau OOP (Object Oriented Programming). Pa DLLs yooj yim siv dua COM cov ntaub ntawv.
Lub Rooj Sib Tham yog dab tsi?
Cov ntaub ntawv sib dhos tau qhia los ntawm Microsoft txhawm rau daws ob peb yam teeb meem tam sim no nrog DLL cov ntaub ntawv. Cov ntaub ntawv sib dhos tau qhia nrog Microsoft. NET moj khaum. Ib qho kev ua tau zoo ntawm kev ua haujlwm yog hu ua Assembly. Kev sib sau ua ke tau ua tiav raws li. NET CLR (Common Language Runtime). Lub cev, cov rooj sib txoos muaj nyob ua EXE lossis DLL cov ntaub ntawv. Tab sis, lawv txawv heev rau Microsoft Win32 DLLs, sab hauv. Cov ntaub ntawv sib dhos yog tsim los ntawm ib qho manifest, metadata, MISL (Microsoft Intermediate Language code) thiab lwm yam kev pab. Kev sib dhos yog tus kheej piav qhia. Lub manifest muaj cov ntaub ntawv xws li lub npe, version, kab lis kev cai, lub npe muaj zog, cov ntaub ntawv teev npe, hom thiab kev vam meej. MISL code raug tua los ntawm CLR (nws tsis tuaj yeem ua ncaj qha).
Qhov txawv ntawm Kev Sib Tham thiab DLL yog dab tsi?
DLL yog lub tsev qiv ntawv txuas nrog dynamically. Txawm hais tias, cov rooj sib txoos yog lub cev sib npaug rau DLLs, lawv txawv heev hauv. Nws tsis tuaj yeem tswj hwm qhov sib xws ntawm cov txheej txheem DLLs, tab sis CLR tuaj yeem tswj tau qhov sib xws ntawm cov txheej txheem sib dhos, vim tias cov rooj sib tham tau piav qhia tus kheej (lawv muaj cov npe ntawm cov neeg nyob hauv). Tsis zoo li rau DLLs, versioning cov ntaub ntawv raug cai rau cov rooj sib txoos (los ntawm CLR). Kev xa tawm ib sab (kev siv sib txawv siv cov qauv sib txawv) yog ua tau nrog cov rooj sib txoos.