In this case, you have no functional difference, since the business
logic layer is simply returning a view of the DataTable you retrieved
from the data access layer.
If you really only need the view, there is no need for the business
logic layer, because there is no business logic.
If however, you are building a User object that will be used by the
presentation layer and it needs to be smarter, you will not want a
direct coupling to the data access layer. For example, your
presentation layer only deals with the User object, which actually
accesses two data access objects.
public class User{
User(int ID){
//call User data access object and fill this instance properties
for the specified user
//call Hotel data access object and retrive a DataTable of the
hotels associated with this user, set to a property or fill a
collection of hotel objects
}
void AddHotel(int HotelID){
//check to see if user can add this hotel
//check to see if user already has this hotel
}
}
Yes, could put it all together in the presentation layer, but then
your business logic is tied up in a form and not available elsewhere
without cutting and pasting code and all the pain that brings.
There is obviously a lot more too it than this, but there have been
many books and web sites written that answer the eternal OOP
questions. Eva gave some good starting points here...
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/message/20103
On 7/1/05, Arindam <[EMAIL PROTECTED]> wrote:
>
> Hey Champs,
> can anyone explain me what all things i should consider
> while designing a N-tier architecture.
>
>
> like for example i have the folowing step from Datasource to
> Presentation layer
>
> how do differentiate the functionality between Dataaccess Layer and
> Businesslogic Layer
>
> Please have a look at following
>
>
>
> SQL Data source
> ||
> ||
> ||
> this function is written in Dataaccess Layer
> +++++++++++++++++++++++++++++++++++++++++++++
> public DataTable GetMyHotels(string UID)
> {
> DataTable objDT=new DataTable("Dt_HotelList");
>
> return objDT;
> }
> ||
> ||
> ||
> ||
> this function is written in Businesslogic Layer
> +++++++++++++++++++++++++++++++++++++++++++++
> public DataView GetHotelList(string UserID)
> {
> DataTable DT=objHotel.GetMyHotels(UserID);
>
> DataView DV= new DataView(DT);
> return DV;
> }
> ||
> ||
> ||
> ||
> Presentation layer
>
>
>
> Thanks & Regards
>
> Arindam
>
>
>
>
> Thanks & Regards
>
> Arindam
> Web Designer & Developer
>
>
>
>
>
> ---------------------------------
> How much free photo storage do you get? Store your friends n family photos
> for FREE with Yahoo! Photos.
> http://in.photos.yahoo.com
>
> [Non-text portions of this message have been removed]
>
>
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
--
Dean Fiala
Very Practical Software, Inc
http://www.vpsw.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/