SlideShare une entreprise Scribd logo
1  sur  45
Télécharger pour lire hors ligne
Life outside WO
by Andrus Adamchik, ObjectStyle LLC
• 1998 - 2003 :WebObjects programmer
• 1998 - present : Java programmer
• 2001 - present : working on Cayenne
• Apache member, open source developer
• Owner of ObjectStyle LLC
About me
Life outside WO
Why Bother?
• WO is no longer a product sold by Apple
• There are lots of good technologies out there
• True open source / freedom
• Effort put in Wonder will have a much higher ROI
What alternative stack would
satisfy a WO developer?
WO Stack
Generic DI-Centric
Stack
Our Stack
Why not JEE?
JEE provides us container,
web app structure and core
HTTP APIs:
Servlets (JSR-315)
JAX-RS - Jersey (aka JSR-311, aka REST)
Stack Parts
• Dependency Injection
• HTML Framework
• REST Framework
• Persistence
Dependency Injection
Dependency Injection
• Frees dependency users from concerns over dependency
initialization, scoping and lookup
• Loose coupling (aka “program to interfaces” style)
• Services as facades to complex third-party frameworks
• Makes services testable
DI Alternatives - Static Methods
public class MyPage {
void setupRender() {
// no DI, use a static utility
String appName = PropertyUtils.getProperty(“app.name”);
...
}
}
public class PropertyUtils {
private static ObjectContext context;
// who and when invokes this?
public static void init(ObjectContext context) {
PropertyUtils.context = context;
}
public static String getProperty(String key) {
return System.getProperty(key) != null ? System.getProperty(key) : getFromDB(key);
}
private static String getFromDB(String key) { .. }
}
DI Alternatives - Self-initializing Singletons
public class MyPage {
void setupRender() {
// no DI, use a static singleton
String appName = PropertyUtils.singleton().getProperty(“app.name”);
...
}
}
public class PropertyUtils {
private static PropertyUtils singleton;
public static PropertyUtils singleton() {
// is this thread-safe? is Cayenne runtime ready by now?
if(singleton == null) {
ObjectContext context = CayenneUtils.getContext();
singleton = new PropertyUtils()
}
return singleton;
}
private ObjectContext context;
public PropertyUtils(ObjectContext context) {
this.context = context;
}
public static String getProperty(String key) {
return System.getProperty(key) != null ? System.getProperty(key) : getFromDB(key);
}
private static String getFromDB(String key) { .. }
...
}
Dependency Injection
public class MyPage {
@Inject
private PropertyService propertyService;
void setupRender() {
String appName = propertyService.getString(“app.name”);
}
}
public class PropertyService {
private ObjectContext context;
public PropertyService(@Inject ObjectContext context) {
this.context = context;
}
public String getProperty(String key) {
return System.getProperty(key) != null ? System.getProperty(key) : getFromDB(key);
}
private static String getFromDB(String key) { .. }
}
Dependency Injection
• Frees dependency users from concerns over dependency
initialization, scoping and lookup
• Loose coupling (aka “program to interfaces” style)
• Services as facades to complex third-party frameworks
• Makes services testable
Dependency Injection
public class MyPage {
@Inject
private IPropertyService propertyService;
void setupRender() {
String appName = propertyService.getString(“app.name”);
}
}
public interface IPropertyService {
public String getProperty(String key);
}
public class DBPropertyService implements PropertyService {
// copy our old PropertyService code here
...
}
public class FilePropertyService implements PropertyService {
public String getProperty(String key) {
return System.getProperty(key) != null ? System.getProperty(key) : getFromFile(key);
}
private static String getFromFile(String key) { .. }
}
Dependency Injection
• Frees dependency users from concerns over dependency
initialization, scoping and lookup
• Loose coupling (aka “program to interfaces” style)
• Services as facades to complex third-party frameworks
• Makes services testable
Dependency Injection
• Frees dependency users from concerns over dependency
initialization, scoping and lookup
• Loose coupling (aka “program to interfaces” style)
• Services as facades to complex third-party frameworks
• Makes services testable
DI Framework Choices
• Spring
• Google Guice
• Apache Tapestry
• CDI
• (Cayenne DI)
DI Framework Choices
• All support annotations
• All are very capable
• Choice is driven by front-end technology (Tapestry for us)
Tapestry DI
• Services assembly in the code (no XML)
• Out of the box injection into T5 pages and components
• Easy integration with Jersey (same services can be injected into
REST resources)
• Supports HttpServletRequest/Response injection
• Supports multiple DI modules
HTML Framework
HTML Framework - Choices
• JSF
• Tapestry (aka “T5” for “Tapestry v.5”)
• Spring MVC
• Wicket, Seam, Click, Grails, many others...
Why Tapestry?
• The most natural choice for a WO developer:
• Page is made of infinitely nestable components
• Components get their values via bindings from parent
• Something like WOComponentContent used to be nearly
impossible with competition
Beyond WO Similarities
• No common superclass of pages and components
• “Static” component hierarchy (WOSwitchComponent-like
functionality works differently)
• Injection into pages and components
• No separation between pages and direct actions (pages can
serve DA-like responses)
Beyond WO Similarities - 2
• AJAX support / zones (some controversy here)
• Template inheritance
• Different and fairly complicated page rendering lifecycle
• Probably more scaleable (better state management facilities)
• Lots of other good stuff and extension points (mixins, blocks,
etc., etc.)
Tapestry - a simple dynamic page
Index.java:
package com.objectstyle.demo.html.pages;
import org.apache.tapestry5.annotations.Persist;
public class Index {
	 @Persist
	 private int clickCounter;
	 public String getText() {
	 	 return "Hi! Clicked " + clickCounter + " time(s)";
	 }
	 public void onActionFromClick() {
	 	 clickCounter++;
	 }
}
Index.tml:
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
<body>
<h1>${text}</h1>
<p><t:actionlink t:id="click">click me</t:actionlink></p>
</body>
</html>
Tapestry - a simple page with a custom component
PageWrapper.tml:
<html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
	 <head><title>${title}</title></head>
	 <body><t:body /></body>
