SlideShare a Scribd company logo
SpringSource Roo
Flex Add-on Presentation

          Bill Ott




                           1
What is Spring Roo?
●   Roo is CLI shell tool to create Spring Applications without
    dealing with the environmental complexities of system
    configuration
●   Roo can transparently take care of client/server
    development cycle and is independent of the application
    runtime environment
●   Spring Roo is an extensible Rapid Application
    Development (RAD) tool for building enterprise
    applications without engineering trade-offs
●   Roo is a friendly Magic Genie watching over your source
    code to make sure code dependencies are
    updated/modified while you work on the project
                                                                  2
Why use Spring Roo?
●   Roo can passively generate a custom Spring Reference
    Implementation (RI) based on your requirements and your
    design inputs
●   If you know how to write Spring Enterprise Applications then
    Roo can help with actively manage code dependencies
●   And if you don't know Spring, then you will discover how Roo
    implements best practices within your Spring application




                                                                   3
Roo Integrations
●   Spring Framework 3.x    ●   ActiveMQ JMS
●   Spring Security         ●   Integration Tests
●   Spring MVC / Web Flow   ●   JavaScript Dojo
●   Open JPA / Hibernate    ●   GWT / GAE
●   JSP / Tiles             ●   Selenium
●   Log4J                   ●   OSGI add-on
●   Maven 2                 ●   BlazeDS
●   AspectJ                 ●   Flex Framework
●   Eclipse / STS
                                                    4
Roo Implementation
●   Roo Infrastructure {Roo Flex Add-On, STS
    Eclipse IDE, Command Shell} generates Spring
    Framework source code
●   Roo Infrastructure monitors and updates User
    project files {as, aj, java, xml, jsp, properties}
●   Roo Infrastructure builds detailed metadata
    model for @Roo Annotations within class files to
    aid in incremental updates to AOP management
    functions {Finders, Setters,Getters,toString,etc.}.

                                                         5
Roo Workflow
●   Roo writes the AspectJ Inter-Type Declaration
    (ITD) source files to support methods like
    toString(), Getters, Setters, and Finders.
●   Roo reads (monitors) Java and other source
    files to update aspects accordingly to
    implementation changes in domain objects.
●   AspectJ Compiler reads all the above source
    files and writes byte code class files for JVM
    execution.

                                                     6
What is Flex Add-on?
●   Roo tool extension to implement Adobe's Open Source
    Software libraries including Blaze Data Services (BlazeDS)
    on the backend and Flex Framework on the front end
●   Automates the configuration of Spring BlazeDS Integration project
    including Spring Framework, Maven, and Eclipse
●   Generation of BlazeDS @RemotingDestination services with
    full CRUD capabilities for each specified domain entity
●   Continuous synchronization of changes between ActionScript and
    Java domain classes for AMF remoting capabilities
●   UI scaffold generation to continuously updated as changes occur
    in the corresponding ActionScript or Java classes
●   Client-side Flex validators generation corresponding to the Bean
    Validation annotations on the Java model                         7
What is BlazeDS?
●   Blaze Data Services is Adobe Open Sourced Software supporting
    ActionScript Message Format (AMF) to give the Flex Client more
    options with server connectivity
●   BlazeDS Remoting service can invoke Java objects deployed in
    application server container.
●   BlazeDS Messaging service provides publish/subscribe middleware
    infrastructure to allow real-time data push to clients and collaborative
    application communication across clients.
●   BlazeDS Proxy service provides cross-domain service requests in a
    secure and controlled manner.
●   BlazeDS is deployed as a Java Archive (JAR) in the web application



                                                                               8
Client/Server Communication

Flex Client ↔ Java MessageBrokerServlet (Server)
communicates <-talks-to-> using the following
messaging transports:
●   Servlet-based Endpoints ↔ HTTP Proxy
●   HTTP Endpoints ↔ HTTP Proxy
●   AMF Endpoints ↔ Message
●   Streaming AMF Endpoints ↔ Remoting


                                              9
What is Flex?
●   User Interface (UI) component framework from Adobe freely available
    in a SDK package for building Rich Internet Applications (RIAs)
●   The Flex (Fx) SDK is Open Sourced Software – Free to develop-with
    & delivery-to internet users. Flex supports 98% of all web users
    across multiple browser vendors within browser versions
●   The Flex SDK provides many component libraries, a compiler with
    debugger, and Java-Doc style documentation
●   Flex has an extensive set of UI class libraries going far beyond the
    capabilities of Java Swing
●   Stand-alone Flex clients can access back-end data using either the
    HTTPService or SOAP WebService components without BlazeDS
●   More information please see resource slides at the end

                                                                           10
What are the Flex source files?
●   ActionScript (.as) - ECMAScript-compliant, object-oriented
    programming language. Flex looks and feels like Java,
    and supports the same object-oriented constructs:
    packages, classes, inheritance, interfaces, strong typing,
    dynamic typing and data binding.
