SlideShare ist ein Scribd-Unternehmen logo
1 von 35
Downloaden Sie, um offline zu lesen
ColdFusion, LCDS and Flex
          Magic
        Nick Kwiatkowski
   Michigan Flex Users Group
   & Michigan State University
About Me
• Manager of the Michigan Flex Users
  Group
• Work at Michigan State University, as a
  Telecom Manager
• Active member of the Flex and ColdFusion
  communities
• Avid mountain biker, general technology
  evanglist
So, magic you say?
• What if I told you that after the initial setup,
  you only had to use 4 lines of code to get
  data from your application server to your
  clients?
  – Sure, we’ve all seen the demo before, but do
    you really know how it works?
           » Ok… well, maybe a bit more than 4 lines of code, but
             well, 4 lines of code sounds sooo easy, you know?
The moving parts
• ColdFusion – This setup will work with
  Adobe ColdFusion (sorry, other vendors
  don’t work out of the box) versioned 7 and
  above. Version 8+ can have LCDS baked
  in.***
• LCDS – LiveCycle Data Services is a
  middleware application designed to move
  and manage large amounts of data.

 *** I can’t control what they do with ColdFusion “Next” but one
 would assume they won’t remove this 
The moving parts
• Flex – Any version of the Flex SDK over
  2.0.0 will work.
• Data – Any serializable data, including
  data from Databases, LDAP, email, FTP,
  Mapping software, web services, etc.
The Convoluted Mess of Stuff™

                Browser                       Java


 Flex or AJAX
  application                              ColdFusion
                          LiveCycle DS                         Data


     AIR                                      .NET
  Application


                                              PHP


Presentation Layer        Business Layer   Data-Access Layer
The Convoluted Mess of Stuff™

                Browser


 Flex or AJAX
  application                              ColdFusion
                          LiveCycle DS                         Data




Presentation Layer        Business Layer   Data-Access Layer
LCDS
• But, isn’t LiveCycle Data Services really,
  really expensive?
  – Yes, and no. There are three versions of
    LCDS you need to worry about:
     • BlazeDS – Open-sourced version of LCDS. Does
       not include Data Management feature we will be
       talking about
     • LiveCycle Data Services ES – J2EE application
       that Adobe sells that includes all the features of
       BlazeDS, plus DM, NIO messaging, etc.
LCDS
– LiveCycle Data Services ES Single-CPU
  License. (formerly LCDS Express Edition)
  • Free version of LCDS, that works on 1-CPU, and
    will not cluster. Can be used for dev, testing and
    production environments.
  • Baked right into the ColdFusion 8 download and
    install. (default is to install it!)
Data Management
• But, I heard that Flex SDK “Next” will be
  offering client-side data management!
  Why should I care about this?
  – Client-side data management is great for
    small bits of data, but not much else.
  – Cannot do things like Data Synchronization,
    Data Caching, and Conflict Resolution.
What LDS brings to the table…
• Data Management
  – Have your application server send large
    amounts of data to LDS, and let it worry about
    passing it to the client. This includes
    pagination of data, and data synchronization.




                                         App Server
  Flex Client          LDS
What LDS brings to the table…
• Data Messaging
  – Allows Flex clients to communicate with each
    other without tying up resources on the App
    server (the App server can participate in these
    conversations)

            Flex Client

                                        LDS   App Server

    AJAX Client


                          Flex Client
What LDS brings to the table…
• Data Proxying:
  – You can proxy your web-service or Remoting
    calls through your LDS to help get around
    restrictions in firewalls or policies.



                                  Web Service


  Flex Client      LDS

                                  App Server
DATA MANAGEMENT
EXAMPLE
Coding The Flex Side
• On the Flex side of this setup, there really
  isn’t a whole lot to do…
  – Create a new Collection (ArrayCollection) to
    store your data
  – Create a value object so that the data
    serializes properly (you will need to instantiate
    a copy of this VO, so the compiler includes it)
  – Utilize the DataService MXML tag, and call
    the fill(collection) function.
CODING A FLEX APP
Why it works
      • Data is packaged up
        into ‘Value Objects’,
        or packages of data.
        – This usually consists
          of a “row” of data from
          a database
      • Each VO is tracked
        separately as to who
        is viewing, editing,
        etc.
