What are the advantages of creating dll’s in the project and not putting the classes directly into it?

Asked

Viewed 198 times

6

In the company where I work use many DLL’s and I have a lot of difficulty debugging and understand this... In my projects (personal) I always put the classes directly in it and do not do as they, I find it much easier so, what is the advantage of using DLL? recalling that I program in ASP.NET C#.

EDIT: I have access to the DLL source code, but one of the problems is, the API key I call is inside the DLL, in case that key expires I don’t get a specific error, I can’t debug the method inside the DLL because when I import the DLL I can only read the verb of the methods and the name of the attributes. I can only debug if I open the DLL project and run it inside.

  • 2

    I assume that it is similar to creating a lib for use in several places, the difference is that they are "compiled", of course a DLL without a use documentation is quite complicated. Overall I think that’s it, being able to use the DLL for various things, now create a very specific class that only makes sense in that software nor see reason to move to a DLL.

  • 1

    If you have access to the DLL source, you will have no problem debugging it... But as the colleague said, they are libraries that are being made available to you and it is possible to assume that their functionality has already been tested and validated before its distribution, in which case you should not even worry about debugging your code. Just make your implementation according to API documentation.

  • Guys take a look at the issue, I don’t know if I could explain the case properly, but I think it answers what you commented

2 answers

6


I don’t know if there’s any other reason, but here come the ones I know:

  • When you have large projects the build time starts to be a problem, so you can compile the Dlls as they are changed, or for example, after marketing the software, you can make updates in a simple way
  • Allows loading and releasing as needed to save machine resources.
  • Organize and distribute the project modules more simply.
  • Make code reusable

3

The most important reason has already been said: Reuse code, you allow other people to use code that is already ready which (should) decreases the time to build new systems and (should) ensures that the module is functional because you can create unit tests in a more isolated way and have a proper testing coverage.

To complement:

  • You can evolve part of the software in isolation because the other modules load the DLL, but this only really happens if you do not change the signature of the declared functions.
  • You can have more than one version of the module in different Dlls, which can be good or bad depending on how you load the DLL. If you install your Dlls in the Windows folder (or somewhere else shared by the applications that use them) you may have a severe headache (also known as Hell DLL).
  • You can create your software with a plugin-based architecture (which will be developed as Dlls) and with it can evolve and incorporate new features even at runtime (saved due proportions of problems with code you are running, dependencies of other libraries and different versions of Dlls).

Browser other questions tagged

You are not signed in. Login or sign up in order to post.