●   MXML (.mxml) - Macromedia XML presentation
    description language, like JSPs are to Java, built on top of
    ActionScript to allow declarative construction of view
    components
●   The Flex source code (.mxml and .as files) is compiled
    into Flash byte-code (.swf like .jar) executed on the client
    browser by Flash Player or on the desktop by AIR
    Platform
                                                                   11
Flex Deployment Targets
●   Fx SDK/Flash → (.swf file) → Flash Player in Browser

●   Fx SDK/AIR → (.air file) → AIR Platform on Desktop
                           {Native OS Application}
●   Fx Hero SDK → (.apk or.ipa file) →
                        Android or Apple iOS
                        {Native OS Application}
●   Hero SDK is based on subset of the Flex 4.x SDK and
    optimized for mobile device architectures


                                                         12
What is the difference between
       Flash and Flex technology?
●   Flash (Fl) is design around a central time-line for creating
    graphic animations
●   Flash can not run on Desktop AIR platform therefore no access
    to native APIs from the OS environment
●   Flex (Fx) is programmatically based on event model from users
    and application generated events. Plus supports interactive
    data visualization components.
●   Flex on AIR Platform supports multiple device form-factors from
    mobile phones, TV Set-top boxes, entertainment hand sets, etc.
●   Both use ActionScript programming (similar to Java), but Flash
    does not use MXML files
●   Both Flash and Flex use binary (.swf) file to run in the
    ActionScript virtual machine, like Java virtual machine          13
Flex in Adobe Platform
●   Adobe Flash/Flex technology supports multiple
    screens on multiple hardware platforms for RIA
    applications with rich user content and video
●   Adobe Flash Builder is the designer and development
    tool for the RIA application platform
●   Adobe Flex framework is the Software Development
    Kit (SDK) for RIA applications
●   Adobe Air and Flash Player provide the run-time
    execution environment for RIA applications
●   Adobe BlazeDS provide the RIA application
    communication services to the Java server-side
                                                          14
Software Resources
●   Spring Source Tools Suite – STS 2.3.3.M1 Release
    http://bit.ly/7vNfLN
●   Spring Source Roo 1.1.0.M1 Release
    http://www.springsource.org/roo/start
●   Adobe Flash Builder 4 Plugin (Flex 4 SDK)
    http://bit.ly/cgJNRG
●   Spring BlazeDS Integration 1.5.0.M1 Distribution
     for Flex Add-on support
    http://bit.ly/c0UhUh
●   Installing Flex Addon documentation from
    Spring BlazeDS Integration Reference Guide
    http://bit.ly/c86for
                                                       15
Demo Highlights
●   Launch STS tool, inside fire up the Roo shell tool
●   Run the Roo Flex script in the Roo shell tool to
    create the Demo Application. Note: Allow mvn console
    to finish command execution before next entry.
●   Run the Demo Application in a browser
●   Take deep drive into Roo script and
    see each command executed from Roo script
●   Use the Roo shell console to access the managed files
    in the project and review the Roo actions and created
    artifacts


                                                            16
Spring Flex Demo
1. Run the Roo Script
   •   Create project
   •   Setup persistence
   •   Setup data resources
   •   Create domain – entities & fields
   •   Create controller (No DAO)
   •   Create UI scaffold from domain model
   •   Create Tests
2. Run the App
3. Run the Test
4. Remove Roo Artifacts
5. Redeploy without Roo files
                                              17
Shell Commands
persistence setup --database H2_IN_MEMORY --provider HIBERNATE

flex setup

entity --class ~.domain.Presenter --testAutomatically

field string --class ~.domain.Presenter --fieldName presenterName --notNull

field string --class ~.domain.Presenter --fieldName springModule --notNull

field date --class ~.domain.Presenter --fieldName presentationDate --type java.util.Date --notNull

field boolean --class ~.domain.Presenter --fieldName usefulInformation

flex remoting all --package ~.service

entity --class ~.domain.Feedback

field reference --fieldName presenter --type ~.domain.Presenter

field number --fieldName lengthOfPresentation --type java.lang.Float --decimalMin 30.0
--decimalMax 120.0

field number --fieldName difficulityRating --type java.lang.Integer --min 1 --max 5

field boolean --fieldName goodDemostration

flex remoting scaffold --name ~.service.FeedbackService
                                                                                                     18
Run Application
●   Deploy the new application – configure Tomcat server by drag
    drop project folder onto “SpringSource tc server”, start-up
    Tomcat server, and then run your new application in browser
●   Test out the UI – create two Presenter records, create two
    Feedback records and attach to the a Presenter record
●   Copy browser URL and startup another browser with the
    application URL to view data changes from the H2 database
●   Delete one Feedback record and edit one field in Presenter
    record. View changes in both browsers/applications




                                                                   19
Testing Code Updates
●   Edit the Action Script class by adding a line of code like
    public var NewName:String;
●   Check the Roo shell to see if the change has been added to the
    server side Java files.