Why it works
• Users then Subscribe
  to a set of data.
   – LDS will then keep
     track of the state of
     that data, and send it
     from the Application
     Server to the Flex
     Application.
• LDS will ‘listen’ to any
  changes made to the
  data in the Flex
  Client.
Why it works
      • If the Collection that
        holds the data is
        changed in the client,
        LDS will take that
        change, change the
        Value Object in
        memory, send the
        change to the App
        server, and update all
        clients in real-time.
Why it works
• When an update is
  sent to the other
  clients, it will check its
  local copy, to make
  sure that record has
  not changed. If it has,
  it will issue a
  “Conflict” event, and
  allow the Client to
  choose what to do.
Why it works
      • On the Client, 95% of
        your work is handled
        by any of the
        Collection classes,
        such as the
        ArrayCollection
      • Handles updating
        LDS with Changes,
        and notifying other
        visual components of
        changes.
Why it works
• When a DataGrid, or
  InputBox broadcast
  the Change event, the
  ArrayCollection hears
  it, and updates its
  own data, and passes
  the change to other
  components that
  subscribe to its
  change event.
The “Secret Sauce”
• One of the more complicated, and “black
  box” things about LCDS (and BlazeDS for
  that matter) is the configuration files.
• The config files define two important
  things:
  – The Channels – Defines how data flows from
    the client to the server
  – The Destination – Defines the
    ‘namespace’ (think URL) for which the clients
    are listening.
The “Secret Sauce”
• Your configuration files are located at :
  – <ColdFusion Root>wwwrootWEB-INFFlex
• The master configuration file is services-
  config.xml
  – services-config also holds channel info
  – messaging-config.xml holds messaging config
  – data-management-config.xml holds DM config
  – remoting-config.xml holds Flash Remoting
    config
DIVING INTO THE
CONFIGURATION FILES
Channels? Destinations?
• There are lots of channels to choose from,
  each with their pluses and minuses.
  – AMF channels typically run over HTTP, so are
    often not blocked by firewalls.
     • Tend to be slower (polling), or designed for one-
       time polls.
     • Can be combined with HTTPS for security
  – RTMP channels run over port 2048
     • Real-time, quick, easy.
     • Firewalls have been known to block on occasion
Channels? Destinations?
• But don’t worry about choosing only a
  single channel! You can setup priorities so
  that your communication can degrade
  gracefully, but not impact client.
  – I typically use RTMP -> AMF Polling
• Each destination can define which
  channel(s) it wants to use.
• Each destination is just a name – but must
  be unique to the server.
ColdFusion Fun
• The final part of this puzzle is the
  ColdFusion side. While you technically
  can use just about any AMF powered
  language (PHP, .NET, Java), why would
  you?
• There are two aspects to the ColdFusion
  code.
  – Perform traditional CRUD requests to your
    data source
  – Allow un-solisited updates to Flex/LCDS
Traditional CRUD
• One of the requirements of having LCDS
  manage your ColdFusion Data, is a CFC
  that can handle basic CRUD requests.
  – fill() -- think of this as a “Get all”
  – get() -- this is to get a single item
  – sync() -- this performs create, delete, update
  – count() -- this needs to return the number of
    records (for paging, etc)
Unsolicited Updates
• One of the coolest features of LCDS
  hooked up with ColdFusion and Flex is the
  fact you can push out unsolicited updates
  to your clients.
  – Non-Flex client update data
  – Customer buys something from your store –
    update your dashboard
  – New email comes in.
Unsolicited Updates
• Creating Unsolicited updates are pretty
  easy… they involve three steps:
  – Create a new Event Gateway of type
    ‘DataManagement’
  – Create some sort of Value Object via a
    structure or CFC.
     • This structure must serialize the same as your
       managed data. Use the VO you created for your
       CRUD operations!
  – Pass this VO to the Event Gateway. The
    update will be pushed to your clients.
CODING THE COLDFUSION
CODE
Bringing it all together
• So, now we know how it all works, what
  are some good applications?
  – CRUD on a database (duh!)
  – Directory Watcher (dashboard)
  – Collaborative document management
  – E-Mail Client with data push
  – Collaborative GIS Application (spontaneous
    meetups!)
