26. POJO built by DTOService
Minimal ondemand data item
DTO (DataTransferObject)
27. POJO built by DTOService
Minimal ondemand data item
Free from Entity model changes
DTO (DataTransferObject)
28. POJO built by DTOService
Minimal ondemand data item
Free from Entity model changes
No referenced property loading
concerns
DTO (DataTransferObject)
39. @DTOType(CustomerListingDTO.class)
public class CustomerEntityToListingDTOConverter implements EntityToDTOConverter {
@Override
public Class<CustomerEntity> getEntityType() {
return CustomerEntity.class;
}
@Override
public Class<CustomerListingDTO> getDTOType() {
return CustomerListingDTO.class;
}
@Override
public CustomerListingDTO convertToDTO(CustomerEntity e) {
…
}
}
40. public class DTOTypeAnnotationLiteral extends AnnotationLiteral<DTOType> implements DTOType {
private Class<? extends AbstractDTO> dtoType;
public DTOTypeAnnotationLiteral(Class<? extends AbstractDTO> dtoType) {
this.dtoType = dtoType;
}
@Override
public Class<? extends AbstractDTO> value() {
return dtoType;
}
}
41. protected EntityToDTOConverter findEntityToDTOConverter(
Class<? extends AbstractDTO> dtoType) {
Instance<EntityToDTOConverter> converterSelection = converterInstantiator
.select(new DTOTypeAnnotationLiteral(dtoType));
if (converterSelection.isAmbiguous()) {
// more than one converter for same type exception…
}
if (converterSelection.isUnsatisfied()) {
// no converter available exception
}
return converterSelection.get();
}
52. In memory containers
BeanItemContainer – A container that is
automatically built from a collection of
Java Beans
HierarchicalContainer – IndexedContainer
that supports parent/child relationships
IndexedContainer – Basic container
that is manually built
68. Fields are Components with databinding
Fields can be bound to properties
Vaadin Fields
69. Fields are Components with databinding
Fields can be bound to properties
Group of properties is an Item
Vaadin Fields
70. public class Person {
private String name;
private int age;
// Getters and setters omitted
}
71. public class Person {
private String name;
private int age;
// Getters and setters omitted
}
BeanItem<Person> item =
new BeanItem<Person>(person);
72. public class Person {
private String name;
private int age;
// Getters and setters omitted
}
BeanItem<Person> item =
new BeanItem<Person>(person);
Property ID Type Value
“name” String.class “John Doe”
“age” Integer.class 42
73. public class Person {
private String name;
private int age;
// Getters and setters omitted
}
BeanItem<Person> item =
new BeanItem<Person>(person);
Property ID Type Value
“name” String.class “John Doe”
“age” Integer.class 42