SlideShare una empresa de Scribd logo
1 de 46
Descargar para leer sin conexión
Taller de Spring 3, BlazeDS 4 y
                            Flex 4


                                Iván Álvarez (@ivanhoe)
                             Erick Camacho (@ecamacho)




Wednesday, October 6, 2010
Agenda
                    •        Instalación del ambiente

                    •        La aplicación

                    •        Introducción a Spring

                    •        Introducción a Flex

                    •        Introducción a DataServices

                    •        Comunicación Spring + Flex

                    •        Preguntas


Wednesday, October 6, 2010
Instalación del
                                 ambiente
               • Eclipse -> Descomprimir
               • Flash builder plugin -> Instalar
               • Repositorio local maven
               • Ejecutar script de ambiente:
                       Mac OS/X / Linux -> shell> . ./ambiente.sh
                       Windows -> command> ambiente.bat


Wednesday, October 6, 2010
Instalación del
                                 ambiente
                       Existen 2 proyectos Maven:
               • twitterds-solucion
               • twitterds-lab
                       en ambos: mvn eclipse:eclipse
                       Cargar proyectos en Eclipse



Wednesday, October 6, 2010
La aplicación

                       Cliente de Twitter
               • Backend Java + Spring
               • Frontend Adobe Flex



Wednesday, October 6, 2010
• Contenedor IoC (Inversión de Control)
                             usando Inyección de Dependencias.
                                  JVM




Wednesday, October 6, 2010
• Contenedor IoC (Inversión de Control)
                             usando Inyección de Dependencias.
                                  JVM




                                             Application
                                              Context


Wednesday, October 6, 2010
• Contenedor IoC (Inversión de Control)
                             usando Inyección de Dependencias.
                                  JVM
                                       Bean A



                                                Application
                                                 Context


Wednesday, October 6, 2010
• Contenedor IoC (Inversión de Control)
                             usando Inyección de Dependencias.
                                  JVM
                                       Bean A     Bean B



                                                Application
                                                 Context


Wednesday, October 6, 2010
• Contenedor IoC (Inversión de Control)
                             usando Inyección de Dependencias.
                                  JVM
                                       Bean A     Bean B

                                           Bean C
                                                Application
                                                 Context


Wednesday, October 6, 2010
• Contenedor IoC (Inversión de Control)
                             usando Inyección de Dependencias.
                                  JVM
                                       Bean A     Bean B

                                           Bean C
                                                Application
                                                 Context


Wednesday, October 6, 2010
• Contenedor IoC (Inversión de Control)
                             usando Inyección de Dependencias.
                                  JVM
                                       Bean A     Bean B

                                           Bean C
                                                Application
                                                 Context


Wednesday, October 6, 2010
• Spring se encarga de crear los objetos e
                             inyectar sus dependencias.
                    • Los objetos son creados en el orden
                             correcto basados en sus dependencias




Wednesday, October 6, 2010
• Spring se encarga de crear los objetos e
                             inyectar sus dependencias.
                    • Los objetos son creados en el orden
                             correcto basados en sus dependencias


                                            Bean C




Wednesday, October 6, 2010
• Spring se encarga de crear los objetos e
                             inyectar sus dependencias.
                    • Los objetos son creados en el orden
                             correcto basados en sus dependencias
                                                 Bean B

                                            Bean C




Wednesday, October 6, 2010
• Spring se encarga de crear los objetos e
                             inyectar sus dependencias.
                    • Los objetos son creados en el orden
                             correcto basados en sus dependencias
                                                 Bean B

                                            Bean C




Wednesday, October 6, 2010
• Spring se encarga de crear los objetos e
                             inyectar sus dependencias.
                    • Los objetos son creados en el orden
                             correcto basados en sus dependencias
                                        Bean A   Bean B

                                             Bean C




Wednesday, October 6, 2010
• Spring se encarga de crear los objetos e
                             inyectar sus dependencias.
                    • Los objetos son creados en el orden
                             correcto basados en sus dependencias
                                        Bean A   Bean B

                                             Bean C