You can reach me at nick@theFlexGroup.org

THANK YOU!
Obligatory plugs for my peeps
• Interested in Flex, and Live in Michigan?
  – http://www.TheFlexGroup.org
  – Meets in Lansing, 2nd Thursdays of the Month
• Interested in ColdFusion?
  – http://www.coldFusion.org
  – Meets in Lansing, 2nd Tuesdays of the Month
• Interested in UX
  – http://www.michiganXD.com
  – Meets in Grand Rapids, 2nd Tuesday

Weitere ähnliche Inhalte

Mehr von 360|Conferences

Metaio Mobile Augmented Reality
Metaio Mobile Augmented RealityMetaio Mobile Augmented Reality
Metaio Mobile Augmented Reality360|Conferences
 
Mobile Apps- Business Toolkit for the Manager
Mobile Apps- Business Toolkit for the ManagerMobile Apps- Business Toolkit for the Manager
Mobile Apps- Business Toolkit for the Manager360|Conferences
 
Making Real Money with Mobile Apps
Making Real Money with Mobile AppsMaking Real Money with Mobile Apps
Making Real Money with Mobile Apps360|Conferences
 
Inside Mobile Widgets Publish
Inside Mobile Widgets PublishInside Mobile Widgets Publish
Inside Mobile Widgets Publish360|Conferences
 
Ignite Denver 4 Master Deck
Ignite Denver 4 Master DeckIgnite Denver 4 Master Deck
Ignite Denver 4 Master Deck360|Conferences
 
Oğuz Demirkapı - Hands On Training: Creating Our First i18N Flex Application ...
Oğuz	Demirkapı - Hands On Training: Creating Our First i18N Flex Application ...Oğuz	Demirkapı - Hands On Training: Creating Our First i18N Flex Application ...
Oğuz Demirkapı - Hands On Training: Creating Our First i18N Flex Application ...360|Conferences
 
Tyler Wright - Undo History with Flight
Tyler Wright - Undo History with FlightTyler Wright - Undo History with Flight
Tyler Wright - Undo History with Flight360|Conferences
 
Chad Udell - Developers are from Mars, Designers are from Venus
Chad Udell - Developers are from Mars, Designers are from VenusChad Udell - Developers are from Mars, Designers are from Venus
Chad Udell - Developers are from Mars, Designers are from Venus360|Conferences
 
Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!
Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!
Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!360|Conferences
 
Erik Loehfelm - Experience Design with Flash Catalyst and Flex Gumbo
Erik Loehfelm - Experience Design with Flash Catalyst and Flex GumboErik Loehfelm - Experience Design with Flash Catalyst and Flex Gumbo
Erik Loehfelm - Experience Design with Flash Catalyst and Flex Gumbo360|Conferences
 
Ryan Phelan - Bending and Flexing
Ryan Phelan - Bending and FlexingRyan Phelan - Bending and Flexing
Ryan Phelan - Bending and Flexing360|Conferences
 
Giorgio Natilli - Blaze DS Connectivity Framework
Giorgio Natilli - Blaze DS Connectivity FrameworkGiorgio Natilli - Blaze DS Connectivity Framework
Giorgio Natilli - Blaze DS Connectivity Framework360|Conferences
 
Douglas Knudsen - Great Mash Up
Douglas Knudsen - Great Mash UpDouglas Knudsen - Great Mash Up
Douglas Knudsen - Great Mash Up360|Conferences
 
Wes Leonardo - Putting AIR into your Application
Wes Leonardo - Putting AIR into your ApplicationWes Leonardo - Putting AIR into your Application
Wes Leonardo - Putting AIR into your Application360|Conferences
 
Samuel Asher Rivello - PureMVC Hands On Part 1
Samuel Asher Rivello - PureMVC Hands On Part 1Samuel Asher Rivello - PureMVC Hands On Part 1
Samuel Asher Rivello - PureMVC Hands On Part 1360|Conferences
 
