WEB Application

20/09/16 웹 프로그래밍 기초 (Annotation, constraints, jquery event propagation)

Tech Signal 2020. 9. 16. 18:45

<Constraints 그룹짓기>

등록할때 검증할 데이터, 수정할때 검증할 데이터 서로 다를 수도 있음 

e.g. 주민번호의 경우 등록만 가능, 수정 불가

=> 그러면 business logic이 다르고 적용할 validation도 달라져야함

 

Marker Interface(메서드가없는 인터페이스): 마킹해주는 것. 그냥 얘가 이런애다~하고 표현해줌

   e.g. serializable(Ctrl+Shift+T로 확인하쇼), payload

 

MemberVO 에서 변수 선언할 때

'인서트그룹이라는 힌트'가 적용되있는 경우에만 검증하겠다!


<Constraint composition>

제약조건 여러개가 모여 하나를 이루게 하기

출처: Hibernate Validator Org

docs.jboss.org/hibernate/stable/validator/reference/en-US/html_single/#section-constraint-composition

 

Hibernate Validator 6.1.5.Final - Jakarta Bean Validation Reference Implementation: Reference Guide

Validating data is a common task that occurs throughout all application layers, from the presentation to the persistence layer. Often the same validation logic is implemented in each layer which is time consuming and error-prone. To avoid duplication of th

docs.jboss.org


<Client validation> : jqueryvalidation.org/documentation/

required는 HTML5에서 가능한 건데 브라우저 환경에 따라 달라짐 so 웹표준화전략 needed

 


<이벤트 전파 구조>

    event.preventDefault(): 이벤트 자체를 중단시킴
    event.stopPropagation(): 이벤트 전파를 중단시킴

                  이벤트의 종류: bubbling, capturing

 

바깥 -> 안쪽 : capturing 

안쪽 -> 바깥 : bubbling (stopPropagation()으로 멈춤)