Custom Control

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

Guest

I'm intending to write classes that I'll be using in my web application.
These classes include User, Member, Product, DbManager, Email and etc.

Should I add a new class to my web application project or create a new class
library project and write all the classes there?

One thing I notice that no matter which method I choose, after I build the
classes, there will only be 1 dll file created. For e.g. if I create a new
library project called ABC, and I write all my classes (User, Member,
Product, DbManager, ...) and build them, there's only 1 ABC.dll file created,
rather than User.dll, Member.dll, Product.dll... Is this correct? Or should I
create a User library project for a User class, then a Member library project
for a Member class, ...?

Please enlighten... Thank you.
 
For each Project you create, one DLL or executable will be created. A single
DLL can contain multiple classes. A single Solution may contain many
Projects (DLLs and/or executables).

As to when you should put classes into a class library, the basic question
you need to ask yourself is, how many different projects might these classes
be useful in? If they are only useful to the current application, there's no
real need to separate them out into a separate DLL or Class Library. But if
you notice that a class or a set of classes might be designed in such a way
that they might be useful in a different project, put them into a class
library.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 
Thank you very much~

Kevin Spencer said:
For each Project you create, one DLL or executable will be created. A single
DLL can contain multiple classes. A single Solution may contain many
Projects (DLLs and/or executables).

As to when you should put classes into a class library, the basic question
you need to ask yourself is, how many different projects might these classes
be useful in? If they are only useful to the current application, there's no
real need to separate them out into a separate DLL or Class Library. But if
you notice that a class or a set of classes might be designed in such a way
that they might be useful in a different project, put them into a class
library.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
What You Seek Is What You Get.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top