Adrian Pomilio - Flex Ajax Bridge and Legacy Applications
Adrian Pomilio - Flex Ajax Bridge and Legacy ApplicationsAdrian Pomilio - Flex Ajax Bridge and Legacy Applications
Adrian Pomilio - Flex Ajax Bridge and Legacy Applications360|Conferences
 
Samuel Asher Rivello - PureMVC Hands On Part 2
Samuel Asher Rivello - PureMVC Hands On Part 2Samuel Asher Rivello - PureMVC Hands On Part 2
Samuel Asher Rivello - PureMVC Hands On Part 2360|Conferences
 

Mehr von 360|Conferences (20)

InsideMobile Keynote
InsideMobile KeynoteInsideMobile Keynote
InsideMobile Keynote
 
Metaio Mobile Augmented Reality
Metaio Mobile Augmented RealityMetaio Mobile Augmented Reality
Metaio Mobile Augmented Reality
 
Web Os Hands On
Web Os Hands OnWeb Os Hands On
Web Os Hands On
 
Mobile Apps- Business Toolkit for the Manager
Mobile Apps- Business Toolkit for the ManagerMobile Apps- Business Toolkit for the Manager
Mobile Apps- Business Toolkit for the Manager
 
Making Real Money with Mobile Apps
Making Real Money with Mobile AppsMaking Real Money with Mobile Apps
Making Real Money with Mobile Apps
 
Inside Mobile Widgets Publish
Inside Mobile Widgets PublishInside Mobile Widgets Publish
Inside Mobile Widgets Publish
 
You Know WebOS
You Know WebOSYou Know WebOS
You Know WebOS
 
Ignite Denver 4 Master Deck
Ignite Denver 4 Master DeckIgnite Denver 4 Master Deck
Ignite Denver 4 Master Deck
 
Oğuz Demirkapı - Hands On Training: Creating Our First i18N Flex Application ...
Oğuz	Demirkapı - Hands On Training: Creating Our First i18N Flex Application ...Oğuz	Demirkapı - Hands On Training: Creating Our First i18N Flex Application ...
Oğuz Demirkapı - Hands On Training: Creating Our First i18N Flex Application ...
 
Tyler Wright - Undo History with Flight
Tyler Wright - Undo History with FlightTyler Wright - Undo History with Flight
Tyler Wright - Undo History with Flight
 
Chad Udell - Developers are from Mars, Designers are from Venus
Chad Udell - Developers are from Mars, Designers are from VenusChad Udell - Developers are from Mars, Designers are from Venus
Chad Udell - Developers are from Mars, Designers are from Venus
 
Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!
Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!
Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!
 
Erik Loehfelm - Experience Design with Flash Catalyst and Flex Gumbo
Erik Loehfelm - Experience Design with Flash Catalyst and Flex GumboErik Loehfelm - Experience Design with Flash Catalyst and Flex Gumbo
Erik Loehfelm - Experience Design with Flash Catalyst and Flex Gumbo
 
Ryan Phelan - Bending and Flexing
Ryan Phelan - Bending and FlexingRyan Phelan - Bending and Flexing
Ryan Phelan - Bending and Flexing
 
Giorgio Natilli - Blaze DS Connectivity Framework
Giorgio Natilli - Blaze DS Connectivity FrameworkGiorgio Natilli - Blaze DS Connectivity Framework
Giorgio Natilli - Blaze DS Connectivity Framework
 
Douglas Knudsen - Great Mash Up
Douglas Knudsen - Great Mash UpDouglas Knudsen - Great Mash Up
Douglas Knudsen - Great Mash Up
 
Wes Leonardo - Putting AIR into your Application
Wes Leonardo - Putting AIR into your ApplicationWes Leonardo - Putting AIR into your Application
Wes Leonardo - Putting AIR into your Application
 
Samuel Asher Rivello - PureMVC Hands On Part 1
Samuel Asher Rivello - PureMVC Hands On Part 1Samuel Asher Rivello - PureMVC Hands On Part 1
Samuel Asher Rivello - PureMVC Hands On Part 1
 
Adrian Pomilio - Flex Ajax Bridge and Legacy Applications
Adrian Pomilio - Flex Ajax Bridge and Legacy ApplicationsAdrian Pomilio - Flex Ajax Bridge and Legacy Applications
Adrian Pomilio - Flex Ajax Bridge and Legacy Applications
 
