apache cayenne in a web app

Post on 19-May-2015

504 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

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

Building a CMS

CMS: HTML appTapestry stack

CMS: HTML appInitial schema

HTML App - Goals

• Setup a dev environment

• Setup a Tapestry webapp project

• Create Cayenne mapping

• Build web UI tied to persistent backend

HTML App(demo)

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)

CMS: REST appTapestry / Jersey stack

REST App - Goals

• Create a JAX-RS REST interface within the same application

• Reuse service code between the two frontends

REST App(demo)

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

Q&AAndrus Adamchik

andrus@objectstyle.comtwitter.com/andrus_a

top related