3-tier Design

Discussion in 'ASP .Net' started by =?Utf-8?B?RGVtZXRyaQ==?=, Jun 30, 2006.

  1. I have a 3-tier design question, in particular the Business layer.

    Allow me to illustrate in order to convey what my question is.

    Lets say we have a database with two tables. The Orders and OrderDetails
    table.

    Lets say we have two pages:
    Page1: Has a grid that shows a list of orders.
    Page2: Shows the Order details.

    What entities would you create? In tradition, I would think there would only
    be one Entity (Order and OrderCollection). So then, how would one represent
    the details?

    In addition, lets say Page3 shows the same info as Page2 with the exception
    of additional fields such as some aggregate totals.

    I can not see making an entity to represent each and every way Order
    information may be retrieved from the database. You may have several stored
    procedures:
    GetOrders
    GetOrdersWithTotals
    GetOrderDetails
    GetOrderDetailsWithTotals
    GetOrdersWithSomeOtherData
    GetOrdersWithAnotherSetOfData
    Etc...

    So how many Order type entities is necessary?

    I stay away from having the UI reference any data elements or namespaces
    such as System.Data or my DAC layers. The only references it has is the
    Business or Service layers.

    Is there a web site (wth source code) that illustrates a true 3-tier object
    model?

    --
    -Demetri
     
    =?Utf-8?B?RGVtZXRyaQ==?=, Jun 30, 2006
    #1
    1. Advertising

  2. =?Utf-8?B?RGVtZXRyaQ==?=

    tdavisjr Guest

    "Demetri" <> wrote in message
    news:...
    Look at the PetShop 4.0. Its a good reference application for what you
    trying to do.

    >I have a 3-tier design question, in particular the Business layer.
    >
    > Allow me to illustrate in order to convey what my question is.
    >
    > Lets say we have a database with two tables. The Orders and OrderDetails
    > table.
    >
    > Lets say we have two pages:
    > Page1: Has a grid that shows a list of orders.
    > Page2: Shows the Order details.
    >
    > What entities would you create? In tradition, I would think there would
    > only
    > be one Entity (Order and OrderCollection). So then, how would one
    > represent
    > the details?
    >
    > In addition, lets say Page3 shows the same info as Page2 with the
    > exception
    > of additional fields such as some aggregate totals.
    >
    > I can not see making an entity to represent each and every way Order
    > information may be retrieved from the database. You may have several
    > stored
    > procedures:
    > GetOrders
    > GetOrdersWithTotals
    > GetOrderDetails
    > GetOrderDetailsWithTotals
    > GetOrdersWithSomeOtherData
    > GetOrdersWithAnotherSetOfData
    > Etc...
    >
    > So how many Order type entities is necessary?
    >
    > I stay away from having the UI reference any data elements or namespaces
    > such as System.Data or my DAC layers. The only references it has is the
    > Business or Service layers.
    >
    > Is there a web site (wth source code) that illustrates a true 3-tier
    > object
    > model?
    >
    > --
    > -Demetri
     
    tdavisjr, Jun 30, 2006
    #2
    1. Advertising

  3. =?Utf-8?B?RGVtZXRyaQ==?=

    sloan Guest

    I have an example at:

    http://sholliday.spaces.msn.com/PersonalSpace.aspx 6/5/2006
    5/24/2006 entries

    2.0 and 1.1 respectively.

    You would do 2 entities.

    class Order
    private m_orderID;

    class OrderDetail
    private int m_orderDetailID;
    private int m_parentOrderID;


    the Order class will have a subcollection object.

    class Order
    private OrderDetailCollection m_allOrderDetails;


    The example is brief, but blog has downloadable code against the Northwind
    database for a complete look/view.





    "Demetri" <> wrote in message
    news:...
    > I have a 3-tier design question, in particular the Business layer.
    >
    > Allow me to illustrate in order to convey what my question is.
    >
    > Lets say we have a database with two tables. The Orders and OrderDetails
    > table.
    >
    > Lets say we have two pages:
    > Page1: Has a grid that shows a list of orders.
    > Page2: Shows the Order details.
    >
    > What entities would you create? In tradition, I would think there would

    only
    > be one Entity (Order and OrderCollection). So then, how would one

    represent
    > the details?
    >
    > In addition, lets say Page3 shows the same info as Page2 with the

    exception
    > of additional fields such as some aggregate totals.
    >
    > I can not see making an entity to represent each and every way Order
    > information may be retrieved from the database. You may have several

    stored
    > procedures:
    > GetOrders
    > GetOrdersWithTotals
    > GetOrderDetails
    > GetOrderDetailsWithTotals
    > GetOrdersWithSomeOtherData
    > GetOrdersWithAnotherSetOfData
    > Etc...
    >
    > So how many Order type entities is necessary?
    >
    > I stay away from having the UI reference any data elements or namespaces
    > such as System.Data or my DAC layers. The only references it has is the
    > Business or Service layers.
    >
    > Is there a web site (wth source code) that illustrates a true 3-tier

    object
    > model?
    >
    > --
    > -Demetri
     
    sloan, Jun 30, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. rob

    ASP v2 & 3-tier or 2-tier

    rob, Aug 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    432
    Steve C. Orr [MVP, MCSD]
    Aug 13, 2004
  2. NOSPAM

    2 tier to 3 tier?

    NOSPAM, Oct 14, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    466
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
    Oct 14, 2004
  3. Steve Kershaw

    Setting up a new tier in a 3-tier system?

    Steve Kershaw, Mar 28, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    476
    Steve Kershaw
    Mar 29, 2006
  4. Shantanu Bhattacharya
    Replies:
    2
    Views:
    593
    Christopher Benson-Manica
    Dec 26, 2003
  5. Shantanu Bhattacharya

    Converting a 2-tier application to 3-tier application

    Shantanu Bhattacharya, Dec 25, 2003, in forum: C Programming
    Replies:
    2
    Views:
    488
    Christopher Benson-Manica
    Dec 26, 2003
Loading...

Share This Page