Real World SOA. Sean A Corfield CTO, Scazu Inc.



Similar documents
Adobe ColdFusion 11 Enterprise Edition

Enterprise Access Control Patterns For REST and Web APIs

ebay : How is it a hit

Accessing Data with ADOBE FLEX 4.6

Jitterbit Technical Overview : Microsoft Dynamics CRM

Reference Model for Cloud Applications CONSIDERATIONS FOR SW VENDORS BUILDING A SAAS SOLUTION

API Management Buyers Guide. White Paper

The HTTP Plug-in. Table of contents

Contents. Client-server and multi-tier architectures. The Java 2 Enterprise Edition (J2EE) platform

ADOBE AIR. Working with Data in AIR. David Tucker

Beyond The Web Drupal Meets The Desktop (And Mobile) Justin Miller Code Sorcery Workshop, LLC

Chapter 1: Web Services Testing and soapui

soapui Product Comparison

White paper. Planning for SaaS Integration

Deepak Patil (Technical Director) iasys Technologies Pvt. Ltd.

Creating federated authorisation

MS 20487A Developing Windows Azure and Web Services

Introducing Apache Pivot. Greg Brown, Todd Volkert 6/10/2010

FUSE-ESB4 An open-source OSGi based platform for EAI and SOA

ColdFusion 8. Performance Tuning, Multi-Instance Management and Clustering. Sven Ramuschkat MAX 2008 Milan

How your business can successfully monetize API enablement. An illustrative case study

TECHNOLOGY GUIDE THREE. Emerging Types of Enterprise Computing

EVALUATION ONLY. WA2088 WebSphere Application Server 8.5 Administration on Windows. Student Labs. Web Age Solutions Inc.

Onegini Token server / Web API Platform

Oracle WebLogic Server 11g Administration

Authentication and Single Sign On

Java EE Web Development Course Program

Secure Identity Propagation Using WS- Trust, SAML2, and WS-Security 12 Apr 2011 IBM Impact

BDD FOR AUTOMATING WEB APPLICATION TESTING. Stephen de Vries

Apigee Gateway Specifications

Web Application Development for the SOA Age Thinking in XML

Inside the Digital Commerce Engine. The architecture and deployment of the Elastic Path Digital Commerce Engine

Mobile Trillium Engine

SoapUI NG Pro and Ready! API Platform Two-Day Training Course Syllabus

CHAPTER 1 - JAVA EE OVERVIEW FOR ADMINISTRATORS

Mobile development with Apache OFBiz. Ean Schuessler, Brainfood

Statement and Confirmation of Own Work

Web-Application Security

SaaS-Based Employee Benefits Enrollment System

API Architecture. for the Data Interoperability at OSU initiative

Getting started with API testing

Single Sign On for UNICORE command line clients

SOA REFERENCE ARCHITECTURE: WEB TIER

Flash and Python. Dynamic Object oriented Rapid development. Flash and Python. Dave Thompson

multiple placeholders bound to one definition, 158 page approval not match author/editor rights, 157 problems with, 156 troubleshooting,

Improve application performance and scalability with Adobe ColdFusion 9

Designing RESTful Web Applications

THE NEW DIGITAL EXPERIENCE

IBM WebSphere Application Server Family

Alice. Software as a Service(SaaS) Delivery Platform. innovation is simplicity

Eclipse Open Healthcare Framework

Adobe Systems Incorporated

An Oracle White Paper November Oracle Primavera P6 EPPM Integrations with Web Services and Events

Business Process Execution Language for Web Services

Sentinet for BizTalk Server SENTINET

Using the VMRC Plug-In: Startup, Invoking Methods, and Shutdown on page 4

Service Virtualization: Managing Change in a Service-Oriented Architecture

Beyond ESB Architecture with APIs

Drupal CMS for marketing sites

Adobe ColdFusion (2016 release) Enterprise Edition

3 Techniques for Database Scalability with Hibernate. Geert Bevin - SpringOne 2009

Agile Web Service and REST Service Testing with soapui

Jitterbit Technical Overview : Microsoft Dynamics AX

Customer Bank Account Management System Technical Specification Document

Jitterbit Technical Overview : Salesforce

Office of Court Administration Automated Registry (AR) Interface Design Document for DSHS - Clinical Management for Behavioral Health Services (CMBHS)

Middleware- Driven Mobile Applications

Enterprise Data Integration for Microsoft Dynamics CRM

Automating Rich Internet Application Development for Enterprise Web 2.0 and SOA

SOACertifiedProfessional.Braindumps.S90-03A.v by.JANET.100q. Exam Code: S90-03A. Exam Name: SOA Design & Architecture

Adobe ColdFusion Builder

HP Project and Portfolio Management Center

Who are We Specialized. Recognized. Preferred. The right partner makes all the difference.

Enterprise Application Development In Java with AJAX and ORM

Sonatype CLM for Maven. Sonatype CLM for Maven

