Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 1.x and 2.0 Application Design Application design with ASP.NET 1.0, 1.1, and 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.x and 2.0 Application Design section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 14th, 2005, 10:26 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 100
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ~Bean~
Default Class Library

What is the difference...or benefit...of using a project of type "Class Library"...I currently have all my classes in a Web App project (and thats all thats in there)...should I change this?

-------------------------
Beware of programmers with screwdrivers...
__________________
-------------------------
Beware of programmers with screwdrivers...
  #2 (permalink)  
Old October 14th, 2005, 11:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Using class libraries makes it much easier to reuse the code you are doing; that is, if you design your solution properly.

E.g. you might want to put the database layer in a class library with some common functionality, which you can use in some other project. If the code is integrated in the entire solution, it is much harder to extract it later. I have made an RSS class library, which I can use in every thing I do to write RSS feeds, and therefore I do not have to rewrite the trivial methods each time.

IMO well-written code is also well-designed, which IMO means modularized code.

Jacob.
  #3 (permalink)  
Old October 17th, 2005, 07:08 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , USA.
Posts: 100
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to ~Bean~
Default

thanks jacob!

I can see the benefits of the database layer, but I don't fully understand how you're suggesting I reuse it. My classes are nearly all database related, but my databases are different design for different projects. How would I design the data access layer so I can reuse it? Are there specific, possibly more generic components or methods I should use?

-------------------------
Beware of programmers with screwdrivers...
  #4 (permalink)  
Old October 17th, 2005, 07:55 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Copenhagen, , Denmark.
Posts: 440
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Well, you can see the class libraries as the stuff that you think would be nice to have in general beside the classes etc. provided my the framework. So it is really a matter of abstraction.

Class libraries are to be designed generic so for the database example there should not be any information about a specific database, table etc. Perhaps you would like a method to extract a column from a specific table. The signature might look as follows...
Code:
public somedatatype ExtractColumn(string connectionstring, string table, string column)
... and somedatatype is the format in which you in general would like to get you extract. This is a simple example but keep in mind that the methods have to be generic to be reuseable.

Jacob.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
use of class library Theone84 C# 1 July 26th, 2008 02:19 AM
How to use a class library vs2005? badboy700 Visual Studio 2005 2 December 10th, 2007 09:38 PM
Using a class library Kiran Patil VS.NET 2002/2003 0 August 19th, 2006 05:52 AM
Regarding Class Library (.dll) from class file manish.sharma04 BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 1 March 3rd, 2006 07:32 AM



All times are GMT -4. The time now is 08:42 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.