locked
Using dll in a Web Page? RRS feed

  • Question

  • User418394696 posted

    Hi all.

    I'm thinking about extract some code from my application an do this part in a dll. What do you think about this if the server have a lot of work and how could it do a lowest page?

    The code will be a .cs generic for the application.

    Thank you.

    Wednesday, November 4, 2009 6:11 AM

Answers

  • User1414178881 posted

    Which one is faster? Both are the same because both are compiled but in case you used a class (not in a  dll) and publish the site,it's code and other pages's code are all compiled into multible dlls. So from performance perspective you will never notice a difference,but from other perspectives..there are many advanteges of using a separate dll for your class:

    1)Re-usability:If you intend to use a specific code in multible places/projects,a separate dll is the best choice

    2)Maintainability: If you want to fix a bug/update code inside your classes ONLY(you didn't make changes that may effect any page's code),dll is the best choice since all you have to do is to replace the dll and that's it.Imagine if you didn't make a dll for your class,you will have to publish the whole website..;)

    I only mentioned two of the most important things,there are also security and other advantages..


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 4, 2009 9:54 AM

All replies

  • User2130758966 posted

    Hi,

    You can create a Class Library project and put your code in there.

    Then you will need to add a project dependency to the main website project so that it copies the assembly (dll) over at compile time.


    This is a good approach to take so that you can separate your concerns and re-use code between projects.

    Wednesday, November 4, 2009 8:02 AM
  • User-1557807525 posted

    You can very well create a seperate dll (Class Library) in .NET and reference those in Web Application. 

    Wednesday, November 4, 2009 8:03 AM
  • User418394696 posted

    I don't know if the first reply is the same that the second because both may have a class but I think that the way that page use the code is different so. Which one is the faster solution?

    There is any difference instead of the way of using the code in the page?


    Thank you very much!!


    Wednesday, November 4, 2009 9:25 AM
  • User1414178881 posted

    Which one is faster? Both are the same because both are compiled but in case you used a class (not in a  dll) and publish the site,it's code and other pages's code are all compiled into multible dlls. So from performance perspective you will never notice a difference,but from other perspectives..there are many advanteges of using a separate dll for your class:

    1)Re-usability:If you intend to use a specific code in multible places/projects,a separate dll is the best choice

    2)Maintainability: If you want to fix a bug/update code inside your classes ONLY(you didn't make changes that may effect any page's code),dll is the best choice since all you have to do is to replace the dll and that's it.Imagine if you didn't make a dll for your class,you will have to publish the whole website..;)

    I only mentioned two of the most important things,there are also security and other advantages..


    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, November 4, 2009 9:54 AM
  • User418394696 posted

    So its the same solution called with different names.

    Thank you I'll use a dll.

    Wednesday, November 4, 2009 10:04 AM
  • User-834176801 posted

    thts really coool !!!!

    Friday, November 6, 2009 5:12 AM
  • User1414178881 posted

    yeah it's coool<strike>,and above all..non of the posts were marked as an answer!!! </strike>

    Friday, November 6, 2009 6:47 AM