SlideShare uma empresa Scribd logo
1 de 39
Generated REST Gateways for
Mobile Applications

Wolfgang Frank
arconsis IT-Solutions GmbH
May, 3rd 2010
Who we are?

        arconsis IT-Solutions GmbH from Karlsruhe,
         Germany
             agile- & lean software development
             software architecture
             solutions based on JBoss middleware
             mobile solutions leveraging MDSD


        RedHat/JBoss Advanced SI Partner
2                            arconsis IT-Solutions GmbH
We want to …

        Create data-driven mobile apps
        Integrate with enterprise

    This should be …
           simple
           fast
           multi-platform (apps + integration)

3                        arconsis IT-Solutions GmbH
How we do it …

    „ The talk will show how the usage of a Domain
     Specific Language (DSL) approach could help
     to simplify the RESTful integration of mobile
     applications (like on the iPhone or Android)
     with JBoss Middleware. The talk will sketch
     out the main concepts and provide a live demo
     for a solution based on a fully open source
     stack, composed of JBoss- as well as Eclipse
     technology.“

4                    arconsis IT-Solutions GmbH
How we do it …

    „ The talk will show how the usage of a Domain
     Specific Language (DSL) approach could help
     to simplify the RESTful integration of mobile
     applications (like on the iPhone or Android)
     with JBoss Middleware. The talk will sketch
     out the main concepts and provide a live demo
     for a solution based on a fully open source
     stack, composed of JBoss- as well as Eclipse
     technology.“

5                    arconsis IT-Solutions GmbH
Take a look

        What do I mean with simple and fast?
        A quick demo …




6                         arconsis IT-Solutions GmbH
A Mobile Gateway architecture example

                                                  JBoss AS
      iPhone                                                  Other Applications
                                                              (e.g. CRM, ERP, …)


                     Mobile                      JBoss ESB
     Android      REST Gateway                                   Open Services
                   on JBoss AS                                (e.g. Google, Yahoo,
                                                                    Amazon,…)


    Blackberry
                                                  JBoss DS    Internal Services
                                                  HornetQ        (e.g. SOA,
                                                                  Database)
                 Should be
                 easy to scale
                 out!


7                                arconsis IT-Solutions GmbH
Where we’re heading …

                   Basics about MDSD +
                    Domain Specific Languages
                   RESTful services + JBoss RestEasy
                   The iPhonical project
                         Data-driven Apps
                   A Mobile Gateway architecture
                   Putting it all together (demo)

8                    arconsis IT-Solutions GmbH
Basics about MDSD + Domain Specific Languages




9                   arconsis IT-Solutions GmbH
MDSD benefits


     Separation of technical                      •    Automation with generation
      aspects and business aspects                      •    Reduced costs, raised productivity
           Manage technological change            •    Improved software-quality
           Concepts more stable than                   •    Reduced maintenance costs
            technology ==> safer invest            •    Better reusability
                                                        •    Reduced development costs

     No silver bullet!                            •    Manage high complexity
                                                        •    Reduced development costs,
           Higher effort for spec                           independence from 3rd
           Effort to write generator              •    Better communication IT & Biz
           100% generation not always
            feasible

10                              arconsis IT-Solutions GmbH
Domain Specific Language

         A DSL is a formal, processable language targeting at
          a specific viewpoint or aspect of a software system
         It’s semantics, flexibility and notation is designed in
          order to support working with that viewpoint as good
          as possible

""Open Source Eclipse Frameworks (EMP):
              Xtext: Define grammar + create parser + editor
              Xpand, Xtend: Template language for model transformation

11                                 arconsis IT-Solutions GmbH
REST over HTTP …

     … is an architectural style that uses HTTP as protocol and URIs
      as identification mechanism
     … leverages proven web-technologies
     .. helps loose coupling (uniform interface)
     … achieves interoperability (HTTP, URIs, XML/JSON, HTML, …)
     … has only one interface (dataformat needs to be known)
     … is performant and scalable (nearly unlimited)
           no session + caching  highly distributable


12                             arconsis IT-Solutions GmbH
                                                            REST = Representational State Transfer: Roy Fielding 2000
Basic principles of REST

     All resources have a unique identifier
     Usage of links and hypermedia
     Standardized methods
     Support different representations
     Stateless communication

        Wikipedia: „Unlike SOAP-based web services, there is no "official" standard
      for RESTful web service. This is because REST is an architecture, unlike SOAP,
     which is a protocol. Even though REST is not a standard, a RESTful implementation
             such as the Web can use standards like HTTP, URL, XML, PNG, etc.“