</html>
PageWrapper.java:
package com.objectstyle.demo.html.components;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Property;
public class PageWrapper {
	 @Parameter
	 @Property
	 private String title;
}
Index.tml:
<html t:type="pagewrapper" title="prop:text" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd">
<h1>${text}</h1>
<p><t:actionlink t:id="click">click me</t:actionlink></p>
</html>
REST Framework
REST Framework Has Different
Requirements from HTML One
• Easy mapping of HTTP request parts to Java code
• HTTP method
• URL (path, parameters)
• Session state management is non-essential
• Responses are data structures without presentation elements
REST Framework Has Different
Requirements from HTML One
Possible to build on top of Tapestry/WO/etc.,
but is it a good idea?
REST Framework - Choices
• Fortunately (?) fewer choices than with HTML frameworks
• Most based on JAX-RS spec (JSR-311):
• Jersey, Resteasy, Apache CXF
• No prominent higher-level frameworks yet (I am building a
closed source one at the moment)
JAX-RS (JSR-311)
My favorite JEE spec :)
JAX-RS (JSR-311)
• Exposes POJO classes as web “resources”
• Annotation-based
• Usually deployed as a servlet
• (Like servlet spec) low-level enough to be close to HTTP
protocol
• (Unlike servlet spec) very usable on its own to support many
REST development scenarios without higher abstractions
JAX-RS - a simple resource
HelloResource.java:
@Path("rest")
public class HelloResource {
	 @GET
	 @Produces(MediaType.APPLICATION_JSON)
	 public Object sayHi() {
	 	 return new Model("Hi!");
	 }
}
Model.java:
class Model {
	 private String say;
	 Model(String say) {
	 	 this.say = say;
	 }
	 public String getSay() {
	 	 return say;
	 }
}
JAX-RS provider - Jersey
• A reference implementation of JSR-311
• Support for REST client
• A unit test framework
• Trivial to integrate resource injection with Tapestry DI
• Happily coexists with T5 pages in the same app
Persistence Framework ... we’ll
discuss it later
Migration from WO
What does it take?
• Keep the WO philosophy, but not the WO code
• Write the code from scratch
• Should be easy for new projects
• No 1-click migration for existing projects
• Start by using WO frontend with Cayenne (?)
• CayenneModeler / ERCayenne will import most EOModels
No Direct Replacement for:
• DirectToWeb (likely possible to implement on top of Tapestry)
• DirectToJavaClient (however 3-tier ORM is available, provided by
Cayenne ROP)
WOCommunity Can:
• Create WO-to-T5 template migration tools
• Port Wonder to Cayenne/T5
• Port ERRest to Jersey/Cayenne
• ...
We’ve gone from Objective C to Java
once, so we can do it again...
Q&A
Andrus Adamchik
andrus@objectstyle.com
twitter.com/andrus_a

