Flex on Java
eBook - ePub

Flex on Java

Bernerd Allmon, Jeremy Anderson

Buch teilen
  1. 264 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfĂŒgbar
eBook - ePub

Flex on Java

Bernerd Allmon, Jeremy Anderson

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

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.

HĂ€ufig gestellte Fragen

Wie kann ich mein Abo kĂŒndigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kĂŒndigen“ – ganz einfach. Nachdem du gekĂŒndigt hast, bleibt deine Mitgliedschaft fĂŒr den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich BĂŒcher herunterladen?
Derzeit stehen all unsere auf MobilgerĂ€te reagierenden ePub-BĂŒcher zum Download ĂŒber die App zur VerfĂŒgung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die ĂŒbrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den AboplÀnen?
Mit beiden AboplÀnen erhÀltst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst fĂŒr LehrbĂŒcher, bei dem du fĂŒr weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhĂ€ltst. Mit ĂŒber 1 Million BĂŒchern zu ĂŒber 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
UnterstĂŒtzt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nÀchsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Flex on Java als Online-PDF/ePub verfĂŒgbar?
Ja, du hast Zugang zu Flex on Java von Bernerd Allmon, Jeremy Anderson im PDF- und/oder ePub-Format sowie zu anderen beliebten BĂŒchern aus Computer Science & Programming in Java. Aus unserem Katalog stehen dir ĂŒber 1 Million BĂŒcher zur VerfĂŒgung.

Information

Verlag
Manning
Jahr
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 ...

Inhaltsverzeichnis