P
pablolch
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. ¿Do this validation should reside on the presentation
layer?
1) Which one (presentation or business) says that "3;14" is not a
Double but "3.14" is
2) 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. ¿Do this validation should reside on the presentation
layer?
1) Which one (presentation or business) says that "3;14" is not a
Double but "3.14" is
2) Which one says that 3.14 must be displayed as "0003.14"?