Contenu connexe

Tendances

CQ5 QueryBuilder - .adaptTo(Berlin) 2011
CQ5 QueryBuilder - .adaptTo(Berlin) 2011CQ5 QueryBuilder - .adaptTo(Berlin) 2011
CQ5 QueryBuilder - .adaptTo(Berlin) 2011Alexander Klimetschek
 
How to get full power from WebApi
How to get full power from WebApiHow to get full power from WebApi
How to get full power from WebApiRaffaele Rialdi
 
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchTesting Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchMats Bryntse
 
Real World Asp.Net WebApi Applications
Real World Asp.Net WebApi ApplicationsReal World Asp.Net WebApi Applications
Real World Asp.Net WebApi ApplicationsEffie Arditi
 
Advancing JavaScript with Libraries (Yahoo Tech Talk)
Advancing JavaScript with Libraries (Yahoo Tech Talk)Advancing JavaScript with Libraries (Yahoo Tech Talk)
Advancing JavaScript with Libraries (Yahoo Tech Talk)jeresig
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiRan Mizrahi
 
Getting Started with jQuery
Getting Started with jQueryGetting Started with jQuery
Getting Started with jQueryAkshay Mathur
 
Drupal8 for Symfony Developers (PHP Day Verona 2017)
Drupal8 for Symfony Developers (PHP Day Verona 2017)Drupal8 for Symfony Developers (PHP Day Verona 2017)
Drupal8 for Symfony Developers (PHP Day Verona 2017)Antonio Peric-Mazar
 
The Many Ways to Test Your React App
The Many Ways to Test Your React AppThe Many Ways to Test Your React App
The Many Ways to Test Your React AppAll Things Open
 
D2W Branding Using jQuery ThemeRoller
D2W Branding Using jQuery ThemeRollerD2W Branding Using jQuery ThemeRoller
D2W Branding Using jQuery ThemeRollerWO Community
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPOscar Merida
 
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...Sencha
 
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
ZZ BC#7.5 asp.net mvc practice  and guideline refresh! ZZ BC#7.5 asp.net mvc practice  and guideline refresh!
ZZ BC#7.5 asp.net mvc practice and guideline refresh! Chalermpon Areepong
 
Intoduction to Play Framework
Intoduction to Play FrameworkIntoduction to Play Framework
Intoduction to Play FrameworkKnoldus Inc.
 
Scaladays 2014 introduction to scalatest selenium dsl
Scaladays 2014   introduction to scalatest selenium dslScaladays 2014   introduction to scalatest selenium dsl
Scaladays 2014 introduction to scalatest selenium dslMatthew Farwell
 
Local storage in Web apps
Local storage in Web appsLocal storage in Web apps
Local storage in Web appsIvano Malavolta
 
Unsafe JAX-RS: Breaking REST API
Unsafe JAX-RS: Breaking REST APIUnsafe JAX-RS: Breaking REST API
Unsafe JAX-RS: Breaking REST APIMikhail Egorov
 
02 beginning code first
02   beginning code first02   beginning code first
02 beginning code firstMaxim Shaptala
 

Tendances (20)

CQ5 QueryBuilder - .adaptTo(Berlin) 2011
CQ5 QueryBuilder - .adaptTo(Berlin) 2011CQ5 QueryBuilder - .adaptTo(Berlin) 2011
CQ5 QueryBuilder - .adaptTo(Berlin) 2011
 
How to get full power from WebApi
How to get full power from WebApiHow to get full power from WebApi
How to get full power from WebApi
 
Testing Ext JS and Sencha Touch
Testing Ext JS and Sencha TouchTesting Ext JS and Sencha Touch
Testing Ext JS and Sencha Touch
 
.Net template solution architecture
.Net template solution architecture.Net template solution architecture
.Net template solution architecture
 
Real World Asp.Net WebApi Applications
Real World Asp.Net WebApi ApplicationsReal World Asp.Net WebApi Applications
Real World Asp.Net WebApi Applications
 
