Flex on Java
eBook - ePub

Flex on Java

Bernerd Allmon, Jeremy Anderson

Compartir libro
  1. 264 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Flex on Java

Bernerd Allmon, Jeremy Anderson

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

Unlike many Flex books that presume readers want to develop applications from scratch, Flex on Java is for developers in the real world-where Flex is one more technology being added to existing systems developed in Java, and where integration is the key indicator of success.Written for Java developers beginning to use Flex, Flex on Java shows how to use Flex alongside existing Java applications, and how to integrate Flex using familiar server-side technologies such as Spring, EJBs, JMS, and more. The authors, both Agile development experts, focus on Agile and test-driven development to enable readers to redesign applications that deliver more value and with zero defects. Throughout the book, readers will apply these techniques to refactoring a single application into a rich internet application using Flex and the BlazeDS framework. Purchase of the print book comes with an offer of a free PDF, ePub, and Kindle eBook from Manning. Also available is all code from the book.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Flex on Java un PDF/ePUB en línea?
Sí, puedes acceder a Flex on Java de Bernerd Allmon, Jeremy Anderson en formato PDF o ePUB, así como a otros libros populares de Computer Science y Programming in Java. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Editorial
Manning
Año
2010
ISBN
9781638354314

Part 1. Laying the foundation

Part 1 lays the foundation of Flex on Java by touring Flex, Java, and other supporting technologies that you will use throughout the book.
In these first four chapters, you will build a sample Java web application to use with numerous code examples throughout the book. The Java web application is built using a service-oriented architecture (SOA).
After making a whirlwind tour of Flex (chapter 1), your first step (chapter 2) is to create a Java application that will expose web services you will later use to connect to them from a Flex client.
In chapter 3, you will create a Flex application and words like AppFuse, Flex Mojos, and FNA enter your vocabulary.
The focus of chapter 4 is to continue building the client-side application and you will begin building a Flex client that will connect to the Java web services that you will choose to expose.

Chapter 1. Some Flex with your Java?

This chapter covers
  • A brief history of Java and Flex
  • A whirlwind tour of Flex
  • MXML and ActionScript
In 1995, Sun introduced the first Java platform and gave birth to the applet which allowed Java applications to run inside the browser with rich functionality and all the benefits of the Java framework, including connecting to the server side. The applet became hugely popular for a couple of years before its popularity waned mainly because of problems surrounding the browser plugin.
Macromedia embraced the idea of having a dedicated runtime environment for the browser, like the Java applet, and in 1997 released the Flash Player. Adobe has since taken over the rights to the Macromedia suite of products and helped to evolve what is now the Flex framework and development API.
Building features in an applet from scratch or even with other rich implementations can be expensive compared to the simplicity of using the Flex framework. Figure 1.1 displays a simple Java applet data grid next to a Flex data grid. The Flex data grid right out of the box not only looks better than the applet, it’s much more functional with much less code overhead. The Flex DataGrid and AdvancedDataGrid components provide built-in support for tasks such as sorting, dragging columns, row highlighting, data nesting, and styling.
Figure 1.1. Comparing a Java applet DataGrid (left) to a Flex Advanced DataGrid
The Flash runtime provides lightweight graphics and animation capabilities in manageable file sizes, making the player hugely successful across OSs and browser platforms. The Flash runtime allows for rich applications to have true stateful experiences and a high level of security.
Note
A stateful experience with Flex means that the client (Flex) will manage or remember everything it needs to without having to: submit to the server side, update and manage a session or request through HTTP, and refresh the client side with updated data after a submit with data from the session or request.
In general, Java developers have successfully leveraged the principles of object-oriented programming (OOP) to build extremely stable, testable, and extensible applications. Flex has become a rich internet application (RIA) solution for Java developers because it not only bridges the gap between a solid server side and a great UI, it is also built on top of OOP principles such as encapsulation, inheritance, and polymorphism.
These advantages benefit other technologies besides pure Java, as you’ll see in chapter 11, when we demonstrate Flex integration with Grails, one of the hottest web development platforms. We’ll build a simple contact management system and learn how to get rolling with Groovy and Grails development. Integrating Flex with Grails is in many respects easier than integrating Flex with Java.
Flex development is now bolstered by many of the benefits of Java-like frameworks for performing unit testing, functional testing, and continuous integration. The combination of Java and the Flex Software Development Kit (SDK) allows developers new to the business to start building applications immediately.
A thriving Flex open source community can offer Java developers GUI components as simple and as complex as required. Most of these custom components extend stock Flex objects found in the Flex SDK. Adobe made Flex 3 open source, and it now has numerous community resources. The Flex SDK with Adobe’s built-in charting components is still commercial.
We have chosen Flex 4 with Java because of the duality of a rich and stateful client in conjunction with a powerful server side. Also, Java is broadly used in the mainstream and is the existing server-side platform for many Flex migration projects. Although there are alternative ways for doing RIA development, Flex will most likely prove to be the superior RIA framework because of the simplicity and testability it provides to developers. We’re now ready to discuss some of Flex framework features.

1.1. A whirlwind tour of Flex

It’s time to take a peek at the components we’ll use throughout this book. We won’t go into too much detail about the components as that is beyond the scope of this book. Instead, we’ll focus on the usage of components and framework in real-world development.

1.1.1. MXML and ActionScript

At the heart of every Flex application you’ll find a combination of MXML files (XML files with the .mxml extension) and ActionScript classes. These two components are the basic building blocks of the Flex framework. The Flex compiler takes these files and creates a small web format (SWF) file, which is executed in the Flash Player.
MXML
MXML is an XML-based markup language similar to HTML/XHTML. The MXML syntax, used to declaratively define your application, has numerous tags for common UI objects, such as text input fields, radio buttons, and drop-down lists. It also has many UI components and layout components that are common in rich client development, such as menu bars, tabbed panels, data grids, and navigational trees. In addition, it’s possible to build custom components that extend existing ones or produce something completely different like the flow visualization chart. Figure 1.2, which was made with Degrafa, shows this function.
Figure 1.2. Flow visualization chart
In chapter 8 we’ll be covering the Degrafa drawing API for Flex to create a pie chart for a sample application.
ActionScript
ActionScript, and more ...

Índice