473,395 Members | 1,936 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

3-tier Design

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
Jun 30 '06 #1
2 1054

"Demetri" <De*****@discussions.microsoft.com> wrote in message
news:95**********************************@microsof t.com...
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


Jun 30 '06 #2
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" <De*****@discussions.microsoft.com> wrote in message
news:95**********************************@microsof t.com...
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

Jun 30 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: adb | last post by:
I came up with a replication configuration that is basically the result of all the restrictions of replication as well as the restrictions of allowable software on work PC's and I was curious if...
3
by: zlst | last post by:
Many technological innovations rely upon User Interface Design to elevate their technical complexity to a usable product. Technology alone may not win user acceptance and subsequent marketability....
0
by: Edward Diener | last post by:
In Borland's VCL it was possible to divide a component into design time and run time DLLs. The design time DLL would only be necessary when the programmer was setting a component's properties or...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
2
by: Paul Cheetham | last post by:
Hi, I have moved an application from VS2003 to VS2005, and I am now unable to view most of my forms in the designer. The majority of the forms in my project are derived from class PACForm,...
1
by: Nogusta123 | last post by:
Hi, I have had a lot of problems getting web pages, master pages and content pages to render in VS2005 design view the same as they would in Internet Explorer. I did a lot of looking on the...
0
by: YellowFin Announcements | last post by:
Introduction Usability and relevance have been identified as the major factors preventing mass adoption of Business Intelligence applications. What we have today are traditional BI tools that...
19
by: neelsmail | last post by:
Hi, I have been working on C++ for some time now, and I think I have a flair for design (which just might be only my imagination over- stretched.. :) ). So, I tried to find a design...
10
by: vital | last post by:
Hi, I am designing the middle tier of a project. It has 6 classes and microsoft application data access block. The six classes are DBServices, Logger, ProjectServices ... etc. and all these...
4
by: Ken Fine | last post by:
I've been living with a frustrating issue with VS.NET for some months now and I need to figure out what the problem is. Hopefully someone has run into the same issue and can suggest a fix. I...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.