+ All Categories
Home > Mobile > Migrating traditional Java EE Applications to mobile

Migrating traditional Java EE Applications to mobile

Date post: 05-Dec-2014
Category:
Upload: serge-pagop
View: 280 times
Download: 0 times
Share this document with a friend
Description:
More than 5 billion people spend an average of 2 hours a day using their mobile phones to bank, shop, reserve hotel rooms, socialize, and more. This challenges companies to migrate their traditional Java EE applications in order to address the demands of mobile and tablet users. In this session, you’ll learn about some of the approaches to migrate a traditional Java EE application to mobile using specifications like RESTful, Context and Dependency Injection (CDI), Enterprise Java Beans (EJB3), and messaging from the Java Platform, Enterprise Edition (Java EE) 6 for server-side services. You’ll also hear about various choices of client-side technologies, which depend on key differentiators between mobile native, mobile web, and mobile hybrid applications.
23
Migrating traditional Java EE applications to mobile Serge Pagop Sr. Channel MW Solution Architect, Red Hat [email protected] Burr Sutter Product Management Director, Red Hat [email protected] 2014-04-16
Transcript
Page 1: Migrating traditional Java EE Applications to mobile

Migrating traditional Java EE applications to mobileSerge PagopSr. Channel MW Solution Architect, Red [email protected]

Burr SutterProduct Management Director, Red [email protected]

2014-04-16

Page 2: Migrating traditional Java EE Applications to mobile

2

Agenda•Migration motivations

•Traditional Java (2) EE technologies usage

•Migration approaches

•Migration of layers

•Modernize to Java EE 6 technologies – Plan for mobile

•REST fits well with the mobile strategy

•Which Mobile application model to choose?

•Mobile Gateway architecture – Mobile + JBoss EAP Runtime

•Demo and Q&A

Page 3: Migrating traditional Java EE Applications to mobile

3

Motivations

•Innovation, integration, cost reduction, modernization

•Market Demand, Time to market, Go-To Market strategy

•Complexity, performance, stability, security

•Vendor lock-in, lack of functionalities, standards compliance

•Multi-tenancy, Ready for the Cloud

•Penetrate New Market Segment

•Increase developer productivity

Page 4: Migrating traditional Java EE Applications to mobile

4

Motivations – MOBILE VS. DESKTOP - Projection

Source: visual.ly

Page 5: Migrating traditional Java EE Applications to mobile

5

Traditional Java (2) EE technologies usageCurrent situation

Page 6: Migrating traditional Java EE Applications to mobile

6

Traditional Java (2) EE technologies usageCurrent situation

•Persistence layer

•Standards are JDBC, CMP, BMP, JPA, JDO

•Non-Standards are Hibernate, iBatis, ...

•Business layer

•Standards are Enterprise JavaBeans 2.x / 3.0

•Non-Standards are Spring Framework, JBoss Seam, Google Guice, ...

•Communication layer

•Standards are JAX-WS, JAX-RPC, RMI

•Non-Standards are legacy Web Service Frameworks

Page 7: Migrating traditional Java EE Applications to mobile

7

Traditional Java (2) EE technologies usage – Cont.Current situation

•Presentation layer

•Standards are JSP+Servlets, JSF 1.2/2.0

•Non-Standards are: Struts, Tapestry, GWT, Wicket, ...

Page 8: Migrating traditional Java EE Applications to mobile

8

Migration approaches

•Complete migration

•Layer-oriented migration

•Module-oriented migration

First Action Item: Migration Assessment

Page 9: Migrating traditional Java EE Applications to mobile

9

Migration assessment

•Looks at all facets of applications and infrastructure

•Helps to understand the risks, savings, and anticipated costs

•Enables stakeholders to scope the engineering time and effort required to migrate applications

● Free open source tool for Java EE migration assessment● Analyzes code and generates report with known issues● Provides an estimate of effort required to make changes● Offers suggestions for replacement code● Highlights vendor specific implementations

10,000 Foot View Reporthttp://www.jboss.org/migration

Page 10: Migrating traditional Java EE Applications to mobile

10

Complete migration – Big Bang style

•Unique new development

•Migration of the entire application in a new system

•High Complexity because of new development

Page 11: Migrating traditional Java EE Applications to mobile

11

Layer-oriented migration

•Based on layer oriented approach: each layer needs a specific handling

•Complexity is defined through

•Multiple migration with associated test and acceptance processes

•Migration of a layer affects overlying layers

Page 12: Migrating traditional Java EE Applications to mobile

12

Module-oriented migration

•Defined as Migration On Demand

•Migration of technical modules will be taken in consideration

•Complexity is defined through

•A mix of technologies of new and old ones

•Delimitation of technical modules

Page 13: Migrating traditional Java EE Applications to mobile

13

Persistence layer migration

Current-Situation Future-SituationSQL/JDBC Data Access JPA 2.0 Challenges● SQL Queries● DAO / Repository Pattern● Providing Value Objects

● Domain model introduction with relationship● Detached entity objects handling● Adaption of entity objects with unique identity

EJB 2.x Data Access JPA 2.0 Challenges● CMP 2.x - Entity classes and XML descriptors● BMP 2.x - CRUD callback methods

