Re: Class vs. DLL
- From: "Peter Rilling" <peter@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 12 Aug 2008 15:29:55 -0700
As you are trying to do, it is always a good practice to move common
functionality away from the application so that it can be shared.
Now some clarification regarding your "class" vs. "dll" question. A DLL is
a container for classes, therefore when you create a class, it is compiled
into a DLL/Assembly. You can simply create another "library" project and
move your classes/code from the console project. Once done, then yes, you
have to add a reference to that assembly in your console application.
As to whether you use a "using" statement depends on your namespaces. If
your choose to give your library code a different namespace from your
application (which you will probably want to do since this code will be
shared) then you will also need to add a "using"directive in any application
file that references your utility classes.
"Paolo" <Paolo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:968DD95E-E101-41A9-A7C9-5AFDC74E98DC@xxxxxxxxxxxxxxxx
Learning C# using Console applications. I want to develop some utility
functions (wrapping up some of the Console class methods) so that I can
have
them available for any program that I write.
If I create a DLL do I include these functions by adding it as a reference
in my projects?
If I create a Class do I add the 'using' directive to include them?
Are there any pros/cons with respect to either approach?
Thanks
.
- Follow-Ups:
- Re: Class vs. DLL
- From: Paolo
- Re: Class vs. DLL
- From: Paolo
- Re: Class vs. DLL
- References:
- Class vs. DLL
- From: Paolo
- Class vs. DLL
- Prev by Date: Re: Class vs. DLL
- Next by Date: Re: Developing a C# Webcrawler
- Previous by thread: Re: Class vs. DLL
- Next by thread: Re: Class vs. DLL
- Index(es):
Relevant Pages
|