Advancing JavaScript with Libraries (Yahoo Tech Talk)
Advancing JavaScript with Libraries (Yahoo Tech Talk)Advancing JavaScript with Libraries (Yahoo Tech Talk)
Advancing JavaScript with Libraries (Yahoo Tech Talk)
 
Intro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran MizrahiIntro To JavaScript Unit Testing - Ran Mizrahi
Intro To JavaScript Unit Testing - Ran Mizrahi
 
Getting Started with jQuery
Getting Started with jQueryGetting Started with jQuery
Getting Started with jQuery
 
Drupal8 for Symfony Developers (PHP Day Verona 2017)
Drupal8 for Symfony Developers (PHP Day Verona 2017)Drupal8 for Symfony Developers (PHP Day Verona 2017)
Drupal8 for Symfony Developers (PHP Day Verona 2017)
 
The Many Ways to Test Your React App
The Many Ways to Test Your React AppThe Many Ways to Test Your React App
The Many Ways to Test Your React App
 
D2W Branding Using jQuery ThemeRoller
D2W Branding Using jQuery ThemeRollerD2W Branding Using jQuery ThemeRoller
D2W Branding Using jQuery ThemeRoller
 
Staying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHPStaying Sane with Drupal NEPHP
Staying Sane with Drupal NEPHP
 
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
SenchaCon 2016: How to Auto Generate a Back-end in Minutes - Per Minborg, Emi...
 
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
ZZ BC#7.5 asp.net mvc practice  and guideline refresh! ZZ BC#7.5 asp.net mvc practice  and guideline refresh!
ZZ BC#7.5 asp.net mvc practice and guideline refresh!
 
Intoduction to Play Framework
Intoduction to Play FrameworkIntoduction to Play Framework
Intoduction to Play Framework
 
Scaladays 2014 introduction to scalatest selenium dsl
Scaladays 2014   introduction to scalatest selenium dslScaladays 2014   introduction to scalatest selenium dsl
Scaladays 2014 introduction to scalatest selenium dsl
 
Introduction to Monsoon PHP framework
Introduction to Monsoon PHP frameworkIntroduction to Monsoon PHP framework
Introduction to Monsoon PHP framework
 
Local storage in Web apps
Local storage in Web appsLocal storage in Web apps
Local storage in Web apps
 
Unsafe JAX-RS: Breaking REST API
Unsafe JAX-RS: Breaking REST APIUnsafe JAX-RS: Breaking REST API
Unsafe JAX-RS: Breaking REST API
 
02 beginning code first
02   beginning code first02   beginning code first
02 beginning code first
 

En vedette

Reenabling SOAP using ERJaxWS
Reenabling SOAP using ERJaxWSReenabling SOAP using ERJaxWS
Reenabling SOAP using ERJaxWSWO Community
 
Build and deployment
Build and deploymentBuild and deployment
Build and deploymentWO Community
 
Chaining the Beast - Testing Wonder Applications in the Real World
Chaining the Beast - Testing Wonder Applications in the Real WorldChaining the Beast - Testing Wonder Applications in the Real World
Chaining the Beast - Testing Wonder Applications in the Real WorldWO Community
 
Filtering data with D2W
Filtering data with D2W Filtering data with D2W
Filtering data with D2W WO Community
 
Advanced Apache Cayenne
Advanced Apache CayenneAdvanced Apache Cayenne
Advanced Apache CayenneWO Community
 
Migrating existing Projects to Wonder
Migrating existing Projects to WonderMigrating existing Projects to Wonder
Migrating existing Projects to WonderWO Community
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO DevsWO Community
 
Using Nagios to monitor your WO systems
Using Nagios to monitor your WO systemsUsing Nagios to monitor your WO systems
Using Nagios to monitor your WO systemsWO Community
 
iOS for ERREST - alternative version
iOS for ERREST - alternative versioniOS for ERREST - alternative version
iOS for ERREST - alternative versionWO Community
 
Deploying WO on Windows
Deploying WO on WindowsDeploying WO on Windows
Deploying WO on WindowsWO Community
 
"Framework Principal" pattern
"Framework Principal" pattern"Framework Principal" pattern
"Framework Principal" patternWO Community
 

En vedette (15)

