Difference Between DLL and EXE in .NET

1. Difference between DLL & EXE

DLL - Dynamic-link library. It is Microsoft’s implementation of a shared library. This means that many different programs can use this library to do their tasks making it easier on the programmers so that they do not have to keep reinventing the wheel each time they write software. In simple terms a .DLL file will contain logic that other programs will use.

EXE - Executable. It denotes that a program is executable. This just means that if you double click on the file a program will run, normally with some kind of interface for a user to interact with. The file formats for EXE and DLL actually the same.

2. DLL Hell

"DLL Hell" refers to the set of problems caused when multiple applications attempt to share a common component like a dynamic link library (DLL) or a Component Object Model (COM) class. In the most typical case, one application will install a new version of the shared component that is not backward compatible with the version already on the machine. Although the application that has just been installed works well, existing applications that depended on a previous version of the shared component might no longer work. In some cases, the cause of the problem is even more subtle. In many cases there is a significant delay before a user discovers that an application has stopped working. As a result, it is often difficult to remember when a change was made to the machine that could have affected the application.

How .NET addresses DLL Hell?

Microsoft .Net 1.1, which is integral to the Windows Server 2003 operating systems, supports strong binding. Strong binding means an application or component can bind to a specific version of another component, so you can reuse components or use them in isolation.

.Net 1.1 will provide Windows Server 2003 operating systems with a Global Assembly Cache. This Cache is a repository for all the .Net components that are shared globally on a particular machine. When a .Net component is installed onto the machine, the Global Assembly Cache looks at its version, its public key, its language information and creates a strong name for the component. The component is then registered in the repository and indexed by its strong name, so there is no confusion between different versions of the same component, or DLL.

Windows 2003 Server also uses rules to make sure that an application finds the right component and version. The system will first look for a local version of the component, and will then look in the cache to find an exact match for the strong name of the required component. Failing that, the system will use heuristics to find the next best component, but by default an application will always run against the component that it was built and tested against. Administrators will be able to override these rules for exceptional cases.

Another feature of Windows Server 2003 is that .Net components will have no registration policy. This means it will be easy to take a .Net component on server and copy to another server. Microsoft is calling the feature xcopy deploy, after a command used in DOS to copy capability files, directories and even whole drives from one destination to another. It means you can copy applications instead of reinstalling them and the whole process becomes much simpler.

Also, .NET Framework 1.1 introduced something called side-by-side execution. Side by side is the ability to install and run multiple versions of the same component on the machine concurrently at the same time without interfering with each other. With components that support side-by-side, authors aren't necessarily tied to maintaining strict backward compatibility because different applications are free to use different versions of a shared component.

3. Cookies & Session

Basically these are state management techniques.

cookies are only simple text that is stored on the client with some useful data to identify subsequent requests from the client and help the server to serve the client efficiently. cookies can hold data like books bought during an http session until the session expires. if you could store the nature of these books (e.g. fiction, technology etc.) then this data could be used to know the browsing behaviour of the user.

Sessions are objects (not text files) that store data and regarding a particular session and help the servlets to transfer this data to other servlet invocation so that the WEB SERVER understands (or is made to understand) that these requests have come from the same client. e.g. HttpSession objects are used to store such information.

0 comments:

Post a Comment