Newbie Question: Better to complie classes into dlls?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am aware there are long books written on this subject, however, maybe
there's a "simple" answer to this question:

I've several classes in my ASP.NET and Windows .NET Compact Framework
applications. My question is if it's worth while performance-wise to complie
these classes into separate dll's and reference then to each respective
project?

My doubt arises b/c when i complie and deploy each respective appication
type (ASP.NET or Windows .Net CF) the *.cs files seem to be "integrated" or
compiled w/in each respective application's assembly?

And, am i correct to assume (generalize) that compiling each class
separately is intended to simplify reusable code (i.e. OOP) rather than
improve performance?

Thanks,
 
Hi,

The simple and short answer would be:

If you have a number of reusable classes that are likely to be used in many
applications, create a class library project, add all these classes to this
project and get a class library assembly as the result. This assembly then
can be referenced from any application.

From the performance standpoint, if you have a separate assembly with
reusable classes, you can reduce the application's memory footprint as this
assembly won't be loaded unless a class or type from it is used by the main
application (I assume here ngen is not used).
 
Back
Top