문제

Should the data validation be in the application/business layer or should it part of the data access layer-acting as a gateway to what goes into the data store?

도움이 되었습니까?

해결책

It depends:

  • Always validate and/or sanitize user-input.
  • Validation in the data access layers facilitates multiple applications without redundant validation code.
  • In client/server communications, client-side pre-validation can save a round-trip (when the data is invalid).
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top