13                                  arconsis IT-Solutions GmbH
Unique identifier for resources

 Use URIs for all resources worth it (values + sets)
 Examples:
     http://example.com/customers/1234

      http://example.com/orders/2008/10/776654

      http://example.com/products

      http://example.com/processes/salary-increase-234"


      Careful: “It does not mean that every database key
      " " " and entity should be exposed as a resource!”


14                      arconsis IT-Solutions GmbH
Links and hypermedia

         “Hypermedia as the engine of application state”
 Example:
     <order href=‘http://example.org/orders/4711’>

      " "<amount>69</amount>

      " "<product ref=‘http://example.org/products/0815’ />

      " "<customer ref=‘http://example.org/customers/4711’ />

      " "<product ref=‘http://example.org/products/0815’ />

      " "<link rel= ‘cancel’ ref=‘./cancellations’ />

      </order>


     Links can span different systems
     Control allowed workflow (e.g. cancellation currently allowed)
15                          arconsis IT-Solutions GmbH
Standardized methods

     Every resource supports the same interface
     HTTP verbs
           GET, PUT, POST, DELETE, HEAD and OPTIONS"
           “Guaranteed” behaviour, defined in HTTP specification
     Idempotent; safe; cacheable + repeatable
           GET/PUT/DELETE (get, modify/create, remove)
     Unsafe; can create a resource or can do anything
           POST"

16                           arconsis IT-Solutions GmbH
                                             Idempotent = Free of side effects. “You can safely repeat the request anytime”
WebService + RPC vs. REST
                    Data types                     •  Different approaches can
                                                      be mapped to each other!


                  Service Design



     Operations                    Instances


"Every app understanding HTTP-protocol can use your application
" allows for generic clients (e.g. curl, wget, proxy-server,
"   Google- or Yahoo services, MSN, ...)

17                                      arconsis IT-Solutions GmbH
Resources and representations

     Content negotiation in HTTP:
        ""GET /customers/123 HTTP/1.1

        "HOST: example.org

        "Accept: application/vnd.mycompany.customer+xml"
        Result could be company internal XML format
        ""GET /customers/123 HTTP/1.1

        "HOST: example.org

        "Accept: text/x-vcard"
        Result could be customer address in vCard format
     So many data formats and standards available to use
      instead to re-invent!
18                          arconsis IT-Solutions GmbH
Stateless communication "
     “Stateless” does not mean no server-side state but:
           “State” is kept in client or transformed in resource-state
            on server-side
           No transient, client-specific state for longer than one
            request on server-side
           E.g. “shopping cart” as resource  save bookmark,
            forward per email
     Why?
           Scalability
           Coupling to clients (subsequent requests can be serverd by
            different server nodes)
19                              arconsis IT-Solutions GmbH
JSR-311 JAX-RS with JBoss RESTEasy

     RESTful WebServices implementation for Java to be
      included within Java EE 6
     Fully certified JAX-RS implementation




                           Comes with jboss-eap-5.0 download!


20                      arconsis IT-Solutions GmbH
JBoss RESTEasy
  Portable to any app-server/Tomcat that                 JAXB marshalling into XML, JSON, Jackson,
   runs on JDK 5 or higher                                 Fastinfoset, and Atom as well as wrappers
                                                           for maps, arrays, lists, and sets of JAXB
  Embeddedable server implementation for                  Objects.
   junit testing
                                                          GZIP content-encoding. Automatic GZIP
  Client framework that leverages JAX-RS                  compression/decompression suppport in
   annotations so that you can write HTTP                  client and server frameworks
   clients easily (JAX-RS only defines server
   bindings)                                              Asynchronous HTTP (Comet) abstractions
                                                           for JBoss Web, Tomcat 6, and Servlet 3.0
  Client "Browser" cache. Supports HTTP 1.1
   caching semantics including cache                      Asynchronous Job Service.
   revalidation
                                                          Rich interceptor model.
  Server in-memory cache. Local response
   cache. Automatically handles ETag                      EJB, Seam, Guice, Spring, and Spring MVC
   generation and cache revalidation                       integration

  Rich set of providers for: XML, JSON,
   YAML, Fastinfoset, Multipart, XOP, Atom,
   etc.
21                                     arconsis IT-Solutions GmbH
JBoss RESTEasy




22               arconsis IT-Solutions GmbH
iPhonical project

     Model Driven Software Development for mobile devices
           Extensible modular DSL
           Tooling support / editor (Workbench)
           Extensible + flexible generator
     Open Source (incubation phase):
           http://code.google.com/p/iphonical

 Idea was to build a framework based on powerful + flexible Eclipse ecosystem
 Leverage multi-platfrom support of Titanium Mobile Framework (Apache)


 23                            arconsis IT-Solutions GmbH
Data-driven mobile applications