●   On the client side, we will switch over to the Flash Builder
    perspective - we see the action script files and mxml files
    matches the changed domain classes as specify for the GUI
    presentation.
●   See what happens in the Flash Builder Perspective?
    Review both Java and Flex source files for updates in design
    view editor of Eclipse.


                                                                   20
Removing Capabilities
●   You can avoid system lock-in with Roo by -
●   Push-In Refactor by ITD insertion into Java
●   Pull-Out Roo Annotations from source files
●   Remove Roo Annotation JAR file and delete
    the pom reference from the project
●   Best of all – you can re-enable Roo after the
    above removal process was completed


                                                    21
Push In Refactor -
              AspectJ ITD into Java
●   You can manually remove the Roo meta data and Aspects
    from your project to yield a Spring Flex Application without
    .aj files.
●   Push in POJO attributes from the Spring Aspect JavaBean
    classes using STS Refactoring feature
●   Finally, remove all Roo generated aspects via menu options:
    Select Project icon → Source → Refactor → Push-In
    ●   Tip - remove errors: Refresh, Clean, Rebuild mvn project.




                                                                    22
Pull-Out Annotations 1/2
●   If you want to pull out Roo Annotations, then consider taking a
    snap shot of the code in a repository for app backup. Also,
    create .roo script file using the Roo backup command.
●   A best practice would be to get the model, entities and fields
    nailed down before pulling out Roo.
●   Pull out (or comment out) POJO attributes and then watch the
    Roo shell automatically do it's magic.




                                                                      23
Pull-Out Annotations 2/2
●   Begin by removing the @Roo annotation from Java files
    Search->File Search string replace “n.*Roo.*n” without quotes
    on .java files, check Regular Expression checkbox, click
    Replace button. Enter the “n” in the text box.
●   Remove jar artifact “org.springframework.roo.annotations-*.jar
    artifact from the pom.xml file and then refresh STS.
●   Execute “mvn eclipse:clean” and then “mvn eclipse:eclipse”
●   Check the Roo generated aspect files are delete from Roo
    project and all related Java project files have been updated with
    the methods from the Spring AspectJ files.




                                                                     24
New Features
●   Incremental reverse engineering of existing
    databases
●   Enhanced ORM Entity Relationship support
●   Google Web Toolkit (GWT) & Google Application
    Engine (GAE) Integration
●   JSON support in Spring MVC apps
●   Social Media Integration Support (16)
    Example: YouTube, Flikr, Picasa, Google Maps, Twitter, Facebook, etc.

●   Flash message area in STS
●   More info see SpringSource - Team Blog post
    http://blog.springsource.com/2010/08/25/spring-roo-1-1-0-m3-released/

                                                                            25
Resources
●   Project Home
    ●   http://www.springsource.org/roo
    ●   More resources, like videos, ref cards, guides, manuals...
●   Community Forums
    ●   http://forum.springsource.org/
    ●   Roo team monitors the forum and answers queries
●   Issue Tracker
    ●   http://jira.springframework.org/browse/ROO
●   Twitter - Latest Roo Announcements
    ●   Search code: #roo
    ●   Follow @schmidtstenfan, @benalexau, @SpringRoo
                                                                     26
Roo & Flex Book Resources
●   Adobe Flex 4: Training from the source – by Michael Labriola,
    Jeff Tapper, Matthew Boles
●   First Steps in Flex - by James Ward, Bruce Eckel (Java Guy)
●   Flash Builder 4 & Flex 4 Bible – by David Gassner
●   Flex 4 Cookbook – by Joshua Noble, Todd Anderson, Garth
    Braithwaite, Marco Casario, Rich Tertola, David Tucker
●   Flex 4 in Action - By Dan Orlando, Tariq Ahmed, John C. Bland
    II, Joel Hooks (Dallas native – Robot Legs),
●   Spring Roo in Action (Manning Early Access Edition) – by
    Gordon Dickens and Ken Rimple, Twitter @rooinaction


                                                                27
Adobe Resources
●   Adobe Developers Network – Java & Flex
    http://www.adobe.com/devnet/flex/flex_java.html
●   Adobe's Flex quick-start tutorial:
    http://www.adobe.com/devnet/flex/quickstarts/index.html
●   Adobe LiveDocs online reference documentation:
    http://bit.ly/4TVeT5
●   Adobe TV: http://tv.adobe.com/product/flex
●   Adobe Learn Flex In A Week video training:
    http://www.adobe.com/devnet/flex/videotraining
●   Adobe Tour De Flex – running Flex examples & view source code:
    http://www.adobe.com/devnet/flex/tourdeflex/
●   Dallas Flex User Groups (D-Flex) – Meets Third Thursday night
    of each month. Click here for details. http://bit.ly/dzAyq7

                                                                     28
Developer Zone Resources
    Offers free Reference Cards (RC) to help you get started
    in Flex & Spring Frameworks -
