Apache Cayenne in a Web App
-
Upload
wo-community -
Category
Technology
-
view
504 -
download
0
Transcript of Apache Cayenne in a Web App
![Page 1: Apache Cayenne in a Web App](https://reader033.fdocuments.in/reader033/viewer/2022052619/555a6a49d8b42a972b8b4ae2/html5/thumbnails/1.jpg)
Apache Cayenne in a Web App(practical demonstration)by Andrus Adamchik, ObjectStyle LLC
![Page 2: Apache Cayenne in a Web App](https://reader033.fdocuments.in/reader033/viewer/2022052619/555a6a49d8b42a972b8b4ae2/html5/thumbnails/2.jpg)
Building a CMS
![Page 3: Apache Cayenne in a Web App](https://reader033.fdocuments.in/reader033/viewer/2022052619/555a6a49d8b42a972b8b4ae2/html5/thumbnails/3.jpg)
CMS: HTML appTapestry stack
![Page 4: Apache Cayenne in a Web App](https://reader033.fdocuments.in/reader033/viewer/2022052619/555a6a49d8b42a972b8b4ae2/html5/thumbnails/4.jpg)
CMS: HTML appInitial schema
![Page 5: Apache Cayenne in a Web App](https://reader033.fdocuments.in/reader033/viewer/2022052619/555a6a49d8b42a972b8b4ae2/html5/thumbnails/5.jpg)
HTML App - Goals
• Setup a dev environment
• Setup a Tapestry webapp project
• Create Cayenne mapping
• Build web UI tied to persistent backend
![Page 6: Apache Cayenne in a Web App](https://reader033.fdocuments.in/reader033/viewer/2022052619/555a6a49d8b42a972b8b4ae2/html5/thumbnails/6.jpg)
HTML App(demo)
![Page 7: Apache Cayenne in a Web App](https://reader033.fdocuments.in/reader033/viewer/2022052619/555a6a49d8b42a972b8b4ae2/html5/thumbnails/7.jpg)
HTML App - Takeaway
• Vagrant is a helpful tool to maintain the dev env
• Cayenne works ;)
• Between CayenneModeler and Maven we can quickly make ORM model changes and synchronize them both ways - to DB and Java
• Tapestry is a decent component web framework that also provides an easy to use DI
• Organizing backend into injectable services encapsulates third-party sub-systems (Cayenne) and our own contextual logic (determining site for the current request)
![Page 8: Apache Cayenne in a Web App](https://reader033.fdocuments.in/reader033/viewer/2022052619/555a6a49d8b42a972b8b4ae2/html5/thumbnails/8.jpg)
![Page 9: Apache Cayenne in a Web App](https://reader033.fdocuments.in/reader033/viewer/2022052619/555a6a49d8b42a972b8b4ae2/html5/thumbnails/9.jpg)
CMS: REST appTapestry / Jersey stack
![Page 10: Apache Cayenne in a Web App](https://reader033.fdocuments.in/reader033/viewer/2022052619/555a6a49d8b42a972b8b4ae2/html5/thumbnails/10.jpg)
REST App - Goals
• Create a JAX-RS REST interface within the same application
• Reuse service code between the two frontends
![Page 11: Apache Cayenne in a Web App](https://reader033.fdocuments.in/reader033/viewer/2022052619/555a6a49d8b42a972b8b4ae2/html5/thumbnails/11.jpg)
REST App(demo)
![Page 12: Apache Cayenne in a Web App](https://reader033.fdocuments.in/reader033/viewer/2022052619/555a6a49d8b42a972b8b4ae2/html5/thumbnails/12.jpg)
REST App - Takeaway
• Jersey REST apps can coexist with Tapestry
• Tapestry services can be injected into REST resources the same way they are injected to pages (business logic reuse)
• JAX-RS specification is high-level enough to be useful as is
• Serialization is pretty basic