SlideShare a Scribd company logo
Integration of Spring with
Blaze DS and Cairngorm UM
Deepdive by N.S.Devaraj

http://nsdevaraj.wordpress.com/
twitter : @nsdevaraj
Agenda for this season

    What is Spring?

    Why Spring with Flex?

    Why Spring BlazeDS Integration?

    What is & Why Cairngorm UM?

    What is & why generic DAO?

    What is & Why CairnSpring?
WHAT IS SPRING?

  The result is looser coupling between
 components. The Spring IoC container has
    proven to be a solid foundation for
  building robust enterprise applications.
                   `


The components managed by the Spring IoC
     container are called Spring beans.
WHAT IS SPRING?


The Spring framework includes several other
      modules in addition to its core IoC
                 container.
     http://www.springframework.org.
WHY WE NEED FLEX ACCESS
        SPRING?

Flex is the obvious choice when a Spring
Developer is looking at RIA.

Can reuse your server-side Spring to move
into RIA.
WHY WE NEED FLEX ACCESS
          SPRING?
 In scenario of the Remoting and Data
   Management Services approaches:

  It enable the tightest integration with
  Spring. There is no need to transform
 data, or to expose services in a certain
 way: the Flex application works directly
with the beans registered in the Spring IoC
                container.
WHY WE NEED FLEX ACCESS
         SPRING?
The BlazeDS Remoting enables binding your
 valueobjects with Java pojo Classes easily
               by metadata
 [RemoteClass(alias=”com.adobe.pojo.ob”]

  By using the Spring Security 2.0 we can
      make our application secured for
                transactions.
WHAT is BlazeDS?
BlazeDS provides a set of services that lets you connect
  a client-side application to server-side data, and pass
   data among multiple clients connected to the server.
   BlazeDS implements real-time messaging between
                           clients.
    Browser                           application
     or AIR
                                          .swf


                                                 http(s)
                       domain
                         blazeds server

      External                             Remote
      Services         Service
                                          Procedure        Messaging
                        Proxy
                                            Calls
BlazeDS Server
                                 servlet
                       /{context}/messagebroker/*
                                                                          core
              config
         proxy-config.xml

              config                                         config

       messaging-config.xml                         services-config.xml

              config
flex    remote-config.xml
                              domain
             library                                config
              .jar                                  .class
                                    Classes
Lib
BLAZE DS WAY
 Using the “dependency lookup” approach
of the SpringFactory feels opposite to the
"Spring Way"

The burden of configuration is multiplied.
Potential for deep integration beyond just
remoting is limited.
BLAZEDS SPRING INTEGRATION
 Bootstrap the BlazeDS MessageBroker as a
Spring-managed bean (no more web.xml or
 MessageBrokerServlet config needed).

Route http-based Flex messages to the
MessageBroker through the Spring
DispatcherServlet.

Expose Spring beans for remoting by namespace
TRADITIONAL BLAZE DS WAY

The BlazeDS configuration first imports the 'remoting-config.xml',The parameters in the URL 'server.name' and
    'server.port' are supplied by the Flex runtime. The 'context.root' parameter needs to be supplied during
    compilation using the 'context-root' compiler option.
    services-config.xml
    <?xml version="1.0" encoding="UTF-8"?>
    <services-config>
       <services>
        <service-include file-path="remoting-config.xml" />
          <default-channels>
            <channel ref="person-amf"/>
          </default-channels>
       </services>
       <channels>
          <channel-definition id="person-amf" class="mx.messaging.channels.AMFChannel">
             <endpoint url="http://{server.name}:{server.port}/{context.root}/spring/messagebroker/amf"
    class="flex.messaging.endpoints.AMFEndpoint"/>
          </channel-definition>
       </channels>
    </services-config>
SPRING BLAZEDS INTEGRATION
Example:
 WEB.XML
 Spring BlazeDS Integration servlet
   <servlet>
      <servlet-name>spring-flex</servlet-name>
      <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
      <init-param>
        <param-name>contextConfigLocation</param-name>

        <param-value>/WEB-INF/flex-servlet-context.xml</param-value>
      </init-param>
      <load-on-startup>1</load-on-startup>
   </servlet>
 Mapping Spring BlazeDS Integration servlet to handle all requests to '/spring/*
   <servlet-mapping>
      <servlet-name>spring-flex</servlet-name>
      <url-pattern>/spring/*</url-pattern>
   </servlet-mapping>
SPRING BLAZE DS EXAMPLE
flex-servlet-context.xml
<?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="
    http://www.w3.org/2001/XMLSchema-instance"
    xmlns:p="http://www.springframework.org/schema/p"
    xmlns:context="http://www.springframework.org/schema/context"
    xmlns:flex="http://www.springframework.org/schema/flex"
    xsi:schemaLocation="http://www.springframework.org/schema/beans
    http://www.springframework.org/schema/beans/spring-beans.xsd
    http://www.springframework.org/schema/context
    http://www.springframework.org/schema/context/spring-context.xsd
    http://www.springframework.org/schema/flex
    http://www.springframework.org/schema/flex/spring-flex-1.0.xsd">
  <context:component-scan base-package="org.springbyexample.web.service" />
  <flex:message-broker/> ----Spring BlazeDS Integration configuration of the BlazeDS message broker, which
     handles remoting and messaging requests.
 <flex:remoting-destination ref="personDao" /> ---Exposes the personDao bean as a BlazeDS remoting destination
</beans>
SPRING BLAZEDS INTEGRATION
 PersonService.java
     @Service
     @RemotingDestination
     public class PersonService {
        private final PersonDao personDao;
        /**
         * Constructor
         */
        @Autowired
        public PersonService(PersonDao personDao) {
            this.personDao = personDao;
        }
        public void remove(int id) {
            Person person = personDao.findPersonById(id);
            personDao.delete(person);
        }
     }
 PersonDeleteCommand.as
          var ro:RemoteObject = new RemoteObject("personDao");
          ro.remove(id);
          ro.addEventListener(ResultEvent.RESULT, updateSearch);
Cairngorm with UM Extensions

    Universal Mind Cairngorm Extensions
( UM – CGX is easy to migrate from CG)

    Event – Business logic combined together

    Command logic can be aggregated to
    context-specific   command        classes
    (minimizes the number of classes)

    Support for easy queue of delegate calls
    (SequenceGenerator)
Cairngorm with UM Extensions

    Create Responder in view

    Add responder to event

    Cache/Store responder from event to
    command

    In Command, on success/failure call back
    these responders

    On view handle success/failure to control
    view states
BlazeDS
Cairngorm with UM Extensions
  View Layer       Model Layer            Control Layer

                    ModelLocator            via IResponder
                                                               tcp/ip
                   via databinding
    View                              Command       Delegate            Server
               via eventdispatching

                MVC Classic Usage
  View Layer                      Business Layer
  via IResponder                            via IResponder
                                                               tcp/ip

    View                              Command       Delegate            Server
                   via eventdispatching



               Using View Notifications
J2EE – DAO INTRODUCTION

    All database access in the system is made
    through a DAO to achieve encapsulation.

    Each DAO instance is responsible for one
    primary domain object or entity. If a domain
    object has an independent lifecycle, it should
    have its own DAO.

    The DAO is responsible for creations, reads (by
    primary key), updates, and deletions -- that
    is, CRUD -- on the domain object.
generic DAO
 For creating a new DAO we need →
a Hibernate mapping file,
a plain old Java interface,
and 10 lines in your Spring configuration
  file.

Resource:
http://www.ibm.com/developerworks/java/library/j-
   genericdao.html
CairnSpring
The CairnSpring includes both Caringorm UM,
 Generic DAO along with the Spring BlazeDS
                Integration.

       It also enables Paging request.

  http://www.code.google.com/p/cairnspring
RemoteObject
Channels                      Producer                Consumer          Dataservice




                                              NIO Long         NIO
              HTTP          NIO Polling                                    RTMP
                                               Polling      Streaming

                                                Long
              AMF             Polling                       Streaming    Piggyback
                                               Polling



           Messaging              Remoting               Data Mgmt
                                                                           Proxy
Services




                                                          Change
              Pub/Sub                   RPC
                                                          Tracking

           Real Time Push               AMF               Data Sync
                                                                            PDF
Adapters




              JMS             SQL              Java         Hibernate    ColdFusion


             WSRP             Spring          Security
QUESTIONS

More Related Content

PDF
Spring Cairngorm
devaraj ns
 
PDF
RIA With Flex & Java Using BlazeDS
Hien Luu
 
PPTX
Exchange 2013 ABC's: Architecture, Best Practices and Client Access
Microsoft TechNet - Belgium and Luxembourg
 
DOCX
KempHLB
Joe Williams III
 
PPT
Spring 3.1: a Walking Tour
Joshua Long
 
PDF
Web 2 And Application Delivery Public
Lori MacVittie
 
PDF
(ATS4-DEV04) Protocols as RESTful Services and RESTful URL Routing
BIOVIA
 
PDF
Integration of Web Service Stacks in an Esb
Wen Zhu
 
Spring Cairngorm
devaraj ns
 
RIA With Flex & Java Using BlazeDS
Hien Luu
 
Exchange 2013 ABC's: Architecture, Best Practices and Client Access
Microsoft TechNet - Belgium and Luxembourg
 
Spring 3.1: a Walking Tour
Joshua Long
 
Web 2 And Application Delivery Public
Lori MacVittie
 
(ATS4-DEV04) Protocols as RESTful Services and RESTful URL Routing
BIOVIA
 
Integration of Web Service Stacks in an Esb
Wen Zhu
 

What's hot (19)

PPTX
Exchange Server 2013 Architecture Deep Dive, Part 2
Microsoft TechNet - Belgium and Luxembourg
 
PPTX
(ATS3-PLAT01) Recent developments in Pipeline Pilot
BIOVIA
 
PDF
Cloud Foundry Anniversary: Technical Slides
marklucovsky
 
PPTX
Exchange Server 2013 Architecture Deep Dive, Part 1
Microsoft TechNet - Belgium and Luxembourg
 
PDF
Blaze Ds Slides
michael.labriola
 
PPTX
Enterprise Service Bus Part 2
Return on Intelligence
 
PDF
Dave Carroll Application Services Salesforce
deimos
 
PDF
Shalini xs10
The Linux Foundation
 
PDF
Plongée en eaux profondes dans l'architecture du nouvel Exchange 2013
Microsoft Décideurs IT
 
PDF
6 develop web20_with_rad-tim_frnacis_sarika-s
IBM
 
PPTX
3 customer presentation
StarTeamTVChannel
 
PDF
Oracle OSB Tutorial 2
Rakesh Gujjarlapudi
 
PPTX
Server 2008 R2 Yeniliklər
Texnologiya Azərbaycan
 
PDF
5 rqm gdd-sharmila-ramesh
IBM
 
PPTX
vFabric - Ideal Platform for SaaS Apps
VMware vFabric
 
PDF
Syer Monitoring Integration And Batch
Dave Syer
 
PPT
Classloader leak detection in websphere application server
Rohit Kelapure
 
PPT
Managing Enterprise Services through Service Versioning & Governance - Impact...
Prolifics
 
PPT
Kerberos: The Four Letter Word
Kenneth Maglio
 
Exchange Server 2013 Architecture Deep Dive, Part 2
Microsoft TechNet - Belgium and Luxembourg
 
(ATS3-PLAT01) Recent developments in Pipeline Pilot
BIOVIA
 
Cloud Foundry Anniversary: Technical Slides
marklucovsky
 
Exchange Server 2013 Architecture Deep Dive, Part 1
Microsoft TechNet - Belgium and Luxembourg
 
Blaze Ds Slides
michael.labriola
 
Enterprise Service Bus Part 2
Return on Intelligence
 
Dave Carroll Application Services Salesforce
deimos
 
Shalini xs10
The Linux Foundation
 
Plongée en eaux profondes dans l'architecture du nouvel Exchange 2013
Microsoft Décideurs IT
 
6 develop web20_with_rad-tim_frnacis_sarika-s
IBM
 
3 customer presentation
StarTeamTVChannel
 
Oracle OSB Tutorial 2
Rakesh Gujjarlapudi
 
Server 2008 R2 Yeniliklər
Texnologiya Azərbaycan
 
5 rqm gdd-sharmila-ramesh
IBM
 
vFabric - Ideal Platform for SaaS Apps
VMware vFabric
 
Syer Monitoring Integration And Batch
Dave Syer
 
Classloader leak detection in websphere application server
Rohit Kelapure
 
Managing Enterprise Services through Service Versioning & Governance - Impact...
Prolifics
 
Kerberos: The Four Letter Word
Kenneth Maglio
 
Ad

Viewers also liked (6)

PPTX
Best Apps and Websites for Classroom Management
Karen VItek
 
PPT
Introduction to ClassDojo
ClassDojo
 
PPT
About ClassDojo
ClassDojo
 
PPTX
Presentación class dojo
Héctor Pino
 
PPSX
elektronik portfolyo nedir nasıl hazırlanır
Merve Şimşek
 
PPT
ClassDojo PD
ClassDojo
 
Best Apps and Websites for Classroom Management
Karen VItek
 
Introduction to ClassDojo
ClassDojo
 
About ClassDojo
ClassDojo
 
Presentación class dojo
Héctor Pino
 
elektronik portfolyo nedir nasıl hazırlanır
Merve Şimşek
 
ClassDojo PD
ClassDojo
 
Ad

Similar to BlazeDS (20)

PDF
Giorgio Natilli - Blaze DS Connectivity Framework
360|Conferences
 
PDF
Building Flexible APIs for Web 2.x/Cloud Applications (JavaOne 2011 Session ...
Raymond Feng
 
PDF
Jeremy Spring Source Blaze Ds
Skills Matter
 
PDF
Google App Engine At A Glance
Stefan Christoph
 
PDF
What's new in the OSGi 4.2 Enterprise Release
David Bosschaert
 
PDF
Domino OSGi Development
Paul Fiore
 
PPT
Flex And Java Integration
ravinxg
 
PDF
Make easier Integration of your services with Fuse Solutions - RedHat 2013
Charles Moulliard
 
PDF
Spark IT 2011 - Java EE 6 Workshop
Arun Gupta
 
PPT
Flex And Java Integration
rssharma
 
PDF
Ria Spring Blaze Ds
Skills Matter
 
PDF
New Flash Builder 4 WSDL and HTTP Connectors
rtretola
 
PDF
Introducing spring
Ernesto Hernández Rodríguez
 
PDF
Atlas LBaaS overview
jameslinov
 
PPT
internet
jocker0080
 
PDF
2009 02 26 Metro Glass Fish Webinar
Eduardo Pelegri-Llopart
 
PDF
Turmeric SOA Cloud Mashups
kingargyle
 
ZIP
Celix, Universal OSGi?
abroekhuis
 
PDF
Introduction to Apache Camel
FuseSource.com
 
ODP
Java EE and Glassfish
Carol McDonald
 
Giorgio Natilli - Blaze DS Connectivity Framework
360|Conferences
 
Building Flexible APIs for Web 2.x/Cloud Applications (JavaOne 2011 Session ...
Raymond Feng
 
Jeremy Spring Source Blaze Ds
Skills Matter
 
Google App Engine At A Glance
Stefan Christoph
 
What's new in the OSGi 4.2 Enterprise Release
David Bosschaert
 
Domino OSGi Development
Paul Fiore
 
Flex And Java Integration
ravinxg
 
Make easier Integration of your services with Fuse Solutions - RedHat 2013
Charles Moulliard
 
Spark IT 2011 - Java EE 6 Workshop
Arun Gupta
 
Flex And Java Integration
rssharma
 
Ria Spring Blaze Ds
Skills Matter
 
New Flash Builder 4 WSDL and HTTP Connectors
rtretola
 
Introducing spring
Ernesto Hernández Rodríguez
 
Atlas LBaaS overview
jameslinov
 
internet
jocker0080
 
2009 02 26 Metro Glass Fish Webinar
Eduardo Pelegri-Llopart
 
Turmeric SOA Cloud Mashups
kingargyle
 
Celix, Universal OSGi?
abroekhuis
 
Introduction to Apache Camel
FuseSource.com
 
Java EE and Glassfish
Carol McDonald
 

Recently uploaded (20)

PPTX
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
PDF
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PDF
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
PPTX
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
PDF
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
REPORT: Heating appliances market in Poland 2024
SPIUG
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
PPTX
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
PDF
Beyond Automation: The Role of IoT Sensor Integration in Next-Gen Industries
Rejig Digital
 
ChatGPT's Deck on The Enduring Legacy of Fax Machines
Greg Swan
 
BLW VOCATIONAL TRAINING SUMMER INTERNSHIP REPORT
codernjn73
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
A Strategic Analysis of the MVNO Wave in Emerging Markets.pdf
IPLOOK Networks
 
A Day in the Life of Location Data - Turning Where into How.pdf
Precisely
 
The-Ethical-Hackers-Imperative-Safeguarding-the-Digital-Frontier.pptx
sujalchauhan1305
 
NewMind AI Weekly Chronicles - July'25 - Week IV
NewMind AI
 
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
Francisco Vieira Júnior
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
REPORT: Heating appliances market in Poland 2024
SPIUG
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
SparkLabs Primer on Artificial Intelligence 2025
SparkLabs Group
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Google I/O Extended 2025 Baku - all ppts
HusseinMalikMammadli
 
OA presentation.pptx OA presentation.pptx
pateldhruv002338
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
Artjoker Software Development Company
 
Beyond Automation: The Role of IoT Sensor Integration in Next-Gen Industries
Rejig Digital
 

BlazeDS

  • 1. Integration of Spring with Blaze DS and Cairngorm UM Deepdive by N.S.Devaraj http://nsdevaraj.wordpress.com/ twitter : @nsdevaraj
  • 2. Agenda for this season  What is Spring?  Why Spring with Flex?  Why Spring BlazeDS Integration?  What is & Why Cairngorm UM?  What is & why generic DAO?  What is & Why CairnSpring?
  • 3. WHAT IS SPRING? The result is looser coupling between components. The Spring IoC container has proven to be a solid foundation for building robust enterprise applications. ` The components managed by the Spring IoC container are called Spring beans.
  • 4. WHAT IS SPRING? The Spring framework includes several other modules in addition to its core IoC container. http://www.springframework.org.
  • 5. WHY WE NEED FLEX ACCESS SPRING? Flex is the obvious choice when a Spring Developer is looking at RIA. Can reuse your server-side Spring to move into RIA.
  • 6. WHY WE NEED FLEX ACCESS SPRING? In scenario of the Remoting and Data Management Services approaches: It enable the tightest integration with Spring. There is no need to transform data, or to expose services in a certain way: the Flex application works directly with the beans registered in the Spring IoC container.
  • 7. WHY WE NEED FLEX ACCESS SPRING? The BlazeDS Remoting enables binding your valueobjects with Java pojo Classes easily by metadata [RemoteClass(alias=”com.adobe.pojo.ob”] By using the Spring Security 2.0 we can make our application secured for transactions.
  • 8. WHAT is BlazeDS? BlazeDS provides a set of services that lets you connect a client-side application to server-side data, and pass data among multiple clients connected to the server. BlazeDS implements real-time messaging between clients. Browser application or AIR .swf http(s) domain blazeds server External Remote Services Service Procedure Messaging Proxy Calls
  • 9. BlazeDS Server servlet /{context}/messagebroker/* core config proxy-config.xml config config messaging-config.xml services-config.xml config flex remote-config.xml domain library config .jar .class Classes Lib
  • 10. BLAZE DS WAY Using the “dependency lookup” approach of the SpringFactory feels opposite to the "Spring Way" The burden of configuration is multiplied. Potential for deep integration beyond just remoting is limited.
  • 11. BLAZEDS SPRING INTEGRATION Bootstrap the BlazeDS MessageBroker as a Spring-managed bean (no more web.xml or MessageBrokerServlet config needed). Route http-based Flex messages to the MessageBroker through the Spring DispatcherServlet. Expose Spring beans for remoting by namespace
  • 12. TRADITIONAL BLAZE DS WAY The BlazeDS configuration first imports the 'remoting-config.xml',The parameters in the URL 'server.name' and 'server.port' are supplied by the Flex runtime. The 'context.root' parameter needs to be supplied during compilation using the 'context-root' compiler option. services-config.xml <?xml version="1.0" encoding="UTF-8"?> <services-config> <services> <service-include file-path="remoting-config.xml" /> <default-channels> <channel ref="person-amf"/> </default-channels> </services> <channels> <channel-definition id="person-amf" class="mx.messaging.channels.AMFChannel"> <endpoint url="http://{server.name}:{server.port}/{context.root}/spring/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/> </channel-definition> </channels> </services-config>
  • 13. SPRING BLAZEDS INTEGRATION Example: WEB.XML Spring BlazeDS Integration servlet <servlet> <servlet-name>spring-flex</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/flex-servlet-context.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> Mapping Spring BlazeDS Integration servlet to handle all requests to '/spring/* <servlet-mapping> <servlet-name>spring-flex</servlet-name> <url-pattern>/spring/*</url-pattern> </servlet-mapping>
  • 14. SPRING BLAZE DS EXAMPLE flex-servlet-context.xml <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:flex="http://www.springframework.org/schema/flex" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/flex http://www.springframework.org/schema/flex/spring-flex-1.0.xsd"> <context:component-scan base-package="org.springbyexample.web.service" /> <flex:message-broker/> ----Spring BlazeDS Integration configuration of the BlazeDS message broker, which handles remoting and messaging requests. <flex:remoting-destination ref="personDao" /> ---Exposes the personDao bean as a BlazeDS remoting destination </beans>
  • 15. SPRING BLAZEDS INTEGRATION PersonService.java @Service @RemotingDestination public class PersonService { private final PersonDao personDao; /** * Constructor */ @Autowired public PersonService(PersonDao personDao) { this.personDao = personDao; } public void remove(int id) { Person person = personDao.findPersonById(id); personDao.delete(person); } } PersonDeleteCommand.as var ro:RemoteObject = new RemoteObject("personDao"); ro.remove(id); ro.addEventListener(ResultEvent.RESULT, updateSearch);
  • 16. Cairngorm with UM Extensions  Universal Mind Cairngorm Extensions ( UM – CGX is easy to migrate from CG)  Event – Business logic combined together  Command logic can be aggregated to context-specific command classes (minimizes the number of classes)  Support for easy queue of delegate calls (SequenceGenerator)
  • 17. Cairngorm with UM Extensions  Create Responder in view  Add responder to event  Cache/Store responder from event to command  In Command, on success/failure call back these responders  On view handle success/failure to control view states
  • 19. Cairngorm with UM Extensions View Layer Model Layer Control Layer ModelLocator via IResponder tcp/ip via databinding View Command Delegate Server via eventdispatching MVC Classic Usage View Layer Business Layer via IResponder via IResponder tcp/ip View Command Delegate Server via eventdispatching Using View Notifications
  • 20. J2EE – DAO INTRODUCTION  All database access in the system is made through a DAO to achieve encapsulation.  Each DAO instance is responsible for one primary domain object or entity. If a domain object has an independent lifecycle, it should have its own DAO.  The DAO is responsible for creations, reads (by primary key), updates, and deletions -- that is, CRUD -- on the domain object.
  • 21. generic DAO For creating a new DAO we need → a Hibernate mapping file, a plain old Java interface, and 10 lines in your Spring configuration file. Resource: http://www.ibm.com/developerworks/java/library/j- genericdao.html
  • 22. CairnSpring The CairnSpring includes both Caringorm UM, Generic DAO along with the Spring BlazeDS Integration. It also enables Paging request. http://www.code.google.com/p/cairnspring
  • 23. RemoteObject Channels Producer Consumer Dataservice NIO Long NIO HTTP NIO Polling RTMP Polling Streaming Long AMF Polling Streaming Piggyback Polling Messaging Remoting Data Mgmt Proxy Services Change Pub/Sub RPC Tracking Real Time Push AMF Data Sync PDF Adapters JMS SQL Java Hibernate ColdFusion WSRP Spring Security