Advantages and disadvantages of dynamic link libraries

Source: Internet
Author: User

Introduced:


DLL is a dynamic link library file, also known as an "application extension", which is a software file type. In Windows, many applications are not a complete executable, and they are split into relatively independent, dynamic-link libraries, DLL files, placed in the system. When we execute a program, the corresponding DLL file is called. An application can use multiple DLL files, and a DLL file may also be used by different applications, such that DLL files are called shared DLL files. [1]



Significance:


DLL files are stored in a variety of program functions (sub-procedures) implementation process, when the program needs to call the function to load the DLL, and then get the address of the function, and finally make the call. The advantage of using DLL files is that the program does not need to load all the code at the beginning of the run, but only when a function is needed by the program to remove it from the DLL. In addition, using DLL files can also reduce the volume of your program.



Advantages:

(1) Save more memory and reduce page switching;



(2) DLL file and EXE file independent, as long as the output interface is unchanged (that is, the name, parameters, return value type and calling convention unchanged), the replacement DLL file will not have any impact on the EXE file, thus greatly improving the maintainability and extensibility;



(3) programs written in different programming languages can call the same DLL function just according to the function calling convention;



(4) Suitable for large-scale software development, make the development process independent, the coupling degree is small, facilitates the development and the test between different developer and the development organization.



(5) Save disk space: When an application uses dynamic linking, multiple applications can share a single copy of the DLL on disk. In contrast, when an application uses a static-link library, each application links the library code to the executable image as a separate copy.


Disadvantages:



An application that uses a dynamic-link library is not self-contained, and it relies on a DLL module to exist, and if you use dynamic linking at load time, the program starts to discover that the DLL does not exist, and the system terminates the program and gives an error message. While using runtime dynamic linking, the system does not terminate, but because the exported function in the DLL is not available, the program fails to load, and the speed is slower than the static link. When a module is updated, if the new module is incompatible with the old module, then the software that needs the module to run will die.


My QR code is as follows, welcome to exchange discussion




You are welcome to pay attention to the "It question summary" subscription number. Every day to push the classic face test and interview tips, are dry! The QR code of the subscription number is as follows:




Reference:


Http://baike.baidu.com/view/230750.htm
http://blog.csdn.net/left_la/article/details/12098545
Http://book.51cto.com/art/201008/216649.htm



Advantages and disadvantages of dynamic link libraries


Alibaba Cloud Hot Products

Elastic Compute Service (ECS) Dedicated Host (DDH) ApsaraDB RDS for MySQL (RDS) ApsaraDB for PolarDB(PolarDB) AnalyticDB for PostgreSQL (ADB for PG)
AnalyticDB for MySQL(ADB for MySQL) Data Transmission Service (DTS) Server Load Balancer (SLB) Global Accelerator (GA) Cloud Enterprise Network (CEN)
Object Storage Service (OSS) Content Delivery Network (CDN) Short Message Service (SMS) Container Service for Kubernetes (ACK) Data Lake Analytics (DLA)

ApsaraDB for Redis (Redis)

ApsaraDB for MongoDB (MongoDB) NAT Gateway VPN Gateway Cloud Firewall
Anti-DDoS Web Application Firewall (WAF) Log Service DataWorks MaxCompute
Elastic MapReduce (EMR) Elasticsearch

Alibaba Cloud Free Trail

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.