24                  arconsis IT-Solutions GmbH
Data-driven mobile applications

         Skype        Typical usage scenario
          Contacts
      
                         Present list of data
         Twitter
                         Drill-down details
         Facebook
         LinkedIn       Edit details
         IPod           Perform some action ...
         ....


25                   arconsis IT-Solutions GmbH
A Mobile Gateway architecture example

     iPhone                                            JBoss AS
                                                                                 Other Applications
                                                                                 (e.g. CRM, ERP, …)
                                          JRMI"
                REST/JSON"
                                                   Hessian"        FTP, RMI"


     Android                  Mobile                  JBoss ESB
                           REST Gateway                                             Open Services
                            on JBoss AS                                          (e.g. Google, Yahoo,
                                                                   REST/XML"
                                                                                       Amazon,…)


                                          SOAP"
 Blackberry    REST/XML"
                                                       JBoss DS                  Internal Services
                                                       HornetQ                      (e.g. SOA,
                                                                   JDBC, SOAP"       Database)



                     REST Client             REST Server

26                                    arconsis IT-Solutions GmbH
Putting it all together …




      LIVE DEMO !

27                  arconsis IT-Solutions GmbH
So what did we see?

     We defined the domain model of the App
        Hit Generate
        Hit Simulate we got an ...


            „out of the box“ CRUD App

           Lead              Company                      Contact
                  1      1                   1        *




28                       arconsis IT-Solutions GmbH
So what did we see?

     We added the REST service definitions
        Hit Generate
        Hit Simulate we got an ...


            „out of the box“ CRUD App
            REST client proxies for the mobile device
            “Out of the box” REST Gateway running on
             JBoss5 AS using RESTEasy


29                        arconsis IT-Solutions GmbH
So what did we see?

     We changed the the controller.js to use the
      generate REST client proxy
          Hit Simulate we got an ...
             „out of the box“ CRUD App
             REST client proxies for the mobile device
             “Out of the box” REST Gateway running on
            JBoss5 AS using RESTEasy
             Integrated data-driven remote mobile App

30                        arconsis IT-Solutions GmbH
What next?

    Could use it “as is” for rapid prototyping and scaffolding
    Change or extend the generator and the grammar:
                                                   "
          It’s open source!
    Planned changes for this summer:
          Concept to re-generate code for client (JS prototypes)
          View aspects with UI controls for CUSTOM Apps
          Integration with JBossESB DSL (see my last talk)
          Cosmetic changes (e.g. Images support)

31                             arconsis IT-Solutions GmbH
Q&A + contact …

             Let us know what you think …




     ?       c/o: Wolfgang Frank
                   wolfgang.frank@arconsis.com

32                arconsis IT-Solutions GmbH
More things to see …


     http://rest-http.info"
     http://developer.appcelerator.com/"
     http://www.json.org"
     http://www.jboss.org/resteasy"
     http://www.jboss.org/jbossesb"
     http://www.jboss.org/jbossas"
     http://code.google.com/p/iphonical/"
     http://www.arconsis.com ;-)"

33                arconsis IT-Solutions GmbH
BACKUP SLIDES




 ups!
 … Something went wrong so I will need these …



34                arconsis IT-Solutions GmbH
Create iPhonical project




35                  arconsis IT-Solutions GmbH
The Mobile DSL – Model Aspects (iPhonical)




                                         •  define application
                                         •  define data types
                                         •  define relations




36                 arconsis IT-Solutions GmbH
The Mobile DSL – Remoting Aspects (iPhonical)



                                         •  define   remote aspects
                                         •  define   URI
                                         •  define   used types
                                         •  define   method




37                 arconsis IT-Solutions GmbH
Run Generator




38              arconsis IT-Solutions GmbH
Run Simulator or run Device




39                 arconsis IT-Solutions GmbH

Mais conteúdo relacionado

Mais procurados

Jeff Barr Amazon Services Cloud Computing
Jeff Barr Amazon Services Cloud ComputingJeff Barr Amazon Services Cloud Computing
Jeff Barr Amazon Services Cloud Computingdeimos
 
Running Active Directory in the AWS Cloud
Running Active Directory in the AWS Cloud Running Active Directory in the AWS Cloud
Running Active Directory in the AWS Cloud Amazon Web Services
 
Increase Speed and Agility with Amazon Web Services
Increase Speed and Agility with Amazon Web ServicesIncrease Speed and Agility with Amazon Web Services
Increase Speed and Agility with Amazon Web ServicesAmazon Web Services
 
AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)Amazon Web Services
 
(BIZ303) Active Directory in the AWS Cloud | AWS re:Invent 2014
(BIZ303) Active Directory in the AWS Cloud | AWS re:Invent 2014(BIZ303) Active Directory in the AWS Cloud | AWS re:Invent 2014
(BIZ303) Active Directory in the AWS Cloud | AWS re:Invent 2014Amazon Web Services
 