Best Practices: Extending Enterprise Applications to Mobile Devices

ios Cloud Development FOR Neal Goldstein WILEY John Wiley & Sons, Inc.

Mobile App Management:

This module provides an overview of service and cloud technologies using the Microsoft.NET Framework and the Windows Azure cloud.

AquaLogic Service Bus

Web Service Facade for PHP5. Andreas Meyer, Sebastian Böttner, Stefan Marr

Base One's Rich Client Architecture

Team 23 Design Document. Customer Loyalty Program for Small Businesses

Introducing the Adobe Digital Enterprise Platform

Code best practices and performance optimization. Alf Nilsson Lead System Developer & EMVP

OVERVIEW OF TYPICAL WINDOWS SERVER ROLES

An Oracle White Paper Dec Oracle Access Management Security Token Service

Is Drupal secure? A high-level perspective on web vulnerabilities, Drupal s solutions, and how to maintain site security

WHITEPAPER. Nessus Exploit Integration

ActiveVOS Server Architecture. March 2009

This training is targeted at System Administrators and developers wanting to understand more about administering a WebLogic instance.

Chapter 3. Database Environment - Objectives. Multi-user DBMS Architectures. Teleprocessing. File-Server

Transcription:

Real World SOA Sean A Corfield CTO, Scazu Inc.

What is this about? SOA = Service-Oriented Architecture Expose common business entities and operations to multiple clients across the enterprise Adobe Hosted Services Stanza project Created services for Adobe Acrobat Connect, Adobe Document Center and Kuler Lessons learned, what works, what doesn't If I could do it all again... 2

Caveat! This is a code-free presentation Well, almost code-free... I no longer work for Adobe I no longer have access to the code I cannot show you code I don't have access to 3

Who am I? Freelance Consultant CTO, Scazu Inc. Previously Manager, Hosted Services, Adobe Senior Architect, Macromedia Blogger An Architect's View since 2002 ColdFusion developer since 2001 Web Developer since 1997 4

What is SOA? SOA = Service-Oriented Architecture More than just Services... Data Dictionary Service Directory SaaS 5

Why SOA? Based upon current trends, IDC predicts a compound growth rate of 20% per annum for SaaS, set against the overall software market, which is only growing at around 6% per annum. This leaves IDC in no doubt that there is a fundamental shift toward SaaS as a delivery mechanism, and its use within the notion of Web 2.0, and the convergence of SOA, Web 2.0, and SaaS. 2007 IDC report on Software as a Service 6

SaaS and SOA Software-as-a-Service SOA Subscription based (or free) online system Supplements or replaces desktop / enterprise s/w Often exposes an API for 3 rd party applications A way to structure and build systems that naturally exposes those APIs Building blocks for your software Building blocks for 3 rd party software 7

SOA Applications Just like regular applications except that Model is combination of: Local Code Remote Code Separation of concerns / N-tiers Typically MVC or MVP (Model-View-Presenter) Rely on a variety of web service technologies Typically use a ServiceLocator of some sort 8

Sounds like regular MVC/MVP? View talks to... Controller/Presenter talks to... (Service layer talks to...) (Business) Model layer talks to... Data (Persistence) / System layers 9

Typical SOA Application 10

It's all about the model Not going to cover consumption of services One or more services in front of your model Lots of objects hidden / managed by a facade Data storage for those objects 11

SOA and ColdFusion ColdFusion is a great choice for SOA As a producer of services As a consumer of services Web Services SOAP REST JSON (native in Scorpio!) Flex / Flash Remoting 12

How SOA is different Client-Server by definition Clients are varied (and can be dumb ) Authentication and sessions Data formats Published API definitions Error handling Performance and scalability 13

Session Management (I) Remote clients often have no sense of session Often can't / don't handle cookies at all Don't rely on session, cookie or client scope application and server scope are OK Turn session scope off to save memory! <cfset this.sessionmanagement = false /> 14

Session Management (II) Simplest solution is token passing authenticate() methods returns token Subsequent calls pass token back Manage the tokens in the database Subsequent calls may come to another server! Schedule a task to clean up old tokens Or use a self-validating token (not as secure) Two-way encrypted containing timestamp, ID etc 15

Call / Return Formats Consider client technology Query is native to ColdFusion Untyped struct does not always map well WDDX can be a pain for some clients Simple data types are good Typed struct i.e., value object CFC is good XML is good for most clients too JSON is becoming popular 16

Typed struct / CFC <cfcomponent> <cfproperty name= firstname type= string /> <cfproperty name= lastname type= string />... <cfset this.firstname = /> <cfset this.lastname = />... </cfcomponent> 17

Value Objects Pass simple value objects back and forth Typed struct works well for SOAP and AMF For every {vobject}.cfc, have {vobject}.as Can work for REST too we chose Spring-like XML definitions <bean class= dotted.path.to.type > <property name= foo ><value>bar</value></property> </bean> 18

