apache cayenne in a web app

13
Apache Cayenne in a Web App (practical demonstration) by Andrus Adamchik, ObjectStyle LLC

Upload: wo-community

Post on 19-May-2015

504 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Apache Cayenne in a Web App

Apache Cayenne in a Web App(practical demonstration)by Andrus Adamchik, ObjectStyle LLC

Page 2: Apache Cayenne in a Web App

Building a CMS

Page 3: Apache Cayenne in a Web App

CMS: HTML appTapestry stack

Page 4: Apache Cayenne in a Web App

CMS: HTML appInitial schema

Page 5: Apache Cayenne in a Web App

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

HTML App(demo)

Page 7: Apache Cayenne in a Web App

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
Page 9: Apache Cayenne in a Web App

CMS: REST appTapestry / Jersey stack

Page 10: Apache Cayenne in a Web App

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

REST App(demo)

Page 12: Apache Cayenne in a Web App

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