Show last authors
1 [[image:geda-logo-200.png||style="float:right"]]GeDA was inspired by developer's lazyness (as always). The rationale for its existance was overhead of creating DTO Assemblers in an n-tier application to pass information within domain object to UI through DTO's (Data Transfer Objects). The basic principle of the above application design is to extract the necessary information from the domain objects in the form of DTO's. In reality this involves a tidious get/set method calls that look very much the same for most of the objects. GeDA uses Java5's annotations in order to map DTO's onto paths of the Domain object properties (the reflection method). Thus the annotated DTO's can be examined by a Generic DTO Assembler that will create specific instance of the assembler for the DTO is respect to a Domain object. The assembler is basically a placeholder for so called "data pipes" that allow transferring data from/to domain object's field. But do not take my word for it - try it out yourself.
2
3 = How does it work? =
4
5 1. When coding user of this library uses java annotations or [[DSL>>doc:GeDA - Generic DTO Assembler.Documentation.Core API.DSL API.WebHome]] registry to provide contextual information how DTO maps to an Entity
6 1. If you are following SOLID principles when you code then you would probably need to specify BeanFactory for [[Inversion of Control>>doc:GeDA - Generic DTO Assembler.Topics.IoC with GeDA.WebHome]] and Converter registry for doing tricky conversions between domain and DTO values
7 1. At runtime when a DTO assembler instance is created GeDA uses [[byte code generation>>doc:GeDA - Generic DTO Assembler.Topics.Method Synthesizers.WebHome]] library to generate adapter classes to transfer values between domain object and DTO model. This is to prevent use of java reflection which is quite slow. By default GeDA uses javassist to synthesize those classes but you have a choice of using BCEL or Sun JavaC using [[configurations>>doc:GeDA - Generic DTO Assembler.Topics.Method Synthesizers.WebHome]].
8 1. Each assembler instance is also cleverly cached internally so that creation of assembler instances is brought to a minimum but does not clutter your memory (so no nasty OutOfMemoryException's).
9 1. As a result you have an awesome tool to transfer data between all sorts of java objects.
10 1. Furthermore +GeDA 2.0.3 smoked all rival libraries on performance+ (Orika 1.2 which is supposed to be the fastest there is is twice as slow). Performance tests can be found [[here>>http://microbenchmarks.appspot.com/run/denis.v.pavlov@gmail.com/com.inspiresoftware.lib.dto.geda.benchmark.CaliperBenchmark]]. Version 2.1.x are even better in terms of performance and memory consumption, and version 3.x.x is event better than 2.x.x. See test [[here>>http://microbenchmarks.appspot.com/run/denis.v.pavlov@gmail.com/com.inspiresoftware.lib.dto.geda.benchmark.CaliperBenchmarkGeDA3000Orika141]]
11 1. Version 2.x.x have full Spring v3.x.x support
12 1. Version 3.x.x have full OSGi support
13 1. Lastly is it a feature rich tool that allows to expand, flatten and combine your objects as well as handling complex mapping for collections and maps.
14
15 (% style="color:green" %){{icon name="check"/}} Have a look at our "[[Getting started>>doc:GeDA - Generic DTO Assembler.Getting started.WebHome]]" guide for a quick overview
16
17
18 = Why use it? =
19
20 * Provides flexible mappings for DTO objects
21 * Allows to flatten Entity objects whilst converting them to DTO
22 * Allows to transform values or populate [[derived>>doc:GeDA - Generic DTO Assembler.Topics.DtoVirtualField.WebHome]] properties of your DTO
23 * Saves a lot of coding (and testing) of DTO specific assemblers
24 * Performance! GeDA uses Javassist by default to auto [[generate code>>doc:GeDA - Generic DTO Assembler.Topics.Method Synthesizers.WebHome]] for assemblers (also can use BCEL, SUN javac or pure java Reflection API)
25 * Spring 3 OOTB integration
26 * OSGi OOTB integration
27 * Minimal code contamination - use of GeDA usually means adding some annotations to your DTO bean and 3 extra lines of code in your service layer class
28 * A true TDD library - our code is thoroughly tested using JUnit, Spring Test and Pax Exam, as well as various performance and benchmark tests using Caliper, Jetty and mutli threaded runners.
29
30 Common misconception: GeDA was not build to hydrate ORM classes (such as Hibernate). If you just want to get DTO with simple field values straight out of your DB you are better off with the Object Query Language (OQL) (such as HQL in Hibernate). However, if you are working in application service layer with complex view (as in MVC) then GeDA is just what the doctor ordered!
31
32 = Where can I get this awesomeness for free? =
33
34 [[https:~~/~~/github.com/inspire-software/geda-genericdto>>url:https://github.com/inspire-software/geda-genericdto]]
35
36 GeDA on maven central http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.inspire-software.lib.dto.geda%22
37
38 (% style="color:green" %){{icon name="check"/}} Got stuck? Post your question on GeDA [[Google Groups>>url:https://groups.google.com/d/forum/geda-generic-dto-assembler-discussion-group]]
39
40 {{code language="xml"}}
41 <!-- core module: use can you it on its own if you are not using Spring 3 -->
42 <dependency>
43 <groupId>com.inspire-software.lib.dto.geda</groupId>
44 <artifactId>geda.core</artifactId>
45 <version>3.1.0</version>
46 </dependency>
47
48 <!-- spring integration: spring 3 AOP wrapper for core -->
49 <dependency>
50 <groupId>com.inspire-software.lib.dto.geda</groupId>
51 <artifactId>geda.spring-integration</artifactId>
52 <version>3.1.0</version>
53 </dependency>
54
55 <!-- OSGi GeDA bundle -->
56 <dependency>
57 <groupId>com.inspire-software.lib.dto.geda</groupId>
58 <artifactId>geda.osgi</artifactId>
59 <version>3.1.0</version>
60 <type>bundle</type>
61 </dependency>
62 <dependency>
63 <groupId>org.apache.servicemix.bundles</groupId>
64 <artifactId>org.apache.servicemix.bundles.javassist</artifactId>
65 <version>3.12.1.ga_1</version>
66 <type>bundle</type>
67 </dependency>
68 {{/code}}
69
70 (% style="color:green" %){{icon name="check"/}} To setup mvn dependency please read [[this page>>doc:GeDA - Generic DTO Assembler.Maven.WebHome]]
71
72 = Feedback and notes =
73
74 (% style="color:green" %){{icon name="check"/}} NOTE: If you have some questions please consult [[documentation>>doc:GeDA - Generic DTO Assembler.Documentation.WebHome]] and [[topics>>doc:GeDA - Generic DTO Assembler.Topics.WebHome]] prior sending a request
75
76 All release notes are [here|GeDA:Revisions].
77
78 If you wish to contact us, propose new features or contribute please use our feedback [[form>>http://www.genericdtoassembler.org/#feedback]]
79
80 Recent enhancements may be found [[here>>doc:GeDA - Generic DTO Assembler.Revisions.WebHome]]
81
82 You can report any problems with GeDA to our public [[jira>>http://www.inspire-software.com/jira/browse/GEDA]]
83
GeDA - Generic DTO Assembler © Denys Pavlov 2009 - 2019
v.1.0.0