name password
OLI-it Text
EN | DE | ES
 
Stamm (abstract)

 
Antworten von: Oli
10/19/2002
3.92 http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&PostID=68418

three tier

Re: three tier
Posted: 17 Oct 2002 03:37 AM
Create a new solution

Add a Web Project to the solution. This is your Presentation Layer

Add a Class Library project to the solution... Call it Business

Add another Class Library to the solution... Call it DataAccess

In the Web Project add a reference to Business

In the Business Project add a reference to DataAccess


Where to put your code

DataAccess
In the DataAccess project create a class called Util. This class should hold functions to call the database. e.g. RunSpRetDataTable(), RunSpRetInt32() etc.... (youll need to write these)

Now create a class in the DataAccess project for Customer, Order etc... (what ever you need for your project).

Typically the customer class would have a function Detail(pint32CustomerID as int32, ..... ).

Here is a Detail function from one of my projects:
Business

In the Business class.. Create a Function called Detail (with the same parameters as DataAccess). This function will pass through to the DataAccess Layer. If there are any business rules or audit tracking you need to apply this is where it goes.


Web (Presentation layer)

The code behind of a webform will call the Detail function in the Business layer which returns a DataTable... you can do what you want with the results..


Bewertung
tollrest
2014 FAL\Frederic cool basement

weitere Hilfe

Antwort mit Bewertung .rdf

Das ist ein Feedback auf die Nachricht.

Wenn Sie eingeloggt sind, können sie eine Bewertung (0 - 100%) abgeben, um die Bezahlung der Antworten zu regeln.

Ausserdem können sie weitere Kommentare (also eine Antwort auf diese Antwort) abgeben.