wednesday, january 25, 12 - jboss · android and the cloud: a perfect fit! aleš justin jboss by...

14
Wednesday, January 25, 12

Upload: others

Post on 30-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Wednesday, January 25, 12 - JBoss · Android and the Cloud: A perfect fit! Aleš Justin JBoss by Red Hat Wednesday, January 25, 12. Agenda • Background of this talk • Project

Wednesday, January 25, 12

Page 2: Wednesday, January 25, 12 - JBoss · Android and the Cloud: A perfect fit! Aleš Justin JBoss by Red Hat Wednesday, January 25, 12. Agenda • Background of this talk • Project

Android and the Cloud: A perfect fit!

Aleš JustinJBoss by Red Hat

Wednesday, January 25, 12

Page 3: Wednesday, January 25, 12 - JBoss · Android and the Cloud: A perfect fit! Aleš Justin JBoss by Red Hat Wednesday, January 25, 12. Agenda • Background of this talk • Project

Agenda

• Background of this talk• Project modularization• Tips and tricks• Even simpler approach to client-server architecture• Q&A

Wednesday, January 25, 12

Page 4: Wednesday, January 25, 12 - JBoss · Android and the Cloud: A perfect fit! Aleš Justin JBoss by Red Hat Wednesday, January 25, 12. Agenda • Background of this talk • Project

About me

•Old school JBoss-ian•Microcontainer co-author•Weld project lead•CapeDwarf founder•Ceylon core developer•OpenShift “guinea pig”

Wednesday, January 25, 12

Page 5: Wednesday, January 25, 12 - JBoss · Android and the Cloud: A perfect fit! Aleš Justin JBoss by Red Hat Wednesday, January 25, 12. Agenda • Background of this talk • Project

Background• Buzzing ...

• Android• prototype application with server-side backend (X)

• Google App Engine• JBossAS7 / OpenShift

• Simple client-to-server communication• JSON• Apache HttpComponents

• Scalable (and portable) server-side• CapeDwarf Green

•Let’s make it even simpler -> LeanEngine

Wednesday, January 25, 12

Page 6: Wednesday, January 25, 12 - JBoss · Android and the Cloud: A perfect fit! Aleš Justin JBoss by Red Hat Wednesday, January 25, 12. Agenda • Background of this talk • Project

Project modularization

Client

Common

GAE

Connect

ValidationAPI

JBossAS

Server

GlassFish

Client Testsuite Simple

ValidationHibernateValidator

Wednesday, January 25, 12

Page 7: Wednesday, January 25, 12 - JBoss · Android and the Cloud: A perfect fit! Aleš Justin JBoss by Red Hat Wednesday, January 25, 12. Agenda • Background of this talk • Project

Project modularization• Common

• Data (DTOs)• Environment abstraction

• Android vs. testsuite vs. server-side• Serialization logic• Data annotations and utils

• Connect• ServerProxy handler factory

• Feed an interface to the factory == Communication API• Primitive, JSON, streaming

Wednesday, January 25, 12

Page 8: Wednesday, January 25, 12 - JBoss · Android and the Cloud: A perfect fit! Aleš Justin JBoss by Red Hat Wednesday, January 25, 12. Agenda • Background of this talk • Project

Project modularization• Validation API

• JSR-303 based• Client vs. server-side impl

• Simple impl on client, full Hibernate Validator on server-side

• Client-testsuite• Mock all app interaction• No need for Android emulator, etc

• Server• Using Java EE; CDI, JPA, JTA, ...• Abstracting away custom API

• CapeDwarf Project

Wednesday, January 25, 12

Page 9: Wednesday, January 25, 12 - JBoss · Android and the Cloud: A perfect fit! Aleš Justin JBoss by Red Hat Wednesday, January 25, 12. Agenda • Background of this talk • Project

Tips and tricks

• (X) more detailed server “tricks” at my JavaEE+GAE talk• Let’s go back to previous slides with more details

• custom fine-grained server-side caching• simple SQLite ORM

• Running the tests• Diff server-side environments == diff configuration

• App servers have bins already there• Web servers need those bins bundled• Bugz ...

Wednesday, January 25, 12

Page 10: Wednesday, January 25, 12 - JBoss · Android and the Cloud: A perfect fit! Aleš Justin JBoss by Red Hat Wednesday, January 25, 12. Agenda • Background of this talk • Project

Even simpler, leaner

•Lean == minimum “investment”•Into infrustructure•Into architecture

•Lean-Engine•Open Source: www.lean-engine.com

Wednesday, January 25, 12

Page 11: Wednesday, January 25, 12 - JBoss · Android and the Cloud: A perfect fit! Aleš Justin JBoss by Red Hat Wednesday, January 25, 12. Agenda • Background of this talk • Project

LeanEngine•Familiar with GAE and its DatastoreService?

•It takes generic Entity•Which takes generic properties

•Client side•Mocks this DatastoreService

•But it does it remote -> via REST / JSON•Google, Facebook, OpenID auth

•Server side -> simply pushes this into DatastoreService•Thin REST layer, delegating to DatastoreService•Zero code needed, simply deploy a prepared .war

•It has a simple datastore UI atm

Wednesday, January 25, 12

Page 12: Wednesday, January 25, 12 - JBoss · Android and the Cloud: A perfect fit! Aleš Justin JBoss by Red Hat Wednesday, January 25, 12. Agenda • Background of this talk • Project

LeanEngine cont.•Use case?

•Really simple sync app•But more complex logic cloud be easily added

•TODOs•Data sharing

•Custom groups vs. Google+ or Facebook friends?•Server-side caching

•Objectify persistence•Stuck on GAE?

•Not really, if you use CapeDwarf Blue ;-)

Wednesday, January 25, 12

Page 13: Wednesday, January 25, 12 - JBoss · Android and the Cloud: A perfect fit! Aleš Justin JBoss by Red Hat Wednesday, January 25, 12. Agenda • Background of this talk • Project

Demo

•CapeDwarf -> TattleTale•LeanEngine

Wednesday, January 25, 12