Wednesday, October 6, 2010
La inyección se realiza vía constructor:

               •       BeanC beanC = new BeanC();

               •       BeanB beanB = new BeanB( beanC );
                       O vía Setter:

               •       BeanC beanc = new BeanC();

               •       BeanB beanB = new BeanB( );

               •       beanB.setBeanC( beanC );




Wednesday, October 6, 2010
Application Context:
               • Definición de Beans y sus dependencias
               • Beans de infraestructura
               • Definido en uno o más archivos .xml


Wednesday, October 6, 2010
Application Context:
               • Instanciado mediante: new
                       ClassPathXmlApplicationContext()
               • Cargado mediante un Servlet Listener
               • En Pruebas JUnit usando un Runner de
                       Spring.



Wednesday, October 6, 2010
LABORATORIO 1:
                       1. Completar el código de
                       TwitterSendMessageServiceImpl.
                       2. Cargar el servicio como un Spring Bean
                       (services.xml) y descomenta la declaración de JMS
                       en jms-config.xml
                       3. Completar la prueba de integración y ejecutarla




Wednesday, October 6, 2010
LABORATORIO 1:
                     4. Comprueba que todo funcione:
                     mvn install -o
                     5. Levanta jetty:
                     mvn jetty:run -o
                     6. Aplicación en
                     http://localhost:9090/twitterds-lab-webapp



Wednesday, October 6, 2010
Wednesday, October 6, 2010
Wednesday, October 6, 2010
Wednesday, October 6, 2010
Wednesday, October 6, 2010
Flash Builder




Wednesday, October 6, 2010
LABORATORIO




Wednesday, October 6, 2010
¿Flex + Java?
                                                         Cliente FLEX




                               SOAP          HTTP                AMF
                             WebServices   WebServices       RemoteServices   JavaScript Bridge




                                           JEE Backend                          Página HTML




Wednesday, October 6, 2010
¿AMF ?
               • ActionScript Message Format
               • Flash Player 6: AMF 0
               • Flash Player 9: AMF 3
               • Especificación abierta desde 2007

Wednesday, October 6, 2010
¿Por qué AMF?




                             •   http://www.jamesward.com/census/
Wednesday, October 6, 2010
AMF Remote Services




Wednesday, October 6, 2010
Java Players


               • Adobe LiveCycle ES -> $$
               • Adobe BlazeDS -> opensource
               • GraniteDS -> opensource


Wednesday, October 6, 2010
Wednesday, October 6, 2010
+



               • Spring Factory: Un adapter más
               • Spring BlazeDS: Integra el Message Broker
                       Servlet de BlazeDS a Spring.




Wednesday, October 6, 2010
+

               • Configuración en un application context vía
                       el namespace flex
               • Configuración de servicios mediante
                       anotaciones
               • Integración con Spring Security
               • Integración con JMS

Wednesday, October 6, 2010
+


                             JVM

                                   Bean A     Bean B

                                        Bean C
                                            Application
                                             Context


Wednesday, October 6, 2010
+


                             JVM
                                       BlazeDS
                                   Bean A     Bean B

                                        Bean C
                                            Application
                                             Context


Wednesday, October 6, 2010
+


                             JVM
                                       BlazeDS
                                   Bean A     Bean B

                                        Bean C
                                            Application
                                             Context


Wednesday, October 6, 2010
+


                             JVM
                                       BlazeDS
                                   Bean A     Bean B

                                        Bean C
                                            Application
                                             Context


Wednesday, October 6, 2010
+


                             JVM
                                       BlazeDS
                                   Bean A     Bean B

                                        Bean C
                                            Application
                                             Context


Wednesday, October 6, 2010
+
                                  Laboratorio Spring BlazeDS

                             •Abrir web.xml, agregar configuración.
                             •Agregar anotaciones a Servicios
                             •Levantar aplicación web
                             •Probar con jconsole



Wednesday, October 6, 2010
+


                  Laboratorio Flex: Consumir servicios BlazeDS