The Enterprise Grade SQL Server Deployments in AWS
The Enterprise Grade SQL Server Deployments in AWSThe Enterprise Grade SQL Server Deployments in AWS
The Enterprise Grade SQL Server Deployments in AWSAmazon Web Services
 
Zaragoza dev ops-activiti-khd-20181212
Zaragoza dev ops-activiti-khd-20181212Zaragoza dev ops-activiti-khd-20181212
Zaragoza dev ops-activiti-khd-20181212Angel Borroy López
 
AWS Serverless concepts and solutions
AWS Serverless concepts and solutionsAWS Serverless concepts and solutions
AWS Serverless concepts and solutionsElenaIvannikova3
 
Security best practices on AWS cloud
Security best practices on AWS cloudSecurity best practices on AWS cloud
Security best practices on AWS cloudMartin Yan
 
Real Time Data Processing Using AWS Lambda - DevDay Los Angeles 2017
Real Time Data Processing Using AWS Lambda - DevDay Los Angeles 2017Real Time Data Processing Using AWS Lambda - DevDay Los Angeles 2017
Real Time Data Processing Using AWS Lambda - DevDay Los Angeles 2017Amazon Web Services
 
AWS re:Invent 2016: From One to Many: Evolving VPC Design (ARC302)
AWS re:Invent 2016: From One to Many: Evolving VPC Design (ARC302)AWS re:Invent 2016: From One to Many: Evolving VPC Design (ARC302)
AWS re:Invent 2016: From One to Many: Evolving VPC Design (ARC302)Amazon Web Services
 
AWS Lambda from the trenches (Serverless London)
AWS Lambda from the trenches (Serverless London)AWS Lambda from the trenches (Serverless London)
AWS Lambda from the trenches (Serverless London)Yan Cui
 
SRV417 Deep Dive on Elastic Load Balancing
SRV417 Deep Dive on Elastic Load BalancingSRV417 Deep Dive on Elastic Load Balancing
SRV417 Deep Dive on Elastic Load BalancingAmazon Web Services
 

Mais procurados (20)

Jeff Barr Amazon Services Cloud Computing
Jeff Barr Amazon Services Cloud ComputingJeff Barr Amazon Services Cloud Computing
Jeff Barr Amazon Services Cloud Computing
 
AWS Security
AWS SecurityAWS Security
AWS Security
 
Running Active Directory in the AWS Cloud
Running Active Directory in the AWS Cloud Running Active Directory in the AWS Cloud
Running Active Directory in the AWS Cloud
 
Increase Speed and Agility with Amazon Web Services
Increase Speed and Agility with Amazon Web ServicesIncrease Speed and Agility with Amazon Web Services
Increase Speed and Agility with Amazon Web Services
 
AWS database services
AWS database servicesAWS database services
AWS database services
 
AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)AWS re:Invent 2016: Securing Container-Based Applications (CON402)
AWS re:Invent 2016: Securing Container-Based Applications (CON402)
 
(BIZ303) Active Directory in the AWS Cloud | AWS re:Invent 2014
(BIZ303) Active Directory in the AWS Cloud | AWS re:Invent 2014(BIZ303) Active Directory in the AWS Cloud | AWS re:Invent 2014
(BIZ303) Active Directory in the AWS Cloud | AWS re:Invent 2014
 
Introduction to Docker on AWS
Introduction to Docker on AWSIntroduction to Docker on AWS
Introduction to Docker on AWS
 
Aws privatelink
Aws privatelinkAws privatelink
Aws privatelink
 
The Enterprise Grade SQL Server Deployments in AWS
The Enterprise Grade SQL Server Deployments in AWSThe Enterprise Grade SQL Server Deployments in AWS
The Enterprise Grade SQL Server Deployments in AWS
 
Zaragoza dev ops-activiti-khd-20181212
Zaragoza dev ops-activiti-khd-20181212Zaragoza dev ops-activiti-khd-20181212
Zaragoza dev ops-activiti-khd-20181212
 
Security Best Practices on AWS
Security Best Practices on AWSSecurity Best Practices on AWS
Security Best Practices on AWS
 
AWS Serverless concepts and solutions
AWS Serverless concepts and solutionsAWS Serverless concepts and solutions
AWS Serverless concepts and solutions
 
Containers for Non-Developers
Containers for Non-DevelopersContainers for Non-Developers
Containers for Non-Developers
 
Security best practices on AWS cloud
Security best practices on AWS cloudSecurity best practices on AWS cloud
Security best practices on AWS cloud
 
AWS Serverless Examples
 AWS Serverless Examples  AWS Serverless Examples
AWS Serverless Examples
 