● Domain model introduction with relationship● Detached entity objects handling● Adaption of entity objects with unique identity● Data Access Objects introduction

Hibernate Data Access JPA 2.0 Challenges● O/R Mapping via XML● Using Hibernate APIs

● No challenges (Hibernate is JPA provider in JBoss EAP)● May be some challenges with proprietary Hibernate features

JDO Data Access JPA 2.0 Challenges● Domain model approach similar to JPA (based on annotation or configuration)

● JDO and JPA have similarities

Page 14: Migrating traditional Java EE Applications to mobile

14

Business layer migrationCurrent-Situation Future-SituationEJB 2.x components EJB 3.1 Challenges● Stateless and Stateful Session Beans● EJB 2.x Pattern and communication

● No challenges● Eliminate J2EE Pattern● Eliminate proprietary infrastructure code

EJB 2.x components CDI 1.0 Challenges● Stateless and Stateful Session Beans● EJB 2.x Pattern and communication

● No challenges● Eliminate J2EE Pattern● Eliminate proprietary infrastructure code

Spring – lightweight DI Framework CDI 1.0 Challenges● Based on XML or annotation● Strong integration support (JDBC template, Tx template, JMS template, Mail template)

● Supports other annotations (@Resource, @Inject)

● No challenges● May be some challenges with Spring Add-On● Different semantics in the field of scopes

Page 15: Migrating traditional Java EE Applications to mobile

15

Communication layer migration

Future-Situation – Introduction of a new communication interface JAX-RS - Challenges●New fresh start ●Provide distinct URI for each resource you wish to expose●Expose REST services by injecting EJBs into JAX-RS annotated POJOs ●Use nouns in the URIs●Use links in your responses●Make service stateless●Define what actions should be able to perform on each resource●Map the actions to an appropriate HTTP verbs (@DELETE, @GET, @POST, @PUT, @HEAD)

●Use JSON via JAXB as interchange data format

Page 16: Migrating traditional Java EE Applications to mobile

16

Presentation layer migration

Standard like JSP with Servlet or JSF 2.0/2.1 and non-standard web frameworks like Struts, Tapestry, GWT, … do not have a migration path in a mobile strategy

Client side needs a clean / fresh start

Mobile-First strategycreating pages, UI components that address the constraints of mobile, then progressively enhances the experience to other screen spaces, features, and more

Page 17: Migrating traditional Java EE Applications to mobile

17

Modernize to Java EE 6 technologiesFuture situation to enable mobile capabilities

Page 18: Migrating traditional Java EE Applications to mobile

18

REST fits well with mobile strategy

•REST is flexible and adequate for Client-Server communication

•Communication happens over HTTP using REST styles

•JSON over HTTP/HTTPs should be used for data-interchange

•Stateless, Cacheable, Lightweight, Scalable

•Using HTTP verbs (DELETE, GET, POST, PUT)

•Using Web technologies and security standards

•Fully supported in JBoss EAP (Java EE 6 compliant environment) by a JAX-RS implementation (RESTEasy)

Page 19: Migrating traditional Java EE Applications to mobile

19

REST fits well with mobile strategySecuring endpoints - Possibilities

•JBoss EAP 6.2 – Basic Auth

•RealmUsersRoles with *-users.properties and *-roles.properties files

•Database login module - users and roles from a database system

•LDAP login module – users and roles from a LDAP server

•JBoss EAP 6.3 – PicketLink

• Identity Management (IDM)

Page 20: Migrating traditional Java EE Applications to mobile

Which Mobile application model to choose?

Mobile Web

<html><body><div id=”name”/><script src=”x.js”/></body></html>

Native Shell Native App

Native Code

Apple apple appleAndroid androidWindows windowsIOS ios iosJaveObjectve c

<html><body><div id=”name”/><script src=”x.js”/></body></html>

HTML5HTML5

Device Browser Apache Cordova Objective-C / Android JavaPros:

Instant DeploymentReuse of Web Talents

No App Stores

Cons:Limited Device Features

Limited Offline CapabilitiesNo Push

No App Stores

Pros:Cross-Platform

Native Device FeaturesPush

App Stores

Cons:HTML/JS-based UI

Non-native look & feelApp Stores

Pros:Limitless capability

Cons:Unique Codebases

Unique skill-setsAddressing multiple screen dimensions

App Stores

20

Page 21: Migrating traditional Java EE Applications to mobile

Internet

DBDB

JAX-RSJAX-RS

UnifiedPush

Server

LDAPLDAP

Fuse or

FSW

Fuse or

FSW

Firewall

REST

APNS

GCMpush

notification

InternalSystem AInternal

System A

InternalSystem BInternal

System B

SalesForceSalesForce

SAPSAP

JBoss EnterpriseApplication

Platform

DBDB

MSSQLMSSQL

DB/2DB/2

OracleOracle

Mobile Gateway architectureMobile + JBoss EAP Server Runtime

21

Page 22: Migrating traditional Java EE Applications to mobile

22

Demo Time!

Page 23: Migrating traditional Java EE Applications to mobile

Questions?

Serge PagopEmail: [email protected]

Burr SutterEmail: [email protected]


Recommended