Wrox Programmer Forums
|
BOOK: Beginning C# 2005 Databases
This is the forum to discuss the Wrox book Beginning C# 2005 Databases by Karli Watson; ISBN: 9780470044063
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning C# 2005 Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 16th, 2008, 12:43 PM
Registered User
 
Join Date: Aug 2008
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multi Layered Design

Hello,

I am working on a program that takes multiple fields from several databases, about 160 to be more specific, and writes the values to a text file. My question is in designing a multi layered app I have it where each DB in the program gets it's own data class and a corresponding business class. Is this the better approach or should I have one data class that uses a join and one business class that is a class of the result set?

 
Old October 19th, 2008, 11:29 AM
Friend of Wrox
 
Join Date: Sep 2008
Posts: 234
Thanks: 0
Thanked 32 Times in 30 Posts
Default

There's a bazillion ways to do this, but I favor a three-tier design in situations like this.

1. The first tier is the user interface. It contains the code that the end user sees and interacts with.

2. The second tier contains the rules that dictate how you want to interact with the data. For example, if the user interface has a login screen, perhaps each person has a different security access code. That way, one employee might have access to some data, but is denied access to other data. This tier enforces those rules.

3. The third tier contains the code that interacts with the data. The sole purpose of this tier is to service the second tier's request for (or edits to the) data. Even though you are working with multiple DB's or tables, I would put everything that talks with the business rules tier in this tier. This decouples the rules from the data server. The advantage is that you isolate the tiers so each becomes a "black box" to the other tiers. Therefore, if you make changes in the data tier, the rules tier need not even know about it.

(WARNING: Ad to follow)
My C# book designs and implements a simple card game in Chapter 10. The user interface is what the player sees (tier 1). The second tier contains the rules for the game (which includes betting), and the third tier is the data server. In this case, rather than being a DB, the data server tier is a deck of cards, with methods for creating the deck, shuffling it, and dealing out cards, etc. While your problem is not a one-to-one match, it can be modeled as such.

I hope this helps...

Dr. Purdum

Jack Purdum, Ph.D.
Author: Beginning C# 3.0: Introduction to Object Oriented Programming (and 14 other programming texts)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Layered Applications Muhammad Zeeshan General .NET 5 July 25th, 2007 04:08 AM
Adding Multiple Event to button in layered PopUp saqlain.abbas ASP.NET 1.0 and 1.1 Professional 1 June 28th, 2007 04:05 AM
Multi-field entry design and reporting Nanette Access 2 October 26th, 2006 11:02 AM
multi-multi-multiple Insert with subquery??? jmjyiannis SQL Server 2000 1 May 5th, 2006 02:20 PM
Java Design issue with UML and Design Patterns the_logical_way Apache Tomcat 0 May 31st, 2004 04:02 AM





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