Your SlideShare is downloading. ×
jTransfo lightning talk
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

jTransfo lightning talk

3,339
views

Published on

Very short introduction to jTranso, an open source project which handles conversion between transfer and domain objects.

Very short introduction to jTranso, an open source project which handles conversion between transfer and domain objects.

Published in: Technology

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
3,339
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Convert transfer ↔ domain objects● Easy to use● No dependencies● Annotation based● Many transfer objects – one domain object● Integration ● Spring Framework ● Joda-time
  • 2. Easy conversionJTransfo jTransfo = new JTransfoImpl();SomeDomainClass domainObject = (SomeDomainClass)         jTransfo.convert(transferObject);OrSomeDomainClass domainObject = new            SomeDomainClass();jTransfo.convert(transferObject, domainObject);OrjTransfo.convertTo(transferObject,       SomeDomainClass.class);
  • 3. Annotations on transfer object@Data@DomainClass("pkg.Person")public class PersonTo {    private String name;    @MappedBy(field = “country”, path = “addr”)    private String addrCountry;    @MappedBy(readOnly = true)    private String gender;    @NotMapped    private String globaalNummer;}
  • 4. Type conversion, lists@MappedBy(typeConverter = "filterToList")private List<FilterTo> filters;@MappedBy(typeConverter = "readOnlyDomain")private LayerTo layer;
  • 5. Type conversion, spring<import resource= "classpath:org/jtransfo/spring/jTransfoContext.xml" /><bean class="org.jtransfo.ReadOnlyDomainTypeConverter" /><bean class="org.jtransfo.ReadOnlyDomainListTypeConverter">    <constructor­arg value="filterToList" />    <constructor­arg value="pkg.FilterTo" />    <property name="sortList" value="true" /></bean>
  • 6. ORM link, Object finder● Automatically build new / linked object ● Find in Hibernate maybe● Always consistent● Use ReadOnlyDomain to either update links only or linked object contents as well
  • 7. www.jtransfo.orghttps://github.com/joachimvda/jtransfo @joachimvda