REST Calling Format REST Adapter (open source, available from my blog) wraps remote CFC API in simple XML POST XML packet <path.to.cfc operation= method > <arg1name><value>42</value></arg1name> <arg2name><list>...</list></arg2name> </path.to.cfc> 19

Remote Facade Might be more than just access= remote Your service layer / model API is not always a great API for clients of your service Flex API and Web Service API may differ too We hand-crafted all our remote APIs Allows you to publish an API but decouple your underlying service / model APIs from that 20

Technology may drive API SOAP, REST, JSON, AMF May (will!) require different API designs Multiple remote facades with different APIs Underlying model remains the same CFMX makes it easy to expose a single CFC as all of SOAP, JSON (Scorpio), AMF That does not mean you should! 21

APIs, Clients and Versions Lots of API clients different assumptions Applications out there that depend on your services working in a particular manner Unit Testing and regression testing is important! Evolving API cannot break existing clients Need strategy to create / manage versions of APIs 22

Exceptions (I) Exceptions often make no sense to clients of your services! 500 error for REST AxisFault for SOAP fault handler in Flash/Flex Better to return an object containing: Success / failure indicator If success, the result If failure, details about the failure 23

Exceptions (II) How you return success / result may depend on the client technology REST XML with 0 or 1 result and 0 or 1 fault data AMF boolean with Object for either result or fault JSON similar approach SOAP return extended result object that also contains the success flag and optional fault data 24

REST Exceptions <fault> <type>authentication_failure.invalid_password</type> <message>invalid password</message> <detail>the password you provided was incorrect</detail> </fault> 25

Clustering and Caching Caching is great for performance Each member of a cluster has its own cache Need to keep caches in sync or not cache Web service to refresh cache elements Considered moving to JMS to notify instances of cache content changes This a hard problem to solve! 26

Tools / Frameworks ColdSpring ORM Transfer Reactor, objectbreeze etc Testing cfcunit ab, httperf, jmeter 27

ColdSpring Manages all the service-like CFCs Each remote web service facade has one or more corresponding ColdSpring-managed model CFCs Manages all configuration data Manages Transfer factory 28

Directory Structure (I) /Application.cfc /svca /facade.cfc /svcb /facade.cfc /svcc /facade.cfc 29

Directory Structure (II) /config /coldspring.xml /svca /coldspring.xml /svcb /model /coldspring.xml /svcamanager.cfc /svcbmanager.cfc /svccmanager.cfc 30

Application.cfc <cffunction name= onapplicationstart > <cfset var cs = createobject( component, coldspring.beans.defaultxmlbeanfactory ).init() /> <cfset cs.loadbeans( expandpath( /config/coldspring.xml ) ) /> <cfset application.cs = cs /> </cffunction> 31

coldspring.xml (I) <beans> <bean id= serverconfiguration...>...</bean> <bean id= transferconfiguration...>...</bean> <bean id= transferfactory...>...</bean> <import resource= /config/svca/coldspring.xml /> <import resource= /config/svcb/coldspring.xml /> <import resource= /config/svcc/coldspring.xml />... </beans> 32

coldspring.xml (II) <beans> <bean id= svca class= /model/svcamanager.cfc>... </bean>... </beans> 33

Simple remote facade method <cffunction name= performaction...>... map arguments... <cfset result = application.cs.getbean( svca ).dosomething(somearguments) />... map result... <cfreturn result /> </cffunction> 34

Transfer Injected into model by ColdSpring Manages (nearly) all persistence and queries TQL makes all possible, not just nearly Caching is judiciously used Cache currency Balance update frequency vs read frequency Discard dirty objects across the cluster transfer.discardbyclassandkey(classname,key) 35

cfcunit Write an extensive suite of tests For low-level model components For the remote facades Use mocks to provide canned responses Automate your testing Use the cfcunit ant task and Eclipse's builder Use the new CFUnit plugin and my cfcunit facade Use TestSuites to aggregate TestCases Make sure you have AllTests for regressions! 36

AllTests.cfc <cffunction name="suite" returntype="org.cfcunit.framework.test" access="public" output="false"> <cfset var suite = createobject("component", "org.cfcunit.framework.testsuite").init("svca")> <cfset suite.addtest( createobject("component", "basicsuite").suite() )> <cfset suite.addtestsuite( createobject("component", "extratest") )> <cfreturn suite/> </cffunction> 37

What went well? Unit testing and regression testing cfcunit, ant Managing CFCs and persistence ColdSpring, Transfer We didn't do anything complex with Transfer tho' Automated builds CruiseControl 38

What wasn't so good? Value object structure Matched to legacy internal system Should have designed new model from scratch Services were too granular Multiple endpoints for similar services We probably didn't write enough unit tests :) 39

Resources ColdSpring - http://coldspringframework.org Transfer - http://compoundtheory.com/transfer An Architect's View - http://corfield.org REST Adapter 40

Questions? Sean A Corfield sean@corfield.org http://corfield.org 41