Pablolch
Mar 16th, 2006, 03:12 PM
Does all the validation code resides on the business layer?
Where should reside the formating code (how to show dates, numbers, phone numbers, etc)?
I underestand that the validating rules should reside at the business layer. But if the business layer expects information (from the presentation layer) the information itself must be in some format. For example if business layer expects a number as a Double the presentation layer should send a Double, not a string. To send a Double the presentation layer should parse a string tiped by the user and it may contain errors.
So, which one (presentation or business) says that "3;14" is not a Double but "3.14" is, and which one says that 3.14 must be displayed as "0003.14"?
Where should reside the formating code (how to show dates, numbers, phone numbers, etc)?
I underestand that the validating rules should reside at the business layer. But if the business layer expects information (from the presentation layer) the information itself must be in some format. For example if business layer expects a number as a Double the presentation layer should send a Double, not a string. To send a Double the presentation layer should parse a string tiped by the user and it may contain errors.
So, which one (presentation or business) says that "3;14" is not a Double but "3.14" is, and which one says that 3.14 must be displayed as "0003.14"?