Flex on Java
eBook - ePub

Flex on Java

Bernerd Allmon, Jeremy Anderson

Condividi libro
  1. 264 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Flex on Java

Bernerd Allmon, Jeremy Anderson

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul 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.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Flex on Java è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Flex on Java di Bernerd Allmon, Jeremy Anderson in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Computer Science e Programming in Java. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Editore
Manning
Anno
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 ...

Indice dei contenuti