Namespaces provide conditional separation for classes, class libraries provide physical separation (in Windows they consider a standalone dll).
Class libraries are useful when you want to combine functions that can be shared with other projects.
Imagine that you are creating a Windows application in which you separate the user interface and implementation classes (class library) into two different projects. Then you will find that you need a web version of the same. You can simply import the class library created from the Windows application, and you have all your implementation available to you, and just focus on the web interface.
If you created the entire Windows application in one project, using the namespace to separate them, doing it would be complicated and messy. (ever tried to import exe?)
It is worth noting that class libraries themselves will use namespaces to provide further conditional division into classes within them.
afly
source share