Samuel Asher Rivello - PureMVC Hands On Part 2
Samuel Asher Rivello - PureMVC Hands On Part 2Samuel Asher Rivello - PureMVC Hands On Part 2
Samuel Asher Rivello - PureMVC Hands On Part 2
 

Kürzlich hochgeladen

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 

Kürzlich hochgeladen (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

Nick Kwiatkowski - Flex, CF, and LCDS Magic

  • 1. ColdFusion, LCDS and Flex Magic Nick Kwiatkowski Michigan Flex Users Group & Michigan State University
  • 2. About Me • Manager of the Michigan Flex Users Group • Work at Michigan State University, as a Telecom Manager • Active member of the Flex and ColdFusion communities • Avid mountain biker, general technology evanglist
  • 3. So, magic you say? • What if I told you that after the initial setup, you only had to use 4 lines of code to get data from your application server to your clients? – Sure, we’ve all seen the demo before, but do you really know how it works? » Ok… well, maybe a bit more than 4 lines of code, but well, 4 lines of code sounds sooo easy, you know?
  • 4. The moving parts • ColdFusion – This setup will work with Adobe ColdFusion (sorry, other vendors don’t work out of the box) versioned 7 and above. Version 8+ can have LCDS baked in.*** • LCDS – LiveCycle Data Services is a middleware application designed to move and manage large amounts of data. *** I can’t control what they do with ColdFusion “Next” but one would assume they won’t remove this 
  • 5. The moving parts • Flex – Any version of the Flex SDK over 2.0.0 will work. • Data – Any serializable data, including data from Databases, LDAP, email, FTP, Mapping software, web services, etc.
  • 6. The Convoluted Mess of Stuff™ Browser Java Flex or AJAX application ColdFusion LiveCycle DS Data AIR .NET Application PHP Presentation Layer Business Layer Data-Access Layer
  • 7. The Convoluted Mess of Stuff™ Browser Flex or AJAX application ColdFusion LiveCycle DS Data Presentation Layer Business Layer Data-Access Layer
  • 8. LCDS • But, isn’t LiveCycle Data Services really, really expensive? – Yes, and no. There are three versions of LCDS you need to worry about: • BlazeDS – Open-sourced version of LCDS. Does not include Data Management feature we will be talking about • LiveCycle Data Services ES – J2EE application that Adobe sells that includes all the features of BlazeDS, plus DM, NIO messaging, etc.
  • 9. LCDS – LiveCycle Data Services ES Single-CPU License. (formerly LCDS Express Edition) • Free version of LCDS, that works on 1-CPU, and will not cluster. Can be used for dev, testing and production environments. • Baked right into the ColdFusion 8 download and install. (default is to install it!)
  • 10. Data Management • But, I heard that Flex SDK “Next” will be offering client-side data management! Why should I care about this? – Client-side data management is great for small bits of data, but not much else. – Cannot do things like Data Synchronization, Data Caching, and Conflict Resolution.
  • 11. What LDS brings to the table… • Data Management – Have your application server send large amounts of data to LDS, and let it worry about passing it to the client. This includes pagination of data, and data synchronization. App Server Flex Client LDS
  • 12. What LDS brings to the table… • Data Messaging – Allows Flex clients to communicate with each other without tying up resources on the App server (the App server can participate in these conversations) Flex Client LDS App Server AJAX Client Flex Client
  • 13. What LDS brings to the table… • Data Proxying: – You can proxy your web-service or Remoting calls through your LDS to help get around restrictions in firewalls or policies. Web Service Flex Client LDS App Server
  • 15. Coding The Flex Side • On the Flex side of this setup, there really isn’t a whole lot to do… – Create a new Collection (ArrayCollection) to store your data – Create a value object so that the data serializes properly (you will need to instantiate a copy of this VO, so the compiler includes it) – Utilize the DataService MXML tag, and call the fill(collection) function.
  • 17. Why it works • Data is packaged up into ‘Value Objects’, or packages of data. – This usually consists of a “row” of data from a database • Each VO is tracked separately as to who is viewing, editing, etc.
  • 18. Why it works • Users then Subscribe to a set of data. – LDS will then keep track of the state of that data, and send it from the Application Server to the Flex Application. • LDS will ‘listen’ to any changes made to the data in the Flex Client.
  • 19. Why it works • If the Collection that holds the data is changed in the client, LDS will take that change, change the Value Object in memory, send the change to the App server, and update all clients in real-time.
  • 20. Why it works • When an update is sent to the other clients, it will check its local copy, to make sure that record has not changed. If it has, it will issue a “Conflict” event, and allow the Client to choose what to do.
  • 21. Why it works • On the Client, 95% of your work is handled by any of the Collection classes, such as the ArrayCollection • Handles updating LDS with Changes, and notifying other visual components of changes.
  • 22. Why it works • When a DataGrid, or InputBox broadcast the Change event, the ArrayCollection hears it, and updates its own data, and passes the change to other components that subscribe to its change event.
  • 23. The “Secret Sauce” • One of the more complicated, and “black box” things about LCDS (and BlazeDS for that matter) is the configuration files. • The config files define two important things: – The Channels – Defines how data flows from the client to the server – The Destination – Defines the ‘namespace’ (think URL) for which the clients are listening.
  • 24. The “Secret Sauce” • Your configuration files are located at : – <ColdFusion Root>wwwrootWEB-INFFlex • The master configuration file is services- config.xml – services-config also holds channel info – messaging-config.xml holds messaging config – data-management-config.xml holds DM config – remoting-config.xml holds Flash Remoting config
  • 26. Channels? Destinations? • There are lots of channels to choose from, each with their pluses and minuses. – AMF channels typically run over HTTP, so are often not blocked by firewalls. • Tend to be slower (polling), or designed for one- time polls. • Can be combined with HTTPS for security – RTMP channels run over port 2048 • Real-time, quick, easy. • Firewalls have been known to block on occasion
  • 27. Channels? Destinations? • But don’t worry about choosing only a single channel! You can setup priorities so that your communication can degrade gracefully, but not impact client. – I typically use RTMP -> AMF Polling • Each destination can define which channel(s) it wants to use. • Each destination is just a name – but must be unique to the server.
  • 28. ColdFusion Fun • The final part of this puzzle is the ColdFusion side. While you technically can use just about any AMF powered language (PHP, .NET, Java), why would you? • There are two aspects to the ColdFusion code. – Perform traditional CRUD requests to your data source – Allow un-solisited updates to Flex/LCDS
  • 29. Traditional CRUD • One of the requirements of having LCDS manage your ColdFusion Data, is a CFC that can handle basic CRUD requests. – fill() -- think of this as a “Get all” – get() -- this is to get a single item – sync() -- this performs create, delete, update – count() -- this needs to return the number of records (for paging, etc)
  • 30. Unsolicited Updates • One of the coolest features of LCDS hooked up with ColdFusion and Flex is the fact you can push out unsolicited updates to your clients. – Non-Flex client update data – Customer buys something from your store – update your dashboard – New email comes in.
  • 31. Unsolicited Updates • Creating Unsolicited updates are pretty easy… they involve three steps: – Create a new Event Gateway of type ‘DataManagement’ – Create some sort of Value Object via a structure or CFC. • This structure must serialize the same as your managed data. Use the VO you created for your CRUD operations! – Pass this VO to the Event Gateway. The update will be pushed to your clients.
  • 33. Bringing it all together • So, now we know how it all works, what are some good applications? – CRUD on a database (duh!) – Directory Watcher (dashboard) – Collaborative document management – E-Mail Client with data push – Collaborative GIS Application (spontaneous meetups!)
  • 34. You can reach me at nick@theFlexGroup.org THANK YOU!
  • 35. Obligatory plugs for my peeps • Interested in Flex, and Live in Michigan? – http://www.TheFlexGroup.org – Meets in Lansing, 2nd Thursdays of the Month • Interested in ColdFusion? – http://www.coldFusion.org – Meets in Lansing, 2nd Tuesdays of the Month • Interested in UX – http://www.michiganXD.com – Meets in Grand Rapids, 2nd Tuesday