Real Time Data Processing Using AWS Lambda - DevDay Los Angeles 2017
Real Time Data Processing Using AWS Lambda - DevDay Los Angeles 2017Real Time Data Processing Using AWS Lambda - DevDay Los Angeles 2017
Real Time Data Processing Using AWS Lambda - DevDay Los Angeles 2017
 
AWS re:Invent 2016: From One to Many: Evolving VPC Design (ARC302)
AWS re:Invent 2016: From One to Many: Evolving VPC Design (ARC302)AWS re:Invent 2016: From One to Many: Evolving VPC Design (ARC302)
AWS re:Invent 2016: From One to Many: Evolving VPC Design (ARC302)
 
AWS Lambda from the trenches (Serverless London)
AWS Lambda from the trenches (Serverless London)AWS Lambda from the trenches (Serverless London)
AWS Lambda from the trenches (Serverless London)
 
SRV417 Deep Dive on Elastic Load Balancing
SRV417 Deep Dive on Elastic Load BalancingSRV417 Deep Dive on Elastic Load Balancing
SRV417 Deep Dive on Elastic Load Balancing
 

Semelhante a Generated REST Gateways for Mobile Applications

SOA an architecture on the Desktop
SOA an architecture on the DesktopSOA an architecture on the Desktop
SOA an architecture on the DesktopVincent Perrin
 
Above the cloud joarder kamal
Above the cloud   joarder kamalAbove the cloud   joarder kamal
Above the cloud joarder kamalJoarder Kamal
 
Tactics Esb Implementation
Tactics Esb ImplementationTactics Esb Implementation
Tactics Esb ImplementationMurali Manohar
 
AnDevCon: Introduction to Darwino
AnDevCon: Introduction to DarwinoAnDevCon: Introduction to Darwino
AnDevCon: Introduction to DarwinoPhilippe Riand
 
Experiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure teamExperiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure teamBrian Benz
 
Conduct JBoss EAP 6 seminar
Conduct JBoss EAP 6 seminarConduct JBoss EAP 6 seminar
Conduct JBoss EAP 6 seminarSyed Shaaf
 
Machine Builders and InduSoft Webinar
Machine Builders and InduSoft WebinarMachine Builders and InduSoft Webinar
Machine Builders and InduSoft WebinarAVEVA
 
xPaaS – day in the life of a modern application developer
xPaaS – day in the life of a modern application developerxPaaS – day in the life of a modern application developer
xPaaS – day in the life of a modern application developerEric D. Schabell
 
The Carbon Story
The Carbon StoryThe Carbon Story
The Carbon StoryWSO2
 
Client Continuum Dec Fy09
Client Continuum Dec Fy09Client Continuum Dec Fy09
Client Continuum Dec Fy09Martha Rotter
 
How to Radically Simplify Your Business Data Management
How to Radically Simplify Your Business Data ManagementHow to Radically Simplify Your Business Data Management
How to Radically Simplify Your Business Data ManagementClusterpoint
 
Mainframe Architecture & Product Overview
Mainframe Architecture & Product OverviewMainframe Architecture & Product Overview
Mainframe Architecture & Product Overviewabhi1112
 
Standard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data ManagementStandard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data ManagementInside Analysis
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop OverviewShubhra Kar
 
Food and Beverage Automation with InduSoft Web Studio
Food and Beverage Automation with InduSoft Web StudioFood and Beverage Automation with InduSoft Web Studio
Food and Beverage Automation with InduSoft Web StudioAVEVA
 
SAP integration sample payloads for Azure Logic Apps
SAP integration sample payloads for Azure Logic AppsSAP integration sample payloads for Azure Logic Apps
SAP integration sample payloads for Azure Logic AppsDavid Burg
 
Jimwebber soa
Jimwebber soaJimwebber soa
Jimwebber soad0nn9n
 
Current state of affairs cloud computing
Current state of affairs   cloud computingCurrent state of affairs   cloud computing
Current state of affairs cloud computingChirag Jog
 

Semelhante a Generated REST Gateways for Mobile Applications (20)

SOA an architecture on the Desktop
SOA an architecture on the DesktopSOA an architecture on the Desktop
SOA an architecture on the Desktop
 
Above the cloud joarder kamal
Above the cloud   joarder kamalAbove the cloud   joarder kamal
Above the cloud joarder kamal
 
Tactics Esb Implementation
Tactics Esb ImplementationTactics Esb Implementation
Tactics Esb Implementation
 
AnDevCon: Introduction to Darwino
AnDevCon: Introduction to DarwinoAnDevCon: Introduction to Darwino
AnDevCon: Introduction to Darwino
 
Experiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure teamExperiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure team
 
Conduct JBoss EAP 6 seminar
Conduct JBoss EAP 6 seminarConduct JBoss EAP 6 seminar
Conduct JBoss EAP 6 seminar
 
