Java EE - JSR 303 Bean validation - Pierre-Johan CHARTRE

Slides:



Advertisements
Similar presentations
AspectWerkz 2 - and the road to AspectJ 5 Jonas Bonér Senior Software Engineer BEA Systems.
Advertisements

Apache Struts Technology
Web Services Web Services are the basic fundamental building blocks of invoking features that can be accessed by an application program. The accessibility.
ColdFusion 8 Ajax Features Overview Scott Bennett
JNDI Java Naming Directory Interface JNDI is an API specified in Java that provides naming and directory functionality to applications written in Java.
Java Annotations. Annotations  Annotations are metadata or data about data. An annotation indicates that the declared element should be processed in.
Integrating SOA and the Application Development Framework Shaun O’Brien Principal Product Manager – Oracle JDeveloper / ADF.
JBoss Seam: Contextual Components Jason Bechtel
Internet Technologies 1 Master of Information System Management Java Server Faces Model/View/Controller Design Pattern for Web Development Slides.
MIT iCampus iLabs Software Architecture Workshop June , 2006.
Presented by IBM developer Works ibm.com/developerworks/ 2006 January – April © 2006 IBM Corporation. Making the most of The Eclipse Web Tools Platform.
1 Draft of a Matchmaking Service Chuang liu. 2 Matchmaking Service Matchmaking Service is a service to help service providers to advertising their service.
Apache Struts Technology A MVC Framework for Java Web Applications.
© 2006 by IBM 1 How to use Eclipse to Build Rich Internet Applications With PHP and AJAX Phil Berkland IBM Software Group Emerging.
Spring Roo CS476 Aleksey Bukin Peter Lew. What is Roo? Productivity tool Allows for easy creation of Enterprise Java applications Runs alongside existing.
Rice KRAD Data Layer JPA Design Eric Westfall July 2013.
CSE446 S OFTWARE Q UALITY M ANAGEMENT Spring 2014 Yazılım ve Uyguluma Geliştirme Yöneticisi Orhan Başar Evren.
JavaServer Faces: The Fundamentals Compiled from Sun TechDays workshops (JSF Basics, Web-Tier Codecamp: JavaServer Faces, Java Studio Creator; IBM RAD)
1 INTRO TO BUSINESS COMPONENTS FOR JAVA (BC4J) Matt Fierst Computer Resource Team OracleWorld Session
Pittsburgh Java User Group– Dec Java PureFaces: A JSF Framework Extension.
Tony Nguyen.  Architecture  Advantages  Disadvantages  Setup JSF Environment  JSF & Database  Conclusion  Demo.
Grant Ronald Principal Product Manager JDeveloper and ADF for Forms Developers: Taking it to the next level.
Object and component “wiring” standards This presentation reviews the features of software component wiring and the emerging world of XML-based standards.
Copyright © IBM Corp., All rights reserved; made available under the EPL v1.0 | March 20, 2008 | Short Talk Standards based systems management: An.
MDA and QVT  Tom Gullion, Director of Product Management, Together Products.
Content provided under the terms and conditions of the Eclipse Public License Version June Eclipse Foundation - Chuck Bridgham/
Spring core v3.x Prepared by: Nhan Le. History v3.0 Spring Expression Language Java based bean metadata v3.1 Cache Abstraction Bean Definition Profile.
|Tecnologie Web L-A Anno Accademico Laboratorio di Tecnologie Web Introduzione ad Eclipse e Tomcat
Dali JPA Tools. About Dali Dali JPA Tools is an Eclipse Web Tools Platform sub-Project Dali 1.0 is a part of WTP 2.0 Europa coordinated release Goal -
JSF Introduction Copyright © Liferay, Inc. All Rights Reserved. No material may be reproduced electronically or in print without written permission.
Component frameworks Roy Kensmil. Historical trens in software development. ABSTRACT INTERACTIONS COMPONENT BUS COMPONENT GLUE THIRD-PARTY BINDING.
Binding UI Components to Data. Adding UI Components to the Page You can create components on a page by: Dragging a component from the Component Palette.
Enterprise Development with IntelliJ IDEA Mike Aizatsky Project Manager JetBrains, Inc.
1 Geospatial and Business Intelligence Jean-Sébastien Turcotte Executive VP San Francisco - April 2007 Streamlining web mapping applications.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Forms with Spring MVC Handling Form.
Windows Role-Based Access Control Longhorn Update
ModelPedia Model Driven Engineering Graphical User Interfaces for Web 2.0 Sites Centro de Informática – CIn/UFPe ORCAS Group Eclipse GMF Fábio M. Pereira.
Sheet 1 DocEng’03, Grenoble, November 2003 Model Driven Architecture based XML Processing Ivan Kurtev, Klaas van den Berg University of Twente, the Netherlands.
INTEGRATION OF BACKBONE.JS WITH SPRING 3.1. Agenda New Features and Enhancements in Spring 3.1 What is Backbone.js and why I should use it Spring 3.1.
JSP Custom Tags. Prerequisites Servlet API Mapping to JSP implicit objects JavaServer Pages Basic syntax Implementation via servlet API XML.
Copyright 2007 SpringSource. Copying, publishing or distributing without express written permission is prohibited. Spring MVC Essentials Getting started.
CIP4 Tutorial - JDF Capabilities January 23, Welcome Steve Hiebert Chair, CIP4 Product Description WG Software Architect Indigo Digital Press Division.
Preface IIntroduction Objectives I-2 Course Overview I-3 1Oracle Application Development Framework Objectives 1-2 J2EE Platform 1-3 Benefits of the J2EE.
Java Annotations. Annotations  Annotations are metadata or data about data. An annotation indicates that the declared element should be processed in.
Modern Programming Language. Web Container & Web Applications Web applications are server side applications The most essential requirement.
CPSC 203 Introduction to Computers Lab 21 By Jie Gao.
Ewa Deelman, Virtual Metadata Catalogs: Augmenting Existing Metadata Catalogs with Semantic Representations Yolanda Gil, Varun Ratnakar,
ODATA DESIGN PRINCIPLES July 26, BUILD ON HTTP, REST OData is a RESTful HTTP Protocol Build on HTTP Entities modeled as Resources Relationships.
Google Code Libraries Dima Ionut Daniel. Contents What is Google Code? LDAPBeans Object-ldap-mapping Ldap-ODM Bug4j jOOR Rapa jongo Conclusion Bibliography.
XML Extensible Markup Language
Apache Struts Technology A MVC Framework for Java Web Applications.
INFN OCCI implementation on Grid Infrastructure Michele Orrù INFN-CNAF OGF27, 13/10/ M.Orrù (INFN-CNAF) INFN OCCI implementation on Grid Infrastructure.
CAE 1.2 Andrew Pople University of Pittsburgh 7/19/2006.
Encoder versus OTD Gabriel Badescu, Jun Xu Sun Microsystems, Inc.
CDDLM Component Model Steve Loughran HP Laboratories.
Form Builder Tomáš Černý Michael J. Donahoo Eunjee Song Department of Computer Science Baylor University, Waco, TX.
Intro to JavaServer Faces Mimi Opkins CECS 493 Fall 2016.
The Holmes Platform and Applications
Geertjan Wielenga
LOCO Extract – Transform - Load
Towards Effective Adaptive User Interfaces Design
Pentaho Reporting – Citrus edition
Introduction to J2EE Architecture
Data Modeling II XML Schema & JAXB Marc Dumontier May 4, 2004
What’s changed in the Shibboleth 1.2 Origin
JavaServer Faces: The Fundamentals
Java Programming Course
The JSF Tools Project – WTP (internal) release review
Objectives In this lesson, you will learn about:
Presentation transcript:

Java EE - JSR 303 Bean validation - Pierre-Johan CHARTRE

Goals “Validating data is a common task that is spread across several (if not all) layers of today's applications.” The JSR-303 Bean Validation specification addresses this problem by providing: an extensible annotation-based validation declaration model (XML deployment descriptors will be available as well) a standard runtime validation API a standard metadata query API

Expressing constraints Annotation-based or XML-based definition on class, field, or getter Validating an object is equivalent to validate all the constraints declared on: its fields –its getters –its class –its superclasses –its interfaces

Use constraints Message A constraint can define a custom error message returned when failure occurs. Object graph validation It is handy to validate an object graph as a whole rather than validate every single object allows you to include associated objects to the validation process

The Validator API A Validator validates objects (graphs) of a given type. When an object is validated, all declared constraints are validated (from fields, getters, the class itself and associated objects if marked as such). The validation will process all constraints and return the list of all failing ones. This is quite useful to display all erroneous fields in a user interface. Object: Validate an object Value: Validate a value Constraint groups: Validate a subset of the declared constraints rather than all available constaints (using the notion of constraint groups) validate a gradually populated object graph (wizard style UI or use case driven validation) validate a set of constraints before an other set of constraints (the second relying on the first or being expensive resource-wise)

Mind your own constraint Constraints are not limited to built-in annotations. Any application can define its own additional set of constraints. A constraint is comprised of: an annotation a constraint validation implementation

Write a custom constraint As simple API to create a constraint Create a new annotation With runtime retention policy Annotated they must have a message attribute they must have a groups attribute Usage:

Write a custom constraint The validator implementation The constraint implementation is associated to its annotation through the use The implementation must implement a very simple interface Constraint where A is the targeted constraint annotation

Write a custom constraint

Other feature Class level constraints Same approach ! Constraints group Constraints ordering

Conclusion Standard API Declarative model Flexible API Stay as simple and understandable as possible Plug and play API with JSF: EL value binding validation JPA: before create/merge

Keywords Constraint