Reenabling SOAP using ERJaxWS
Reenabling SOAP using ERJaxWSReenabling SOAP using ERJaxWS
Reenabling SOAP using ERJaxWS
 
WOver
WOverWOver
WOver
 
Build and deployment
Build and deploymentBuild and deployment
Build and deployment
 
Chaining the Beast - Testing Wonder Applications in the Real World
Chaining the Beast - Testing Wonder Applications in the Real WorldChaining the Beast - Testing Wonder Applications in the Real World
Chaining the Beast - Testing Wonder Applications in the Real World
 
Filtering data with D2W
Filtering data with D2W Filtering data with D2W
Filtering data with D2W
 
iOS for ERREST
iOS for ERRESTiOS for ERREST
iOS for ERREST
 
Advanced Apache Cayenne
Advanced Apache CayenneAdvanced Apache Cayenne
Advanced Apache Cayenne
 
Migrating existing Projects to Wonder
Migrating existing Projects to WonderMigrating existing Projects to Wonder
Migrating existing Projects to Wonder
 
Apache Cayenne for WO Devs
Apache Cayenne for WO DevsApache Cayenne for WO Devs
Apache Cayenne for WO Devs
 
Using Nagios to monitor your WO systems
Using Nagios to monitor your WO systemsUsing Nagios to monitor your WO systems
Using Nagios to monitor your WO systems
 
iOS for ERREST - alternative version
iOS for ERREST - alternative versioniOS for ERREST - alternative version
iOS for ERREST - alternative version
 
KAAccessControl
KAAccessControlKAAccessControl
KAAccessControl
 
Deploying WO on Windows
Deploying WO on WindowsDeploying WO on Windows
Deploying WO on Windows
 
High availability
High availabilityHigh availability
High availability
 
"Framework Principal" pattern
"Framework Principal" pattern"Framework Principal" pattern
"Framework Principal" pattern
 

Similaire à Life outside WO

Intro to .NET for Government Developers
Intro to .NET for Government DevelopersIntro to .NET for Government Developers
Intro to .NET for Government DevelopersFrank La Vigne
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to TornadoGavin Roy
 
Angular jS Introduction by Google
Angular jS Introduction by GoogleAngular jS Introduction by Google
Angular jS Introduction by GoogleASG
 
ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015Hossein Zahed
 
Frameworks Galore: A Pragmatic Review
Frameworks Galore: A Pragmatic ReviewFrameworks Galore: A Pragmatic Review
Frameworks Galore: A Pragmatic Reviewnetc2012
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 
JAX-RS Creating RESTFul services
JAX-RS Creating RESTFul servicesJAX-RS Creating RESTFul services
JAX-RS Creating RESTFul servicesLudovic Champenois
 
web2py:Web development like a boss
web2py:Web development like a bossweb2py:Web development like a boss
web2py:Web development like a bossFrancisco Ribeiro
 
JavaEE and RESTful development - WSO2 Colombo Meetup
JavaEE and RESTful development - WSO2 Colombo Meetup JavaEE and RESTful development - WSO2 Colombo Meetup
JavaEE and RESTful development - WSO2 Colombo Meetup Sagara Gunathunga
 
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyRed Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyMark Proctor
 
Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Josh Juneau
 
What’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new StrategyWhat’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new StrategyMohamed Taman
 
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)Daniel Bryant
 
MVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelMVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelAlex Thissen
 
Structured Functional Automated Web Service Testing
Structured Functional Automated Web Service TestingStructured Functional Automated Web Service Testing
Structured Functional Automated Web Service Testingrdekleijn
 
Web Components v1
Web Components v1Web Components v1
Web Components v1Mike Wilcox
 
SOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesSOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesVagif Abilov
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersRob Windsor
 
WebNetConf 2012 - Single Page Apps
WebNetConf 2012 - Single Page AppsWebNetConf 2012 - Single Page Apps
WebNetConf 2012 - Single Page AppsPop Apps
 
Gwt and rpc use 2007 1
Gwt and rpc use 2007 1Gwt and rpc use 2007 1
Gwt and rpc use 2007 1Sam Muhanguzi
 

Similaire à Life outside WO (20)

Intro to .NET for Government Developers
Intro to .NET for Government DevelopersIntro to .NET for Government Developers
Intro to .NET for Government Developers
 