●   Dzone RC17 Very First Steps in Flex
    http://refcardz.dzone.com/refcardz/very-first-steps-flex
●   Dzone RC75 Getting Started with BlazeDS
    http://bit.ly/afTkc7
●   Dzone RC91 Getting Started Adobe Flash Builder 4
    http://bit.ly/ckbw9W
●   Dzone RC102 Flex 4 & Spring 3 Integration
    http://bit.ly/bSmgIu



                                                               29
Questions & Answers
1) Can you create a RESTful Flex client with Spring? Yes, use the
HTTP Remote object in Flex client.
2) Can Flex client connect to more than one BlazeDS server?
   Yes, without cross domain file required on the server.
3) How can I push data from one Flex client to many Flex clients?
   Publish a JMS message in a queue to be pushed to
   client subscribers. See Test Drive at http://bit.ly/a1s8gq
4) How do you implement the different polling mechanisms in
Flex/Spring Integration? Very simple just change the configuration
properties as follows:
<flex:message-broker>
   <flex:message-service
      default-channels="my-streaming-amf,my-longpolling-amf,my-polling-amf" />
   <flex:secured />
</flex:message-broker>
                                                                            30
Spring Flex Summary
●   A great RAD tool for Spring application development
●   Script driven => easy to learn, modify, and reuse
●   Provides Reference Implementation application
●   Supports Best Practices from Spring community
●   No Lock-ins with runtime, no deployment footprint,
    and no control flow invocation or altercation
●   Open source extensibility includes OSGI add-on
●   Flex can build RIA Clients for Java developers
●   Thanks for you time and attention. :)
                                                          31
More Resources
Slide 5 - Roo Implementation & Slide 7 Roo Workflow
http://www.slideshare.net/benalexau/introduction-to-spring-roo-100-2805183
Slide 9 – Client/Server Communication
http://opensource.adobe.com/wiki/display/blazeds/BlazeDS/
Slide 12 – Flex Deployment Targets
Paul Trani on SlideShare, http://slidesha.re/9qeSK4
Slide 14 – Flex in Adobe Platform
http://www.adobe.com/products/
http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK
http://www.adobe.com/products/flashplatformruntimes/
Special thanks for resource contributions from SpringSource Engineers
and Adobe Evangelists


                                                                        32
SpringSource Roo
           Flex Add-on Presentation
●   Most of the presentation resources (images, text, etc.)
    displayed herein are respectfully owned by the following:
    Adobe Flex http://www.adobe.com/products/flex/
    Dzone http://refcardz.dzone.com/
    Oracle Java http://www.oracle.com/technetwork/java/index.html
    SpringSource Roo http://www.springsource.org/roo
●   The software technologies presented are copyright protected
    and/or patented by the respective companies and/or
    contributing authors herein.
●   This is an informational presentation given for educational
    purposes only, as a non-for-profit contribution, to support the
    learning of open source software related and non-related
    technologies.

                                                                      33
LIABILITY DISCLAIMER
●   THE PRECEEDING SOFTWARE RESOURCES PRESENTED ARE
    PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
    BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
    DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS
    BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
    OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    PRESENTATION OR RESOURCES, EVEN IF ADVISED OF THE
    POSSIBILITY OF SUCH DAMAGE.



                                                           34

More Related Content

PDF
Introduction to Adobe Flex
PPT
Eclipsist2009 Rich Client Roundup
PPTX
Evolution of .net frame work
PPTX
.NET Framework 4.0 – Changes & Benefits
PDF
Dotnet basics
PPTX
.Net framework
PPT
Dotnet framework
PPTX
Visual Studio 2010 and .NET Framework 4.0 Overview
Introduction to Adobe Flex
Eclipsist2009 Rich Client Roundup
Evolution of .net frame work
.NET Framework 4.0 – Changes & Benefits
Dotnet basics
.Net framework
Dotnet framework
Visual Studio 2010 and .NET Framework 4.0 Overview

What's hot (20)

PPTX
.Net slid
DOC
.Net framework interview questions
PPTX
Net Fundamentals
PDF
Future of .NET - .NET on Non Windows Platforms
PPTX
Introduction of .net framework
PPTX
.net CLR
PDF
Dot Net Fundamentals
PDF
Best things to know about .net framework
PPT
DotNet Introduction
PPTX
Overview of the new .NET Core and .NET Platform Standard
PPT
Introduction to .NET Framework
PPS
dot NET Framework
PPTX
Sys ml helperprofile-rhapsody813-obtainandinstall-v1
DOCX
PDF
Multiplatform Apps with Spring, Kotlin, and RSocket
PPTX
Android ndk - Introduction
PDF
“Full-stack developer: з чого розпочати кар’єру?”
PPTX
Overview of .Net Framework 4.5
PPTX
Overview of .Net Framework
PPTX
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
.Net slid
.Net framework interview questions
Net Fundamentals
Future of .NET - .NET on Non Windows Platforms
Introduction of .net framework
.net CLR
Dot Net Fundamentals
Best things to know about .net framework
DotNet Introduction
Overview of the new .NET Core and .NET Platform Standard
Introduction to .NET Framework
dot NET Framework
Sys ml helperprofile-rhapsody813-obtainandinstall-v1
Multiplatform Apps with Spring, Kotlin, and RSocket
Android ndk - Introduction
“Full-stack developer: з чого розпочати кар’єру?”
Overview of .Net Framework 4.5
Overview of .Net Framework
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
Ad