CouchDB
CouchDBCouchDB
CouchDB
 
Machine Builders and InduSoft Webinar
Machine Builders and InduSoft WebinarMachine Builders and InduSoft Webinar
Machine Builders and InduSoft Webinar
 
xPaaS – day in the life of a modern application developer
xPaaS – day in the life of a modern application developerxPaaS – day in the life of a modern application developer
xPaaS – day in the life of a modern application developer
 
The Carbon Story
The Carbon StoryThe Carbon Story
The Carbon Story
 
Client Continuum Dec Fy09
Client Continuum Dec Fy09Client Continuum Dec Fy09
Client Continuum Dec Fy09
 
How to Radically Simplify Your Business Data Management
How to Radically Simplify Your Business Data ManagementHow to Radically Simplify Your Business Data Management
How to Radically Simplify Your Business Data Management
 
Mainframe Architecture & Product Overview
Mainframe Architecture & Product OverviewMainframe Architecture & Product Overview
Mainframe Architecture & Product Overview
 
Standard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data ManagementStandard Issue: Preparing for the Future of Data Management
Standard Issue: Preparing for the Future of Data Management
 
StrongLoop Overview
StrongLoop OverviewStrongLoop Overview
StrongLoop Overview
 
Food and Beverage Automation with InduSoft Web Studio
Food and Beverage Automation with InduSoft Web StudioFood and Beverage Automation with InduSoft Web Studio
Food and Beverage Automation with InduSoft Web Studio
 
Project Fuji/OpenESB Aquarium Paris
Project Fuji/OpenESB Aquarium ParisProject Fuji/OpenESB Aquarium Paris
Project Fuji/OpenESB Aquarium Paris
 
SAP integration sample payloads for Azure Logic Apps
SAP integration sample payloads for Azure Logic AppsSAP integration sample payloads for Azure Logic Apps
SAP integration sample payloads for Azure Logic Apps
 
Jimwebber soa
Jimwebber soaJimwebber soa
Jimwebber soa
 
Current state of affairs cloud computing
Current state of affairs   cloud computingCurrent state of affairs   cloud computing
Current state of affairs cloud computing
 