An Introduction to Tornado
An Introduction to TornadoAn Introduction to Tornado
An Introduction to Tornado
 
Angular jS Introduction by Google
Angular jS Introduction by GoogleAngular jS Introduction by Google
Angular jS Introduction by Google
 
ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015ASP.NET MVC 5 - EF 6 - VS2015
ASP.NET MVC 5 - EF 6 - VS2015
 
Frameworks Galore: A Pragmatic Review
Frameworks Galore: A Pragmatic ReviewFrameworks Galore: A Pragmatic Review
Frameworks Galore: A Pragmatic Review
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
JAX-RS Creating RESTFul services
JAX-RS Creating RESTFul servicesJAX-RS Creating RESTFul services
JAX-RS Creating RESTFul services
 
web2py:Web development like a boss
web2py:Web development like a bossweb2py:Web development like a boss
web2py:Web development like a boss
 
JavaEE and RESTful development - WSO2 Colombo Meetup
JavaEE and RESTful development - WSO2 Colombo Meetup JavaEE and RESTful development - WSO2 Colombo Meetup
JavaEE and RESTful development - WSO2 Colombo Meetup
 
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client TechnologyRed Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
Red Hat JBoss BRMS and BPMS Workbench and Rich Client Technology
 
Migrating to Jakarta EE 10
Migrating to Jakarta EE 10Migrating to Jakarta EE 10
Migrating to Jakarta EE 10
 
What’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new StrategyWhat’s new in Java SE, EE, ME, Embedded world & new Strategy
What’s new in Java SE, EE, ME, Embedded world & new Strategy
 
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
MSc Enterprise Systems Development Guest Lecture at UniS (2/12/09)
 
MVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming modelMVC 6 - the new unified Web programming model
MVC 6 - the new unified Web programming model
 
Structured Functional Automated Web Service Testing
Structured Functional Automated Web Service TestingStructured Functional Automated Web Service Testing
Structured Functional Automated Web Service Testing
 
Web Components v1
Web Components v1Web Components v1
Web Components v1
 
SOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class LibrariesSOLID Programming with Portable Class Libraries
SOLID Programming with Portable Class Libraries
 
JavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint DevelopersJavaScript and jQuery for SharePoint Developers
JavaScript and jQuery for SharePoint Developers
 
WebNetConf 2012 - Single Page Apps
WebNetConf 2012 - Single Page AppsWebNetConf 2012 - Single Page Apps
WebNetConf 2012 - Single Page Apps
 
Gwt and rpc use 2007 1
Gwt and rpc use 2007 1Gwt and rpc use 2007 1
Gwt and rpc use 2007 1
 

Plus de WO Community

Localizing your apps for multibyte languages
Localizing your apps for multibyte languagesLocalizing your apps for multibyte languages
Localizing your apps for multibyte languagesWO Community
 
CMS / BLOG and SnoWOman
CMS / BLOG and SnoWOmanCMS / BLOG and SnoWOman
CMS / BLOG and SnoWOmanWO Community
 
Persistent Session Storage
Persistent Session StoragePersistent Session Storage
Persistent Session StorageWO Community
 
WebObjects Optimization
WebObjects OptimizationWebObjects Optimization
WebObjects OptimizationWO Community
 
ERRest: the Basics
ERRest: the BasicsERRest: the Basics
ERRest: the BasicsWO Community
 

Plus de WO Community (11)

Localizing your apps for multibyte languages
Localizing your apps for multibyte languagesLocalizing your apps for multibyte languages
Localizing your apps for multibyte languages
 
WOdka
WOdkaWOdka
WOdka
 
ERGroupware
ERGroupwareERGroupware
ERGroupware
 
CMS / BLOG and SnoWOman
CMS / BLOG and SnoWOmanCMS / BLOG and SnoWOman
CMS / BLOG and SnoWOman
 
Using GIT
Using GITUsing GIT
Using GIT
 
Persistent Session Storage
Persistent Session StoragePersistent Session Storage
Persistent Session Storage
 
Back2 future
Back2 futureBack2 future
Back2 future
 
WebObjects Optimization
WebObjects OptimizationWebObjects Optimization
WebObjects Optimization
 
Dynamic Elements
Dynamic ElementsDynamic Elements
Dynamic Elements
 