Similar to Spring Roo Flex Add-on (20)

PPT
Flex_Basic_Training
PPT
Flex and .NET Integration
PPT
RIA Development via Adobe Flex + JRuby on Rails
PDF
Development with JavaFX 9 in JDK 9.0.1
KEY
Language Engineering in the Cloud
PPT
Flex Remoting With WebORB v1.0
PDF
What makes Flutter the best cross platform sdk
PPTX
Copmuter Languages
PPT
Net framework
PPT
Introduction to .net
PPT
Flex And Ria
PPT
Flex RIA
DOCX
Project report for final year project
PDF
Philipe Riand - Building Social Applications using the Social Business Toolki...
PDF
JavaFX: A Rich Internet Application (RIA) Development Platform
PPT
What Is Silverlight
PPT
What Is Silverlight
PPT
What Is Silverlight
PPTX
Building RIA Apps with Silverlight
PPT
Adobe Flex
Flex_Basic_Training
Flex and .NET Integration
RIA Development via Adobe Flex + JRuby on Rails
Development with JavaFX 9 in JDK 9.0.1
Language Engineering in the Cloud
Flex Remoting With WebORB v1.0
What makes Flutter the best cross platform sdk
Copmuter Languages
Net framework
Introduction to .net
Flex And Ria
Flex RIA
Project report for final year project
Philipe Riand - Building Social Applications using the Social Business Toolki...
JavaFX: A Rich Internet Application (RIA) Development Platform
What Is Silverlight
What Is Silverlight
What Is Silverlight
Building RIA Apps with Silverlight
Adobe Flex
Ad

Recently uploaded (20)

PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
cuic standard and advanced reporting.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Cloud computing and distributed systems.
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PPTX
Big Data Technologies - Introduction.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Approach and Philosophy of On baking technology
PDF
Encapsulation theory and applications.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Electronic commerce courselecture one. Pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
NewMind AI Weekly Chronicles - August'25 Week I
Understanding_Digital_Forensics_Presentation.pptx
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
cuic standard and advanced reporting.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Network Security Unit 5.pdf for BCA BBA.
Cloud computing and distributed systems.
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Spectral efficient network and resource selection model in 5G networks
Unlocking AI with Model Context Protocol (MCP)
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Big Data Technologies - Introduction.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Empathic Computing: Creating Shared Understanding
Approach and Philosophy of On baking technology
Encapsulation theory and applications.pdf
Review of recent advances in non-invasive hemoglobin estimation
Electronic commerce courselecture one. Pdf
Encapsulation_ Review paper, used for researhc scholars
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication

Spring Roo Flex Add-on

  • 1. SpringSource Roo Flex Add-on Presentation Bill Ott 1
  • 2. What is Spring Roo? ● Roo is CLI shell tool to create Spring Applications without dealing with the environmental complexities of system configuration ● Roo can transparently take care of client/server development cycle and is independent of the application runtime environment ● Spring Roo is an extensible Rapid Application Development (RAD) tool for building enterprise applications without engineering trade-offs ● Roo is a friendly Magic Genie watching over your source code to make sure code dependencies are updated/modified while you work on the project 2
  • 3. Why use Spring Roo? ● Roo can passively generate a custom Spring Reference Implementation (RI) based on your requirements and your design inputs ● If you know how to write Spring Enterprise Applications then Roo can help with actively manage code dependencies ● And if you don't know Spring, then you will discover how Roo implements best practices within your Spring application 3
  • 4. Roo Integrations ● Spring Framework 3.x ● ActiveMQ JMS ● Spring Security ● Integration Tests ● Spring MVC / Web Flow ● JavaScript Dojo ● Open JPA / Hibernate ● GWT / GAE ● JSP / Tiles ● Selenium ● Log4J ● OSGI add-on ● Maven 2 ● BlazeDS ● AspectJ ● Flex Framework ● Eclipse / STS 4
  • 5. Roo Implementation ● Roo Infrastructure {Roo Flex Add-On, STS Eclipse IDE, Command Shell} generates Spring Framework source code ● Roo Infrastructure monitors and updates User project files {as, aj, java, xml, jsp, properties} ● Roo Infrastructure builds detailed metadata model for @Roo Annotations within class files to aid in incremental updates to AOP management functions {Finders, Setters,Getters,toString,etc.}. 5
  • 6. Roo Workflow ● Roo writes the AspectJ Inter-Type Declaration (ITD) source files to support methods like toString(), Getters, Setters, and Finders. ● Roo reads (monitors) Java and other source files to update aspects accordingly to implementation changes in domain objects. ● AspectJ Compiler reads all the above source files and writes byte code class files for JVM execution. 6
  • 7. What is Flex Add-on? ● Roo tool extension to implement Adobe's Open Source Software libraries including Blaze Data Services (BlazeDS) on the backend and Flex Framework on the front end ● Automates the configuration of Spring BlazeDS Integration project including Spring Framework, Maven, and Eclipse ● Generation of BlazeDS @RemotingDestination services with full CRUD capabilities for each specified domain entity ● Continuous synchronization of changes between ActionScript and Java domain classes for AMF remoting capabilities ● UI scaffold generation to continuously updated as changes occur in the corresponding ActionScript or Java classes ● Client-side Flex validators generation corresponding to the Bean Validation annotations on the Java model 7
  • 8. What is BlazeDS? ● Blaze Data Services is Adobe Open Sourced Software supporting ActionScript Message Format (AMF) to give the Flex Client more options with server connectivity ● BlazeDS Remoting service can invoke Java objects deployed in application server container. ● BlazeDS Messaging service provides publish/subscribe middleware infrastructure to allow real-time data push to clients and collaborative application communication across clients. ● BlazeDS Proxy service provides cross-domain service requests in a secure and controlled manner. ● BlazeDS is deployed as a Java Archive (JAR) in the web application 8
  • 9. Client/Server Communication Flex Client ↔ Java MessageBrokerServlet (Server) communicates <-talks-to-> using the following messaging transports: ● Servlet-based Endpoints ↔ HTTP Proxy ● HTTP Endpoints ↔ HTTP Proxy ● AMF Endpoints ↔ Message ● Streaming AMF Endpoints ↔ Remoting 9
  • 10. What is Flex? ● User Interface (UI) component framework from Adobe freely available in a SDK package for building Rich Internet Applications (RIAs) ● The Flex (Fx) SDK is Open Sourced Software – Free to develop-with & delivery-to internet users. Flex supports 98% of all web users across multiple browser vendors within browser versions ● The Flex SDK provides many component libraries, a compiler with debugger, and Java-Doc style documentation ● Flex has an extensive set of UI class libraries going far beyond the capabilities of Java Swing ● Stand-alone Flex clients can access back-end data using either the HTTPService or SOAP WebService components without BlazeDS ● More information please see resource slides at the end 10
  • 11. What are the Flex source files? ● ActionScript (.as) - ECMAScript-compliant, object-oriented programming language. Flex looks and feels like Java, and supports the same object-oriented constructs: packages, classes, inheritance, interfaces, strong typing, dynamic typing and data binding. ● MXML (.mxml) - Macromedia XML presentation description language, like JSPs are to Java, built on top of ActionScript to allow declarative construction of view components ● The Flex source code (.mxml and .as files) is compiled into Flash byte-code (.swf like .jar) executed on the client browser by Flash Player or on the desktop by AIR Platform 11
  • 12. Flex Deployment Targets ● Fx SDK/Flash → (.swf file) → Flash Player in Browser ● Fx SDK/AIR → (.air file) → AIR Platform on Desktop {Native OS Application} ● Fx Hero SDK → (.apk or.ipa file) → Android or Apple iOS {Native OS Application} ● Hero SDK is based on subset of the Flex 4.x SDK and optimized for mobile device architectures 12
  • 13. What is the difference between Flash and Flex technology? ● Flash (Fl) is design around a central time-line for creating graphic animations ● Flash can not run on Desktop AIR platform therefore no access to native APIs from the OS environment ● Flex (Fx) is programmatically based on event model from users and application generated events. Plus supports interactive data visualization components. ● Flex on AIR Platform supports multiple device form-factors from mobile phones, TV Set-top boxes, entertainment hand sets, etc. ● Both use ActionScript programming (similar to Java), but Flash does not use MXML files ● Both Flash and Flex use binary (.swf) file to run in the ActionScript virtual machine, like Java virtual machine 13
  • 14. Flex in Adobe Platform ● Adobe Flash/Flex technology supports multiple screens on multiple hardware platforms for RIA applications with rich user content and video ● Adobe Flash Builder is the designer and development tool for the RIA application platform ● Adobe Flex framework is the Software Development Kit (SDK) for RIA applications ● Adobe Air and Flash Player provide the run-time execution environment for RIA applications ● Adobe BlazeDS provide the RIA application communication services to the Java server-side 14
  • 15. Software Resources ● Spring Source Tools Suite – STS 2.3.3.M1 Release http://bit.ly/7vNfLN ● Spring Source Roo 1.1.0.M1 Release http://www.springsource.org/roo/start ● Adobe Flash Builder 4 Plugin (Flex 4 SDK) http://bit.ly/cgJNRG ● Spring BlazeDS Integration 1.5.0.M1 Distribution for Flex Add-on support http://bit.ly/c0UhUh ● Installing Flex Addon documentation from Spring BlazeDS Integration Reference Guide http://bit.ly/c86for 15
  • 16. Demo Highlights ● Launch STS tool, inside fire up the Roo shell tool ● Run the Roo Flex script in the Roo shell tool to create the Demo Application. Note: Allow mvn console to finish command execution before next entry. ● Run the Demo Application in a browser ● Take deep drive into Roo script and see each command executed from Roo script ● Use the Roo shell console to access the managed files in the project and review the Roo actions and created artifacts 16
  • 17. Spring Flex Demo 1. Run the Roo Script • Create project • Setup persistence • Setup data resources • Create domain – entities & fields • Create controller (No DAO) • Create UI scaffold from domain model • Create Tests 2. Run the App 3. Run the Test 4. Remove Roo Artifacts 5. Redeploy without Roo files 17
  • 18. Shell Commands persistence setup --database H2_IN_MEMORY --provider HIBERNATE flex setup entity --class ~.domain.Presenter --testAutomatically field string --class ~.domain.Presenter --fieldName presenterName --notNull field string --class ~.domain.Presenter --fieldName springModule --notNull field date --class ~.domain.Presenter --fieldName presentationDate --type java.util.Date --notNull field boolean --class ~.domain.Presenter --fieldName usefulInformation flex remoting all --package ~.service entity --class ~.domain.Feedback field reference --fieldName presenter --type ~.domain.Presenter field number --fieldName lengthOfPresentation --type java.lang.Float --decimalMin 30.0 --decimalMax 120.0 field number --fieldName difficulityRating --type java.lang.Integer --min 1 --max 5 field boolean --fieldName goodDemostration flex remoting scaffold --name ~.service.FeedbackService 18
  • 19. Run Application ● Deploy the new application – configure Tomcat server by drag drop project folder onto “SpringSource tc server”, start-up Tomcat server, and then run your new application in browser ● Test out the UI – create two Presenter records, create two Feedback records and attach to the a Presenter record ● Copy browser URL and startup another browser with the application URL to view data changes from the H2 database ● Delete one Feedback record and edit one field in Presenter record. View changes in both browsers/applications 19
  • 20. Testing Code Updates ● Edit the Action Script class by adding a line of code like public var NewName:String; ● Check the Roo shell to see if the change has been added to the server side Java files. ● On the client side, we will switch over to the Flash Builder perspective - we see the action script files and mxml files matches the changed domain classes as specify for the GUI presentation. ● See what happens in the Flash Builder Perspective? Review both Java and Flex source files for updates in design view editor of Eclipse. 20
  • 21. Removing Capabilities ● You can avoid system lock-in with Roo by - ● Push-In Refactor by ITD insertion into Java ● Pull-Out Roo Annotations from source files ● Remove Roo Annotation JAR file and delete the pom reference from the project ● Best of all – you can re-enable Roo after the above removal process was completed 21
  • 22. Push In Refactor - AspectJ ITD into Java ● You can manually remove the Roo meta data and Aspects from your project to yield a Spring Flex Application without .aj files. ● Push in POJO attributes from the Spring Aspect JavaBean classes using STS Refactoring feature ● Finally, remove all Roo generated aspects via menu options: Select Project icon → Source → Refactor → Push-In ● Tip - remove errors: Refresh, Clean, Rebuild mvn project. 22
  • 23. Pull-Out Annotations 1/2 ● If you want to pull out Roo Annotations, then consider taking a snap shot of the code in a repository for app backup. Also, create .roo script file using the Roo backup command. ● A best practice would be to get the model, entities and fields nailed down before pulling out Roo. ● Pull out (or comment out) POJO attributes and then watch the Roo shell automatically do it's magic. 23
  • 24. Pull-Out Annotations 2/2 ● Begin by removing the @Roo annotation from Java files Search->File Search string replace “n.*Roo.*n” without quotes on .java files, check Regular Expression checkbox, click Replace button. Enter the “n” in the text box. ● Remove jar artifact “org.springframework.roo.annotations-*.jar artifact from the pom.xml file and then refresh STS. ● Execute “mvn eclipse:clean” and then “mvn eclipse:eclipse” ● Check the Roo generated aspect files are delete from Roo project and all related Java project files have been updated with the methods from the Spring AspectJ files. 24
  • 25. New Features ● Incremental reverse engineering of existing databases ● Enhanced ORM Entity Relationship support ● Google Web Toolkit (GWT) & Google Application Engine (GAE) Integration ● JSON support in Spring MVC apps ● Social Media Integration Support (16) Example: YouTube, Flikr, Picasa, Google Maps, Twitter, Facebook, etc. ● Flash message area in STS ● More info see SpringSource - Team Blog post http://blog.springsource.com/2010/08/25/spring-roo-1-1-0-m3-released/ 25
  • 26. Resources ● Project Home ● http://www.springsource.org/roo ● More resources, like videos, ref cards, guides, manuals... ● Community Forums ● http://forum.springsource.org/ ● Roo team monitors the forum and answers queries ● Issue Tracker ● http://jira.springframework.org/browse/ROO ● Twitter - Latest Roo Announcements ● Search code: #roo ● Follow @schmidtstenfan, @benalexau, @SpringRoo 26
  • 27. Roo & Flex Book Resources ● Adobe Flex 4: Training from the source – by Michael Labriola, Jeff Tapper, Matthew Boles ● First Steps in Flex - by James Ward, Bruce Eckel (Java Guy) ● Flash Builder 4 & Flex 4 Bible – by David Gassner ● Flex 4 Cookbook – by Joshua Noble, Todd Anderson, Garth Braithwaite, Marco Casario, Rich Tertola, David Tucker ● Flex 4 in Action - By Dan Orlando, Tariq Ahmed, John C. Bland II, Joel Hooks (Dallas native – Robot Legs), ● Spring Roo in Action (Manning Early Access Edition) – by Gordon Dickens and Ken Rimple, Twitter @rooinaction 27
  • 28. Adobe Resources ● Adobe Developers Network – Java & Flex http://www.adobe.com/devnet/flex/flex_java.html ● Adobe's Flex quick-start tutorial: http://www.adobe.com/devnet/flex/quickstarts/index.html ● Adobe LiveDocs online reference documentation: http://bit.ly/4TVeT5 ● Adobe TV: http://tv.adobe.com/product/flex ● Adobe Learn Flex In A Week video training: http://www.adobe.com/devnet/flex/videotraining ● Adobe Tour De Flex – running Flex examples & view source code: http://www.adobe.com/devnet/flex/tourdeflex/ ● Dallas Flex User Groups (D-Flex) – Meets Third Thursday night of each month. Click here for details. http://bit.ly/dzAyq7 28
  • 29. Developer Zone Resources Offers free Reference Cards (RC) to help you get started in Flex & Spring Frameworks - ● Dzone RC17 Very First Steps in Flex http://refcardz.dzone.com/refcardz/very-first-steps-flex ● Dzone RC75 Getting Started with BlazeDS http://bit.ly/afTkc7 ● Dzone RC91 Getting Started Adobe Flash Builder 4 http://bit.ly/ckbw9W ● Dzone RC102 Flex 4 & Spring 3 Integration http://bit.ly/bSmgIu 29
  • 30. Questions & Answers 1) Can you create a RESTful Flex client with Spring? Yes, use the HTTP Remote object in Flex client. 2) Can Flex client connect to more than one BlazeDS server? Yes, without cross domain file required on the server. 3) How can I push data from one Flex client to many Flex clients? Publish a JMS message in a queue to be pushed to client subscribers. See Test Drive at http://bit.ly/a1s8gq 4) How do you implement the different polling mechanisms in Flex/Spring Integration? Very simple just change the configuration properties as follows: <flex:message-broker> <flex:message-service default-channels="my-streaming-amf,my-longpolling-amf,my-polling-amf" /> <flex:secured /> </flex:message-broker> 30
  • 31. Spring Flex Summary ● A great RAD tool for Spring application development ● Script driven => easy to learn, modify, and reuse ● Provides Reference Implementation application ● Supports Best Practices from Spring community ● No Lock-ins with runtime, no deployment footprint, and no control flow invocation or altercation ● Open source extensibility includes OSGI add-on ● Flex can build RIA Clients for Java developers ● Thanks for you time and attention. :) 31
  • 32. More Resources Slide 5 - Roo Implementation & Slide 7 Roo Workflow http://www.slideshare.net/benalexau/introduction-to-spring-roo-100-2805183 Slide 9 – Client/Server Communication http://opensource.adobe.com/wiki/display/blazeds/BlazeDS/ Slide 12 – Flex Deployment Targets Paul Trani on SlideShare, http://slidesha.re/9qeSK4 Slide 14 – Flex in Adobe Platform http://www.adobe.com/products/ http://opensource.adobe.com/wiki/display/flexsdk/Flex+SDK http://www.adobe.com/products/flashplatformruntimes/ Special thanks for resource contributions from SpringSource Engineers and Adobe Evangelists 32
  • 33. SpringSource Roo Flex Add-on Presentation ● Most of the presentation resources (images, text, etc.) displayed herein are respectfully owned by the following: Adobe Flex http://www.adobe.com/products/flex/ Dzone http://refcardz.dzone.com/ Oracle Java http://www.oracle.com/technetwork/java/index.html SpringSource Roo http://www.springsource.org/roo ● The software technologies presented are copyright protected and/or patented by the respective companies and/or contributing authors herein. ● This is an informational presentation given for educational purposes only, as a non-for-profit contribution, to support the learning of open source software related and non-related technologies. 33
  • 34. LIABILITY DISCLAIMER ● THE PRECEEDING SOFTWARE RESOURCES PRESENTED ARE PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS PRESENTATION OR RESOURCES, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 34