Generated REST Gateways for Mobile Applications

  • 1. Generated REST Gateways for Mobile Applications Wolfgang Frank arconsis IT-Solutions GmbH May, 3rd 2010
  • 2. Who we are?   arconsis IT-Solutions GmbH from Karlsruhe, Germany   agile- & lean software development   software architecture   solutions based on JBoss middleware   mobile solutions leveraging MDSD   RedHat/JBoss Advanced SI Partner 2 arconsis IT-Solutions GmbH
  • 3. We want to …   Create data-driven mobile apps   Integrate with enterprise This should be …   simple   fast   multi-platform (apps + integration) 3 arconsis IT-Solutions GmbH
  • 4. How we do it … „ The talk will show how the usage of a Domain Specific Language (DSL) approach could help to simplify the RESTful integration of mobile applications (like on the iPhone or Android) with JBoss Middleware. The talk will sketch out the main concepts and provide a live demo for a solution based on a fully open source stack, composed of JBoss- as well as Eclipse technology.“ 4 arconsis IT-Solutions GmbH
  • 5. How we do it … „ The talk will show how the usage of a Domain Specific Language (DSL) approach could help to simplify the RESTful integration of mobile applications (like on the iPhone or Android) with JBoss Middleware. The talk will sketch out the main concepts and provide a live demo for a solution based on a fully open source stack, composed of JBoss- as well as Eclipse technology.“ 5 arconsis IT-Solutions GmbH
  • 6. Take a look   What do I mean with simple and fast?   A quick demo … 6 arconsis IT-Solutions GmbH
  • 7. A Mobile Gateway architecture example JBoss AS iPhone Other Applications (e.g. CRM, ERP, …) Mobile JBoss ESB Android REST Gateway Open Services on JBoss AS (e.g. Google, Yahoo, Amazon,…) Blackberry JBoss DS Internal Services HornetQ (e.g. SOA, Database) Should be easy to scale out! 7 arconsis IT-Solutions GmbH
  • 8. Where we’re heading …   Basics about MDSD + Domain Specific Languages   RESTful services + JBoss RestEasy   The iPhonical project   Data-driven Apps   A Mobile Gateway architecture   Putting it all together (demo) 8 arconsis IT-Solutions GmbH
  • 9. Basics about MDSD + Domain Specific Languages 9 arconsis IT-Solutions GmbH
  • 10. MDSD benefits   Separation of technical •  Automation with generation aspects and business aspects •  Reduced costs, raised productivity   Manage technological change •  Improved software-quality   Concepts more stable than •  Reduced maintenance costs technology ==> safer invest •  Better reusability •  Reduced development costs   No silver bullet! •  Manage high complexity •  Reduced development costs,   Higher effort for spec independence from 3rd   Effort to write generator •  Better communication IT & Biz   100% generation not always feasible 10 arconsis IT-Solutions GmbH
  • 11. Domain Specific Language   A DSL is a formal, processable language targeting at a specific viewpoint or aspect of a software system   It’s semantics, flexibility and notation is designed in order to support working with that viewpoint as good as possible ""Open Source Eclipse Frameworks (EMP):   Xtext: Define grammar + create parser + editor   Xpand, Xtend: Template language for model transformation 11 arconsis IT-Solutions GmbH
  • 12. REST over HTTP …   … is an architectural style that uses HTTP as protocol and URIs as identification mechanism   … leverages proven web-technologies   .. helps loose coupling (uniform interface)   … achieves interoperability (HTTP, URIs, XML/JSON, HTML, …)   … has only one interface (dataformat needs to be known)   … is performant and scalable (nearly unlimited)   no session + caching  highly distributable 12 arconsis IT-Solutions GmbH REST = Representational State Transfer: Roy Fielding 2000
  • 13. Basic principles of REST   All resources have a unique identifier   Usage of links and hypermedia   Standardized methods   Support different representations   Stateless communication Wikipedia: „Unlike SOAP-based web services, there is no "official" standard for RESTful web service. This is because REST is an architecture, unlike SOAP, which is a protocol. Even though REST is not a standard, a RESTful implementation such as the Web can use standards like HTTP, URL, XML, PNG, etc.“ 13 arconsis IT-Solutions GmbH
  • 14. Unique identifier for resources Use URIs for all resources worth it (values + sets) Examples:   http://example.com/customers/1234
 http://example.com/orders/2008/10/776654
 http://example.com/products
 http://example.com/processes/salary-increase-234" Careful: “It does not mean that every database key " " " and entity should be exposed as a resource!” 14 arconsis IT-Solutions GmbH
  • 15. Links and hypermedia “Hypermedia as the engine of application state” Example:   <order href=‘http://example.org/orders/4711’>
 " "<amount>69</amount>
 " "<product ref=‘http://example.org/products/0815’ />
 " "<customer ref=‘http://example.org/customers/4711’ />
 " "<product ref=‘http://example.org/products/0815’ />
 " "<link rel= ‘cancel’ ref=‘./cancellations’ />
 </order>   Links can span different systems   Control allowed workflow (e.g. cancellation currently allowed) 15 arconsis IT-Solutions GmbH
  • 16. Standardized methods   Every resource supports the same interface   HTTP verbs   GET, PUT, POST, DELETE, HEAD and OPTIONS"   “Guaranteed” behaviour, defined in HTTP specification   Idempotent; safe; cacheable + repeatable   GET/PUT/DELETE (get, modify/create, remove)   Unsafe; can create a resource or can do anything   POST" 16 arconsis IT-Solutions GmbH Idempotent = Free of side effects. “You can safely repeat the request anytime”
  • 17. WebService + RPC vs. REST Data types •  Different approaches can be mapped to each other! Service Design Operations Instances "Every app understanding HTTP-protocol can use your application " allows for generic clients (e.g. curl, wget, proxy-server, " Google- or Yahoo services, MSN, ...) 17 arconsis IT-Solutions GmbH
  • 18. Resources and representations   Content negotiation in HTTP: ""GET /customers/123 HTTP/1.1
 "HOST: example.org
 "Accept: application/vnd.mycompany.customer+xml"  Result could be company internal XML format ""GET /customers/123 HTTP/1.1
 "HOST: example.org
 "Accept: text/x-vcard"  Result could be customer address in vCard format   So many data formats and standards available to use instead to re-invent! 18 arconsis IT-Solutions GmbH
  • 19. Stateless communication "   “Stateless” does not mean no server-side state but:   “State” is kept in client or transformed in resource-state on server-side   No transient, client-specific state for longer than one request on server-side   E.g. “shopping cart” as resource  save bookmark, forward per email   Why?   Scalability   Coupling to clients (subsequent requests can be serverd by different server nodes) 19 arconsis IT-Solutions GmbH
  • 20. JSR-311 JAX-RS with JBoss RESTEasy   RESTful WebServices implementation for Java to be included within Java EE 6   Fully certified JAX-RS implementation Comes with jboss-eap-5.0 download! 20 arconsis IT-Solutions GmbH
  • 21. JBoss RESTEasy   Portable to any app-server/Tomcat that   JAXB marshalling into XML, JSON, Jackson, runs on JDK 5 or higher Fastinfoset, and Atom as well as wrappers for maps, arrays, lists, and sets of JAXB   Embeddedable server implementation for Objects. junit testing   GZIP content-encoding. Automatic GZIP   Client framework that leverages JAX-RS compression/decompression suppport in annotations so that you can write HTTP client and server frameworks clients easily (JAX-RS only defines server bindings)   Asynchronous HTTP (Comet) abstractions for JBoss Web, Tomcat 6, and Servlet 3.0   Client "Browser" cache. Supports HTTP 1.1 caching semantics including cache   Asynchronous Job Service. revalidation   Rich interceptor model.   Server in-memory cache. Local response cache. Automatically handles ETag   EJB, Seam, Guice, Spring, and Spring MVC generation and cache revalidation integration   Rich set of providers for: XML, JSON, YAML, Fastinfoset, Multipart, XOP, Atom, etc. 21 arconsis IT-Solutions GmbH
  • 22. JBoss RESTEasy 22 arconsis IT-Solutions GmbH
  • 23. iPhonical project   Model Driven Software Development for mobile devices   Extensible modular DSL   Tooling support / editor (Workbench)   Extensible + flexible generator   Open Source (incubation phase):   http://code.google.com/p/iphonical  Idea was to build a framework based on powerful + flexible Eclipse ecosystem  Leverage multi-platfrom support of Titanium Mobile Framework (Apache) 23 arconsis IT-Solutions GmbH
  • 24. Data-driven mobile applications 24 arconsis IT-Solutions GmbH
  • 25. Data-driven mobile applications   Skype Typical usage scenario Contacts     Present list of data   Twitter   Drill-down details   Facebook   LinkedIn   Edit details   IPod   Perform some action ...   .... 25 arconsis IT-Solutions GmbH
  • 26. A Mobile Gateway architecture example iPhone JBoss AS Other Applications (e.g. CRM, ERP, …) JRMI" REST/JSON" Hessian" FTP, RMI" Android Mobile JBoss ESB REST Gateway Open Services on JBoss AS (e.g. Google, Yahoo, REST/XML" Amazon,…) SOAP" Blackberry REST/XML" JBoss DS Internal Services HornetQ (e.g. SOA, JDBC, SOAP" Database) REST Client REST Server 26 arconsis IT-Solutions GmbH
  • 27. Putting it all together … LIVE DEMO ! 27 arconsis IT-Solutions GmbH
  • 28. So what did we see?   We defined the domain model of the App   Hit Generate   Hit Simulate we got an ...  „out of the box“ CRUD App Lead Company Contact 1 1 1 * 28 arconsis IT-Solutions GmbH
  • 29. So what did we see?   We added the REST service definitions   Hit Generate   Hit Simulate we got an ...  „out of the box“ CRUD App  REST client proxies for the mobile device  “Out of the box” REST Gateway running on JBoss5 AS using RESTEasy 29 arconsis IT-Solutions GmbH
  • 30. So what did we see?   We changed the the controller.js to use the generate REST client proxy   Hit Simulate we got an ...   „out of the box“ CRUD App   REST client proxies for the mobile device   “Out of the box” REST Gateway running on JBoss5 AS using RESTEasy   Integrated data-driven remote mobile App 30 arconsis IT-Solutions GmbH
  • 31. What next?   Could use it “as is” for rapid prototyping and scaffolding   Change or extend the generator and the grammar: "   It’s open source!   Planned changes for this summer:   Concept to re-generate code for client (JS prototypes)   View aspects with UI controls for CUSTOM Apps   Integration with JBossESB DSL (see my last talk)   Cosmetic changes (e.g. Images support) 31 arconsis IT-Solutions GmbH
  • 32. Q&A + contact … Let us know what you think … ? c/o: Wolfgang Frank wolfgang.frank@arconsis.com 32 arconsis IT-Solutions GmbH
  • 33. More things to see … http://rest-http.info" http://developer.appcelerator.com/" http://www.json.org" http://www.jboss.org/resteasy" http://www.jboss.org/jbossesb" http://www.jboss.org/jbossas" http://code.google.com/p/iphonical/" http://www.arconsis.com ;-)" 33 arconsis IT-Solutions GmbH
  • 34. BACKUP SLIDES ups! … Something went wrong so I will need these … 34 arconsis IT-Solutions GmbH
  • 35. Create iPhonical project 35 arconsis IT-Solutions GmbH
  • 36. The Mobile DSL – Model Aspects (iPhonical) •  define application •  define data types •  define relations 36 arconsis IT-Solutions GmbH
  • 37. The Mobile DSL – Remoting Aspects (iPhonical) •  define remote aspects •  define URI •  define used types •  define method 37 arconsis IT-Solutions GmbH
  • 38. Run Generator 38 arconsis IT-Solutions GmbH
  • 39. Run Simulator or run Device 39 arconsis IT-Solutions GmbH