Practical ERSync
Practical ERSyncPractical ERSync
Practical ERSync
 
ERRest: the Basics
ERRest: the BasicsERRest: the Basics
ERRest: the Basics
 

Dernier

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 

Dernier (20)

AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 

Life outside WO

  • 1. Life outside WO by Andrus Adamchik, ObjectStyle LLC
  • 2. • 1998 - 2003 :WebObjects programmer • 1998 - present : Java programmer • 2001 - present : working on Cayenne • Apache member, open source developer • Owner of ObjectStyle LLC About me
  • 4. Why Bother? • WO is no longer a product sold by Apple • There are lots of good technologies out there • True open source / freedom • Effort put in Wonder will have a much higher ROI
  • 5. What alternative stack would satisfy a WO developer?
  • 10. JEE provides us container, web app structure and core HTTP APIs: Servlets (JSR-315) JAX-RS - Jersey (aka JSR-311, aka REST)
  • 11. Stack Parts • Dependency Injection • HTML Framework • REST Framework • Persistence
  • 13. Dependency Injection • Frees dependency users from concerns over dependency initialization, scoping and lookup • Loose coupling (aka “program to interfaces” style) • Services as facades to complex third-party frameworks • Makes services testable
  • 14. DI Alternatives - Static Methods public class MyPage { void setupRender() { // no DI, use a static utility String appName = PropertyUtils.getProperty(“app.name”); ... } } public class PropertyUtils { private static ObjectContext context; // who and when invokes this? public static void init(ObjectContext context) { PropertyUtils.context = context; } public static String getProperty(String key) { return System.getProperty(key) != null ? System.getProperty(key) : getFromDB(key); } private static String getFromDB(String key) { .. } }
  • 15. DI Alternatives - Self-initializing Singletons public class MyPage { void setupRender() { // no DI, use a static singleton String appName = PropertyUtils.singleton().getProperty(“app.name”); ... } } public class PropertyUtils { private static PropertyUtils singleton; public static PropertyUtils singleton() { // is this thread-safe? is Cayenne runtime ready by now? if(singleton == null) { ObjectContext context = CayenneUtils.getContext(); singleton = new PropertyUtils() } return singleton; } private ObjectContext context; public PropertyUtils(ObjectContext context) { this.context = context; } public static String getProperty(String key) { return System.getProperty(key) != null ? System.getProperty(key) : getFromDB(key); } private static String getFromDB(String key) { .. } ... }
  • 16. Dependency Injection public class MyPage { @Inject private PropertyService propertyService; void setupRender() { String appName = propertyService.getString(“app.name”); } } public class PropertyService { private ObjectContext context; public PropertyService(@Inject ObjectContext context) { this.context = context; } public String getProperty(String key) { return System.getProperty(key) != null ? System.getProperty(key) : getFromDB(key); } private static String getFromDB(String key) { .. } }
  • 17. Dependency Injection • Frees dependency users from concerns over dependency initialization, scoping and lookup • Loose coupling (aka “program to interfaces” style) • Services as facades to complex third-party frameworks • Makes services testable
  • 18. Dependency Injection public class MyPage { @Inject private IPropertyService propertyService; void setupRender() { String appName = propertyService.getString(“app.name”); } } public interface IPropertyService { public String getProperty(String key); } public class DBPropertyService implements PropertyService { // copy our old PropertyService code here ... } public class FilePropertyService implements PropertyService { public String getProperty(String key) { return System.getProperty(key) != null ? System.getProperty(key) : getFromFile(key); } private static String getFromFile(String key) { .. } }
  • 19. Dependency Injection • Frees dependency users from concerns over dependency initialization, scoping and lookup • Loose coupling (aka “program to interfaces” style) • Services as facades to complex third-party frameworks • Makes services testable
  • 20. Dependency Injection • Frees dependency users from concerns over dependency initialization, scoping and lookup • Loose coupling (aka “program to interfaces” style) • Services as facades to complex third-party frameworks • Makes services testable
  • 21. DI Framework Choices • Spring • Google Guice • Apache Tapestry • CDI • (Cayenne DI)
  • 22. DI Framework Choices • All support annotations • All are very capable • Choice is driven by front-end technology (Tapestry for us)
  • 23. Tapestry DI • Services assembly in the code (no XML) • Out of the box injection into T5 pages and components • Easy integration with Jersey (same services can be injected into REST resources) • Supports HttpServletRequest/Response injection • Supports multiple DI modules
  • 25. HTML Framework - Choices • JSF • Tapestry (aka “T5” for “Tapestry v.5”) • Spring MVC • Wicket, Seam, Click, Grails, many others...
  • 26. Why Tapestry? • The most natural choice for a WO developer: • Page is made of infinitely nestable components • Components get their values via bindings from parent • Something like WOComponentContent used to be nearly impossible with competition
  • 27. Beyond WO Similarities • No common superclass of pages and components • “Static” component hierarchy (WOSwitchComponent-like functionality works differently) • Injection into pages and components • No separation between pages and direct actions (pages can serve DA-like responses)
  • 28. Beyond WO Similarities - 2 • AJAX support / zones (some controversy here) • Template inheritance • Different and fairly complicated page rendering lifecycle • Probably more scaleable (better state management facilities) • Lots of other good stuff and extension points (mixins, blocks, etc., etc.)
  • 29. Tapestry - a simple dynamic page Index.java: package com.objectstyle.demo.html.pages; import org.apache.tapestry5.annotations.Persist; public class Index { @Persist private int clickCounter; public String getText() { return "Hi! Clicked " + clickCounter + " time(s)"; } public void onActionFromClick() { clickCounter++; } } Index.tml: <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"> <body> <h1>${text}</h1> <p><t:actionlink t:id="click">click me</t:actionlink></p> </body> </html>
  • 30. Tapestry - a simple page with a custom component PageWrapper.tml: <html xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"> <head><title>${title}</title></head> <body><t:body /></body> </html> PageWrapper.java: package com.objectstyle.demo.html.components; import org.apache.tapestry5.annotations.Parameter; import org.apache.tapestry5.annotations.Property; public class PageWrapper { @Parameter @Property private String title; } Index.tml: <html t:type="pagewrapper" title="prop:text" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_3.xsd"> <h1>${text}</h1> <p><t:actionlink t:id="click">click me</t:actionlink></p> </html>
  • 32. REST Framework Has Different Requirements from HTML One • Easy mapping of HTTP request parts to Java code • HTTP method • URL (path, parameters) • Session state management is non-essential • Responses are data structures without presentation elements
  • 33. REST Framework Has Different Requirements from HTML One Possible to build on top of Tapestry/WO/etc., but is it a good idea?
  • 34. REST Framework - Choices • Fortunately (?) fewer choices than with HTML frameworks • Most based on JAX-RS spec (JSR-311): • Jersey, Resteasy, Apache CXF • No prominent higher-level frameworks yet (I am building a closed source one at the moment)
  • 36. JAX-RS (JSR-311) • Exposes POJO classes as web “resources” • Annotation-based • Usually deployed as a servlet • (Like servlet spec) low-level enough to be close to HTTP protocol • (Unlike servlet spec) very usable on its own to support many REST development scenarios without higher abstractions
  • 37. JAX-RS - a simple resource HelloResource.java: @Path("rest") public class HelloResource { @GET @Produces(MediaType.APPLICATION_JSON) public Object sayHi() { return new Model("Hi!"); } } Model.java: class Model { private String say; Model(String say) { this.say = say; } public String getSay() { return say; } }
  • 38. JAX-RS provider - Jersey • A reference implementation of JSR-311 • Support for REST client • A unit test framework • Trivial to integrate resource injection with Tapestry DI • Happily coexists with T5 pages in the same app
  • 39. Persistence Framework ... we’ll discuss it later
  • 41. What does it take? • Keep the WO philosophy, but not the WO code • Write the code from scratch • Should be easy for new projects • No 1-click migration for existing projects • Start by using WO frontend with Cayenne (?) • CayenneModeler / ERCayenne will import most EOModels
  • 42. No Direct Replacement for: • DirectToWeb (likely possible to implement on top of Tapestry) • DirectToJavaClient (however 3-tier ORM is available, provided by Cayenne ROP)
  • 43. WOCommunity Can: • Create WO-to-T5 template migration tools • Port Wonder to Cayenne/T5 • Port ERRest to Jersey/Cayenne • ...
  • 44. We’ve gone from Objective C to Java once, so we can do it again...