Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
N-tier question
Message
From
15/01/2003 05:52:35
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Miscellaneous
Thread ID:
00740247
Message ID:
00741803
Views:
16
>Kev,
>
>In a 3-layered architecture you have the presentation layer that is responsible for interacting with the user, the middle layer that is repsonsible for enforcing business logic, and the database layer that is responsible for storing, retrieveing and enforcing the integrity of the data. When you pose the question of "empty fields" the obvious question is, what about empty fields?
>
>Are you trying to help the user get the data correct by advising them when a field is empty that shoudn't be, that would be the presentation layer. Are you enforcing a business logic rule that precludes certain fields from being empty, that would be the middle layer. Or is this a data integrity issue that precludes a field from being empty (like a PK or FK situation), then that would be the database layer.
>
>The real truth is that you may be dealing with the empty fields issue in all three layers. The presentation layer is trying to assist the user in getting the data correct before it is submitted to the business layer. The business layer is enforcing the business logic that says that the field may not be empty. Finally the database layer is enforcing the integrity of the data and preventing the empty field from ever getting into the database.
>
>One reason you might do this in all three layers is that with a VFP front end you can easily assist the user in getting the data right, however in a browser front end it may not be that easy and you may decide to let the submittal get through and have the business layer catch the problem. However, even if the business layer was bypassed in some situation you cannot allow the data integrity to be violated so you also need to enforce the rule at the database level.

Yes, I would agree with that, if each tier has to act independently, as they should, then it would be sensible not to pin this responsiblity on just one of the tiers, but have them all prepared sufficently.

Thanks for the lowdown.

Kev
Previous
Reply
Map
View

Click here to load this message in the networking platform