Wednesday, October 6, 2010
Links
               •       BlazeDS: http://opensource.adobe.com/wiki/display/
                       blazeds/BlazeDS/

               •       Spring BlazeDS: http://www.springsource.org/spring-
                       flex

               •       RIAHispano: http://www.riahispano.org

               •       LiveData UG Mexico http://groups.adobe.com/
                       groups/f2f48b1925/summary

               •       Jeremy Grelle: @jeremyg484

               •       http://flexblog.faratasystems.com/2006/11/12/
                       comparing-the-syntax-of-java-5-and-actionscript-3

Wednesday, October 6, 2010
Preguntas




                                 ¿?




Wednesday, October 6, 2010

Más contenido relacionado

Destacado

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Destacado (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Taller spring flex

  • 1. Taller de Spring 3, BlazeDS 4 y Flex 4 Iván Álvarez (@ivanhoe) Erick Camacho (@ecamacho) Wednesday, October 6, 2010
  • 2. Agenda • Instalación del ambiente • La aplicación • Introducción a Spring • Introducción a Flex • Introducción a DataServices • Comunicación Spring + Flex • Preguntas Wednesday, October 6, 2010
  • 3. Instalación del ambiente • Eclipse -> Descomprimir • Flash builder plugin -> Instalar • Repositorio local maven • Ejecutar script de ambiente: Mac OS/X / Linux -> shell> . ./ambiente.sh Windows -> command> ambiente.bat Wednesday, October 6, 2010
  • 4. Instalación del ambiente Existen 2 proyectos Maven: • twitterds-solucion • twitterds-lab en ambos: mvn eclipse:eclipse Cargar proyectos en Eclipse Wednesday, October 6, 2010
  • 5. La aplicación Cliente de Twitter • Backend Java + Spring • Frontend Adobe Flex Wednesday, October 6, 2010
  • 6. • Contenedor IoC (Inversión de Control) usando Inyección de Dependencias. JVM Wednesday, October 6, 2010
  • 7. • Contenedor IoC (Inversión de Control) usando Inyección de Dependencias. JVM Application Context Wednesday, October 6, 2010
  • 8. • Contenedor IoC (Inversión de Control) usando Inyección de Dependencias. JVM Bean A Application Context Wednesday, October 6, 2010
  • 9. • Contenedor IoC (Inversión de Control) usando Inyección de Dependencias. JVM Bean A Bean B Application Context Wednesday, October 6, 2010
  • 10. • Contenedor IoC (Inversión de Control) usando Inyección de Dependencias. JVM Bean A Bean B Bean C Application Context Wednesday, October 6, 2010
  • 11. • Contenedor IoC (Inversión de Control) usando Inyección de Dependencias. JVM Bean A Bean B Bean C Application Context Wednesday, October 6, 2010
  • 12. • Contenedor IoC (Inversión de Control) usando Inyección de Dependencias. JVM Bean A Bean B Bean C Application Context Wednesday, October 6, 2010
  • 13. • Spring se encarga de crear los objetos e inyectar sus dependencias. • Los objetos son creados en el orden correcto basados en sus dependencias Wednesday, October 6, 2010
  • 14. • Spring se encarga de crear los objetos e inyectar sus dependencias. • Los objetos son creados en el orden correcto basados en sus dependencias Bean C Wednesday, October 6, 2010
  • 15. • Spring se encarga de crear los objetos e inyectar sus dependencias. • Los objetos son creados en el orden correcto basados en sus dependencias Bean B Bean C Wednesday, October 6, 2010
  • 16. • Spring se encarga de crear los objetos e inyectar sus dependencias. • Los objetos son creados en el orden correcto basados en sus dependencias Bean B Bean C Wednesday, October 6, 2010
  • 17. • Spring se encarga de crear los objetos e inyectar sus dependencias. • Los objetos son creados en el orden correcto basados en sus dependencias Bean A Bean B Bean C Wednesday, October 6, 2010
  • 18. • Spring se encarga de crear los objetos e inyectar sus dependencias. • Los objetos son creados en el orden correcto basados en sus dependencias Bean A Bean B Bean C Wednesday, October 6, 2010
  • 19. La inyección se realiza vía constructor: • BeanC beanC = new BeanC(); • BeanB beanB = new BeanB( beanC ); O vía Setter: • BeanC beanc = new BeanC(); • BeanB beanB = new BeanB( ); • beanB.setBeanC( beanC ); Wednesday, October 6, 2010
  • 20. Application Context: • Definición de Beans y sus dependencias • Beans de infraestructura • Definido en uno o más archivos .xml Wednesday, October 6, 2010
  • 21. Application Context: • Instanciado mediante: new ClassPathXmlApplicationContext() • Cargado mediante un Servlet Listener • En Pruebas JUnit usando un Runner de Spring. Wednesday, October 6, 2010
  • 22. LABORATORIO 1: 1. Completar el código de TwitterSendMessageServiceImpl. 2. Cargar el servicio como un Spring Bean (services.xml) y descomenta la declaración de JMS en jms-config.xml 3. Completar la prueba de integración y ejecutarla Wednesday, October 6, 2010
  • 23. LABORATORIO 1: 4. Comprueba que todo funcione: mvn install -o 5. Levanta jetty: mvn jetty:run -o 6. Aplicación en http://localhost:9090/twitterds-lab-webapp Wednesday, October 6, 2010
  • 30. ¿Flex + Java? Cliente FLEX SOAP HTTP AMF WebServices WebServices RemoteServices JavaScript Bridge JEE Backend Página HTML Wednesday, October 6, 2010
  • 31. ¿AMF ? • ActionScript Message Format • Flash Player 6: AMF 0 • Flash Player 9: AMF 3 • Especificación abierta desde 2007 Wednesday, October 6, 2010
  • 32. ¿Por qué AMF? • http://www.jamesward.com/census/ Wednesday, October 6, 2010
  • 34. Java Players • Adobe LiveCycle ES -> $$ • Adobe BlazeDS -> opensource • GraniteDS -> opensource Wednesday, October 6, 2010
  • 36. + • Spring Factory: Un adapter más • Spring BlazeDS: Integra el Message Broker Servlet de BlazeDS a Spring. Wednesday, October 6, 2010
  • 37. + • Configuración en un application context vía el namespace flex • Configuración de servicios mediante anotaciones • Integración con Spring Security • Integración con JMS Wednesday, October 6, 2010
  • 38. + JVM Bean A Bean B Bean C Application Context Wednesday, October 6, 2010
  • 39. + JVM BlazeDS Bean A Bean B Bean C Application Context Wednesday, October 6, 2010
  • 40. + JVM BlazeDS Bean A Bean B Bean C Application Context Wednesday, October 6, 2010
  • 41. + JVM BlazeDS Bean A Bean B Bean C Application Context Wednesday, October 6, 2010
  • 42. + JVM BlazeDS Bean A Bean B Bean C Application Context Wednesday, October 6, 2010
  • 43. + Laboratorio Spring BlazeDS •Abrir web.xml, agregar configuración. •Agregar anotaciones a Servicios •Levantar aplicación web •Probar con jconsole Wednesday, October 6, 2010
  • 44. + Laboratorio Flex: Consumir servicios BlazeDS Wednesday, October 6, 2010
  • 45. Links • BlazeDS: http://opensource.adobe.com/wiki/display/ blazeds/BlazeDS/ • Spring BlazeDS: http://www.springsource.org/spring- flex • RIAHispano: http://www.riahispano.org • LiveData UG Mexico http://groups.adobe.com/ groups/f2f48b1925/summary • Jeremy Grelle: @jeremyg484 • http://flexblog.faratasystems.com/2006/11/12/ comparing-the-syntax-of-java-5-and-actionscript-3 Wednesday, October 6, 2010
  • 46. Preguntas ¿? Wednesday, October 6, 2010