(Ebook) Beginning Java and Flex: Migrating Java, Spring, Hibernate and Maven Developers to Adobe Flex (Expert's Voice in Web Development) by di Pisa, Filippo ISBN 9781430223856, 1430223855 2024 scribd download
(Ebook) Beginning Java and Flex: Migrating Java, Spring, Hibernate and Maven Developers to Adobe Flex (Expert's Voice in Web Development) by di Pisa, Filippo ISBN 9781430223856, 1430223855 2024 scribd download
com
OR CLICK HERE
DOWLOAD EBOOK
(Ebook) Biota Grow 2C gather 2C cook by Loucas, Jason; Viles, James ISBN
9781459699816, 9781743365571, 9781925268492, 1459699815, 1743365578, 1925268497
https://ebooknice.com/product/biota-grow-2c-gather-2c-cook-6661374
ebooknice.com
(Ebook) SAT II Success MATH 1C and 2C 2002 (Peterson's SAT II Success) by Peterson's
ISBN 9780768906677, 0768906679
https://ebooknice.com/product/sat-ii-success-math-1c-and-2c-2002-peterson-s-sat-
ii-success-1722018
ebooknice.com
(Ebook) Matematik 5000+ Kurs 2c Lärobok by Lena Alfredsson, Hans Heikne, Sanna
Bodemyr ISBN 9789127456600, 9127456609
https://ebooknice.com/product/matematik-5000-kurs-2c-larobok-23848312
ebooknice.com
(Ebook) Beginning JSP, JSF and Tomcat: Java Web Development (Expert's Voice in Java)
by Zambon, Giulio ISBN 9781430246237, 1430246235
https://ebooknice.com/product/beginning-jsp-jsf-and-tomcat-java-web-development-
expert-s-voice-in-java-55585798
ebooknice.com
(Ebook) Master SAT II Math 1c and 2c 4th ed (Arco Master the SAT Subject Test: Math
Levels 1 & 2) by Arco ISBN 9780768923049, 0768923042
https://ebooknice.com/product/master-sat-ii-math-1c-and-2c-4th-ed-arco-master-
the-sat-subject-test-math-levels-1-2-2326094
ebooknice.com
(Ebook) Cambridge IGCSE and O Level History Workbook 2C - Depth Study: the United
States, 1919-41 2nd Edition by Benjamin Harrison ISBN 9781398375147, 9781398375048,
1398375144, 1398375047
https://ebooknice.com/product/cambridge-igcse-and-o-level-history-
workbook-2c-depth-study-the-united-states-1919-41-2nd-edition-53538044
ebooknice.com
(Ebook) Flex Solutions: Essential Techniques for Flex 2 and 3 Developers by Marco
Casario ISBN 9781590598764, 1590598768
https://ebooknice.com/product/flex-solutions-essential-techniques-for-
flex-2-and-3-developers-1354994
ebooknice.com
https://ebooknice.com/product/flex-on-java-1405358
ebooknice.com
(Ebook) Enterprise Development with Flex: Best Practices for RIA Developers (Adobe
Dev Lib) by Yakov Fain, Victor Rasputnis, Anatole Tartakovsky ISBN 9780596154165,
059615416X
https://ebooknice.com/product/enterprise-development-with-flex-best-practices-
for-ria-developers-adobe-dev-lib-1339782
ebooknice.com
CYAN YELLOW
MAGENTA BLACK
PANTONE 123 C
Java Flex
The Adobe Flex Framework has been adopted by the Java community as the
Filippo di Pisa
preferred framework for Java RIAs development using Flash for the presenta-
tion layer. Flex helps Java developers build and maintain expressive web and
desktop applications that deploy consistently on most web browsers and a
growing number of mobile devices.
Combining Flex and Java is the new frontier of web development. Spring,
and
Hibernate, and Maven have taken my application development to a higher
level, and in this book I show you how these technologies can do the same for
your development. With Java and Flash, our applications can be easier to main-
tain, build, and test and they are completely portable. And with the release of
the FlashPlayer 9 and 10, Adobe has added ActionScript 3, which is now truly
Shelve in:
Programming Languages/Java
this print for content only—size & color not accurate trim 7.5 x 9.25 spine = 0.84375" 448 page count
Beginning Java™ and Flex
Migrating Java, Spring, Hibernate, and Maven
Developers to Adobe Flex
■■■
Filippo di Pisa
Begi nnin g Jav a™ an d F lex: Mi g rating J av a, Spri ng, Hibe rn ate, and M ave n Deve lope rs to
Adobe Fle x
Copyright © 2009 by Filippo di Pisa
All rights reserved. No part of this work may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any information storage or retrieval
system, without the prior written permission of the copyright owner and the publisher.
ISBN-13 (pbk): 978-1-4302-2385-6
ISBN-13 (electronic): 978-1-4302-2386-3
Printed and bound in the United States of America 9 8 7 6 5 4 3 2 1
Trademarked names may appear in this book. Rather than use a trademark symbol with every
occurrence of a trademarked name, we use the names only in an editorial fashion and to the benefit of
the trademark owner, with no intention of infringement of the trademark.
President and Publisher: Paul Manning
Lead Editor: Tom Welsh
Technical Reviewer: Bradford Taylor
Editorial Board: Clay Andres, Steve Anglin, Mark Beckner, Ewan Buckingham, Gary Cornell,
Jonathan Gennick, Jonathan Hassell, Michelle Lowman, Matthew Moodie, Duncan Parkes,
Jeffrey Pepper, Frank Pohlmann, Douglas Pundick, Ben Renow-Clarke, Dominic Shakeshaft,
Matt Wade, Tom Welsh
Project Manager: Debra Kelly
Copy Editor: Sharon Terdeman
Compositor: Tricia Bronkella
Indexer: Ann Rogers and Ron Strauss
Artist: April Milne
Cover Designer: Anna Ishchenko
Distributed to the book trade worldwide by Springer-Verlag New York, Inc., 233 Spring Street, 6th Floor,
New York, NY 10013. Phone 1-800-SPRINGER, fax 201-348-4505, e-mail [email protected],
or visit http://www.springeronline.com.
For information on translations, please e-mail [email protected], or visit http://www.apress.com.
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use.
eBook versions and licenses are also available for most titles. For more information, reference our
Special Bulk Sales–eBook Licensing web page at http://www.apress.com/info/bulksales.
The information in this book is distributed on an “as is” basis, without warranty. Although every
precaution has been taken in the preparation of this work, neither the author(s) nor Apress shall have
any liability to any person or entity with respect to any loss or damage caused or alleged to be caused
directly or indirectly by the information contained in this work.
The source code for this book is available to readers at http://www.apress.com. A "live" version of the
source code is maintained by the author at
https://filippodipisa.svn.cvsdude.com/apress_flexjava/archive/. (Username: apressapress,
Password: FlexAndJava).
ii
■ CONTENTS
I dedicate this book to my father, Pino, my mother, Raffaella, my sister, Beatrice, and my wife,
Soledad, the most important people in my life.
iii
Contents at a Glance
iv
■ CONTENTS
Contents
v
■ CONTENTS
Introduction to UML......................................................................................................15
Basic Diagrams .................................................................................................................................. 15
Summary......................................................................................................................18
■Chapter 2: Pr esenting t he Sample Application ................................. 21
Architecture .................................................................................................................21
The Presentation Layer ................................................................................................25
The Service Layer ........................................................................................................25
The Data Access Layer.................................................................................................27
The Domain Model .......................................................................................................28
Summary......................................................................................................................30
■Chapter 3: C onfiguring Your Development Environment ................... 31
The Source Code Editor: Eclipse IDE............................................................................31
Eclipse Projects.................................................................................................................................. 32
Eclipse Plug-ins ................................................................................................................................. 35
Installing Eclipse ................................................................................................................................ 36
Configure Eclipse for Flex and J2EE .................................................................................................. 37
Version Control: Subversion.........................................................................................40
Subversion Installation....................................................................................................................... 42
Basic SVN Project Structure............................................................................................................... 42
Using SVN with the Command-Line Client ......................................................................................... 42
Installing Subclipse ............................................................................................................................ 48
The Database Tools: MySQL.........................................................................................49
Install MySQL on Windows................................................................................................................. 50
Installing MySQL on a Mac................................................................................................................. 52
Adding the MySQL GUI Tools.............................................................................................................. 53
Basic MySQL Operation from the Command Line .............................................................................. 54
Basic MySQL Operations Using MySQL Query Browser ..................................................................... 57
vi
■ CONTENTS
vii
■ CONTENTS
viii
■ CONTENTS
ix
Visit https://ebooknice.com to
discover a wide range of
eBooks across various genres.
Enjoy exclusive deals and
discounts to enhance your
reading experience. Start your
digital reading journey today!
■ CONTENTS
x
■ CONTENTS
xi
■ CONTENTS
■ F ili ppo d i Pis a fell in love with IT in 1983, when his auntie Maria Rosa gave him
one of the first home computers on the market—the Texas Instruments TI-
99/4A—for Christmas. After passing through the Sinclair Spectrum and
Commodore era at the age of 24, he started his first IT company assembling PCs.
Then he rode the new economy bubble launching various dot-coms—always
software driven. Partly for business reasons, but largely because of a passion for
programming and software engineering, he learned many high-productivity
technologies such as Java, Spring, Hibernate, Acegi Security, ActionScript, Flex,
ColdFusion, Fusebox, JavaScript, and Perl. Filippo is now a London-based
consultant working for a number of household names in the UK market. Since
growing up in Bologna (Italy), he has lived in Milan, Madrid, and Barcelona. He
married Soledad in Ibiza on June 27, 2009.
xii
■ CONTENTS
■ Brad for d T ayl or is an Architect for the Dallas-based business and technology consulting firm Credera.
He has more than 13 years of experience in Java Enterprise Application Development and has been
developing Flex/Spring applications for the past 4 years. Most recently he has been helping develop the
Open Source E-Commerce framework Broadleaf Commerce.
Bradford has been involved in a variety of projects, including e-commerce, company portals and
Flex applications. While at Credera, he has worked on The Container Store’s implementation of
Broadleaf Commerce. He has also helped Pursuant re-architect its Unifyer application, wrote the latest
implementation of Truthcasting, worked with Blockbuster on enhancements to its e-commerce
platform, and made enhancements to its Silverlight Movie browsing application.
Before his work at Credera, Bradford consulted at Neiman Marcus to create user applications to
work with its customer data mart. He started his career at Nextel, where he worked on the company
portal and developed Nextel’s internet application for phone resellers. He has worked with banks, the
Department of Defense, major retailers, and small companies to help develop both Java and Flash/Flex
applications to meet their business needs.
xiii
■ CONTENTS
Acknowledgments
I dedicate this book to my father, Pino, my mother, Raffaella, and my sister, Beatrice, who have stood by
me through my whole crazy life.
I have many people to thank for their support on this book, but the one person I would really like to
acknowledge is my wife, Soledad. For the past six months she has watched TV using a headset, or just
reading the subtitles, so as not to disturb me in my nightly writing.
The second person without whom this book could not have been written is my colleague and friend
Chris Seal. He helped me a lot, reading chapter after chapter, making suggestions from the project
management point of view and improving my Italian-English. Thanks Chris!
I would also like to thank the fantastic Apress team who believed in me while I was writing this book, and
provided excellent support in authoring and the technical aspect. In particular, I am really pleased to
have worked with Steve Anglin, Tom Welsh, Debra Kelly, Bradford Taylor, Sharon Terdeman, and
Matthew Moodie. Thanks a lot!
A special thanks also to my agent and friend Shervin Rahmani from explorerec.com who believed in me
from the beginning and introduced my consulting services to some of the UK's top-name companies.
Filippo di Pisa
xiv
■ INTRODUCTION
Introduction
Over the past few years, the now open source Adobe Flex Framework has been adopted by the Java
community as the preferred framework for Java RIAs using Flash for the presentation layer. Flex helps
Java developers build and maintain expressive web and desktop applications that deploy consistently on
most web browsers and a growing number of mobile devices.
Beginning Java and Flex describes new, simpler, and faster ways to develop enterprise RIAs.
This book is not only for Java or Flex developers but for all web developers who want to increase their
productivity and the quality of their development.
In this book I will show you how to develop using the most popular Java lightweight frameworks
such as Spring and Hibernate, using Flex and ActionScript 3 as the view layer. Once you have mastered
this new development frontier, including concepts like Dependency Injection (DI) and Object
Relationship Management (ORM), you will very likely want to use them for all your projects.
Flex and Java are becoming very popular for both business and interactive applications, and they can
open doors to the different branches of software development such as gaming, finance, advertising, and
desktop applications of all kinds.
• An ActionScript/Flash developer–You really should read this book because it will show you how
best to use Java in your applications. Learning Java is a great way of immersing yourself in the
latest software engineering patterns and frameworks.
• A Java developer–If you are a Java developer and know about Enterprise JavaBeans (EJBs), I really
suggest you should think about using POJOs and Java frameworks such as Spring and Hibernate.
By reading this book you will also pick up Flex, which puts the power of Flash into your
presentation layer. Learning Flex will bring you into the world of Adobe and Flash, which
promises to become increasingly important. With CS5, the next release of Flash, Adobe promises
that we will be able to write ActionScript applications and compile them to native Objective-C
ready to run on the iPhone!
• A Web developer–If you are using languages such as PHP or Cold Fusion, please consider
switching to Java lightweight frameworks. I guarantee that once you have mastered them your
productivity will soar, and–thanks to Java–the quality of your code will get better too. For any web
developer, learning Flex is a must even if you are already an Ajax or JavaFX guru. And along with
Flex and ActionScript 3 you will also pick up knowledge of Flash, which at the time of this writing
is everywhere.
xv
■ INTRODUCTION
The Book
This book has been designed to help you in three ways.
1. First, it gives you an easily understood overview of the different technologies that we are going to
use.
2. Then it shows you how to set up your development environment.
3. With all the prerequisites taken care of, you learn how to use each framework in turn, starting
with Spring and moving on to Hibernate, then BlazeDS, then Flex, and finally putting everything
together using Maven.
Chapt er 1 introduces you to the technologies that we are going to use, including Java, Flex, Spring, and
Hibernate. It also sums up the benefits of object-oriented programming over procedural or scripting
languages, and the strengths of a lightweight programming approach.
Chapt er 2 introduces the sample application that we are going to use in this book and its architecture.
Chapt er 3 shows you how to set up all the development tools you will need. While reasonably
straightforward, this could turn out to be a painful, annoying, and time-consuming process unless you
do it right. It can take a lot of time and effort to configure a complex development environment, but it
really makes a difference once you have it up and running smoothly.
Chapt er 4 covers the most important aspects of the Spring framework. You will learn the key concepts
of DI and Inversion of Control (IoC) and how to configure Spring and inject beans into the Spring IoC
container using both XML configuration and Java annotations.
Chapt er 5 demonstrates how to create a Java EE data-driven application using both JDBC and ORM
frameworks. I will show you the Data Access Object (DAO) pattern architecture and the difference
between using "plain old JDBC" and Spring JDBC to connect to a database. Then I will explain the value
of using Hibernate and Spring instead of the Spring JDBC and introduce transactions, which play an
important role in Java EE development.
Chapt er 6 shows you how to secure a Java application using the Spring Security framework (formerly
Acegi Security). You will see how Spring Security delegates all requests to filters added by default into the
Spring Security filter chain stack. Then I will show you how to add a custom authentication filter into the
filter chain stack, replacing the default one. Finally, I will set out the different authentication processes
using databases, LDAP repositories, and static values.
Chapt er 7 gives you a complete overview of the Flex framework and the Flex Builder IDE. I will explain
how to create and compile a Flex project using the Flex Builder Eclipse plug-in. Then you will learn how
to listen for and dispatch Flex events, create custom components, use external CSS files, data binding,
control Flash MovieClips, and more. This chapter takes you through all the concepts that I think are
fundamental for starting to develop using Flex.
Chapt er 8 shows you the most important ways to structure data on the Flex client and to access data on
a remote server. First, I will show you how to bind ActionScript data collection to ActionScript DataGrid
components and how to create a real-time search into the collection using filters. Next, I will create a
Java application that provides a list of users through servlets. The Flex client will retrieve the XML using
the HTTPService component. Finally, I will show you how to use the Flex RemoteObject component.
xvi
■ INTRODUCTION
Chapt er 9 introduces the BlazeDS server. You will learn how to retrieve and send data from a Flex
application to a Java application and how to exchange real-time messages among different clients using
the BlazeDS server.
Chapt er 10 puts it all together–Spring, Hibernate, BlazeDS, and Flex. We will create a Flex-Spring-
Hibernate project using the Flex-Spring-Hibernate Maven archetype. The archetype creates the entire
project directory structure containing all the Spring, Hibernate, and BlazeDS configuration and
properties files. It also adds all the packages usually needed for this kind of application using the Model
View Controller (MVC) and DAO patterns. In this chapter, I cover all the most important aspects of Flex-
Spring-Hibernate-Maven development. You can reuse the same archetype to start your own project, and
you’ll see how your developer productivity will quickly increase.
Java and Flex let you create amazing applications using object-oriented languages and the latest
software engineering techniques, making you not just a better developer but also a better software
engineer.
xvii
CHAPTER 1
■■■
Two of the most difficult decisions for a project manager, CIO, or developer are which platform to target
and which language to use. Books have been dedicated to the relative merits of one language over
another and the options are much more complex than you might think. While a developer may have a
preference, based on his own experiences or selfish desires, the project may be best served by different
choices.
And there are many available. The IT/developer world is constantly changing. During the last 15
years, many languages have found and lost favor, while seemingly “dead” languages such as Ruby have
experienced a resurgence. (In Ruby's case, this is due to the arrival of the Rails framework). I expect this
trend to continue and that the life of a developer will be one of constant evolution.
To survive in today’s market, developers need to learn more than one language. However, they also
need to be able to choose which is best for a particular endeavor, which can sometimes be just as
difficult. In the next sections, I’m going to discuss the choices I made for this book.
Why Java?
I am not a Java fanatic, and I don’t want to create a polemic saying that Java is better than C# or vice
versa. My view is that every language has its place and has a market, especially since so much effort
involves working with existing applications and code.
A nontechnical manager I worked with used to advise using “the best tool for the job.” The best
example from my past is when I had to create a Windows application that worked with iTunes via COM
objects. I felt that C# would be the fastest, so C# is what I used.
I do believe that enterprise Web applications are better served by using Java. This is partly due to the
hosting platforms Java runs on and the lack of dependencies on operating environments like .NET.
Developers should enjoy programming in Java and are often surprised at how fast they can obtain
results. Studies have consistently shown that switching to the Java platform increases programmer
efficiency. Java is a simple and elegant language that has a well-designed and intuitive set of APIs.
Programmers write cleaner code with a lower bug count when compared with other languages, which in
turn reduces development time.
Java is certainly more difficult to learn than scripting languages such as PHP, ColdFusion, and the
like. Still, once you have mastered Java, you will find there is no comparison for writing stable, scalable
enterprise applications.
PHP and ColdFusion are excellent languages, and possibly even too successful. The problem with
these two languages, so common in Web environments, is not that they are not powerful enough but
that they make it too easy to code poorly and still get usable results. They forgive a lot of mistakes. This
has meant that too many developers write bad code, just because they can get away with it. Too often,
though, while they do get usable results, their code is not stable or scalable.
1
Visit https://ebooknice.com to
discover a wide range of
eBooks across various genres.
Enjoy exclusive deals and
discounts to enhance your
reading experience. Start your
digital reading journey today!
CHAPTER 1 ■ DEVELOPING WITH JAVA AND FLEX
Of course, there is plenty of badly written Java code, too. However, in Java, before you are actually
able to do anything, you must at least know the basics of object-oriented programming, data types,
serialization, unit testing, and so forth.
So while there is bad code in Java, you don't tend to get really bad code that works— unlike what
you see in many ColdFusion or PHP applications.
I’ve been developing for many years (some would say too many!) and I am constantly striving to use
the best technologies available. In my opinion, at the moment the best technologies are Java and
lightweight programming (which I’ll discuss later in the chapter).
Why ActionScript?
A lot of developers think of ActionScript (AS) simply as a scripting language for Flash animation and for
attaching scripts on the timeline.
Well, it’s not!
At least ActionScript 3 (AS3), which arrived with Flash Player 9, isn’t and should in no way be
confused with earlier versions of ActionScript. It is a completely new language and a whole new virtual
machine, with an ability to build Web applications and games that are like nothing else in the
marketplace.
With Adobe AS3, you can do so much more than with Ajax and JavaScript. It is more efficient, and
elegant, and without the bizarre restrictions of what works and what doesn’t. Furthermore, AS3 is cross-
platform, which is crucial in today’s diverse environment (Mac OS, Windows and Linux), and cross-
browser without too much hassle. AS3 supports regular expressions, binary sockets, remote data access,
X-Y-Z axis manipulation, 3D drawing, 3D effects, audio mixing, peer-to-peer (P2P) communication and
more. AS3 is compiled in a totally different bytecode from its predecessor. Flash Player 9 and Flash
Player 10 both contain two virtual machines for backward compatibility with all AS releases.
Adobe Flex, a software development kit for creating applications based on Flash, has added a new
dimension. It allows you to develop amazing user interfaces (UI) and rich Internet applications (RIA) in
an elegant way while using Java design patterns and server-side capabilities.
2
CHAPTER 1 ■ DEVELOPING WITH JAVA AND FLEX
■ N ote An Enterprise JavaBean is not a single class but a representative of an entire component model. The core
principle shared by all lightweight enterprise Java frameworks is the use of plain old Java objects (POJOs) for the
data access and business logic.
Lightweight technologies have evolved due in large part to a “developer rebellion” against the
heavyweight and cumbersome EJB 2.1 (and earlier). Lightweight frameworks have the stated aim of
making developers more productive and their applications less error-prone. This is achieved by
removing the rigid EJB 2.1 infrastructure classes and interfaces and the "over the top" XML deployment
descriptors. (Lightweight, by the way, means light load, not soft or weak.) Lightweight frameworks
promote better and cleaner applications through better architecture. They are easier to reuse, which
saves time and money.
Hibernate, for example, is a lightweight ORM (Object-relational Mapping) framework that can be
great for implementing business and persistence logic. It allows interaction between the database and
Java. For example, you can generate your database schema directly from your Java classes, and vice
versa.
In this book I have chosen to use the most popular and stable Java and AS frameworks for creating
business and media web applications, namely:
• Spring (a lightweight container)
• Hibernate (the most popular ORM )
3
CHAPTER 1 ■ DEVELOPING WITH JAVA AND FLEX
EJB is a heavyweight framework that provides a large number of useful services like declarative
transactions, security management, and so forth. It was adopted enthusiastically by most Java
developers, who had to abandon their OO skills to configure lots of XML, and write procedural Java code
to build EJB components. For several years, EJB was the de facto standard— until the rise of POJO
lightweight frameworks.
The goal of POJO is to support writing Java applications using standard OO design and patterns. EJB
encouraged developers to write procedural code, thus losing the advantage of many of the best practices
used for normal Java development. Other Web languages tried to follow the EJB architecture by
concentrating development on a component base. Now both Java and other Web languages are moving
back to OO design. However POJO alone is not sufficient in enterprise applications development, where
you need security management, persistence objects, and all the other services implemented by the EJB
framework.
The solution is to use POJO lightweight frameworks that are not as intrusive as EJB and significantly
increase developer productivity. POJO lightweight frameworks provide services without requiring that
the application classes implement any special interfaces. With lightweight frameworks you can write EE
applications using an OO design, and later in this book I’ll show you how to manage these libraries just
by configuring an XML file.
Lightweight framework programming can save you lots of time, in particular through avoiding the
need for lots of code and complex OO design patterns. However, before using Java and Flex lightweight
programming, you need to have good OO design skills otherwise you will get into trouble. If your OO
design skills are in need of refreshing, you may want to take a look at Java objects and Java design
patterns before proceeding.
The lightweight frameworks that I use and describe in this book are Spring, Hibernate for Java, and
Flex for AS and Flash. Using all of these together, you’ll see how you can write fast and elegant code to
produce amazing RIA applications.
In Table 1-1, I have summarized the differences between standard EJB, Web languages, and POJO
approaches.
Application assembly Most of the times Explicit JNDI lookups Dependency injection
architected by the
developer
Introduction to Spring
Spring is a lightweight framework based on the Dependency Injection (DI) pattern. It is lightweight
because Spring uses POJO, which makes it very powerful and very easy to extend or implement.
4
CHAPTER 1 ■ DEVELOPING WITH JAVA AND FLEX
Spring’s primary use is as a framework for enabling the use of Inversion of Control (IOC). It is also a
powerful Java Enterprise application framework that provides a large number of features and services.
Spring is initially a bit difficult to understand, but once mastered, you will see a great improvement in
your productivity. For enterprise applications, Spring is an excellent tool because it is a complete, well-
written, well-documented, scalable, and open source—with a lot of community support.
With Spring, you are able to inject all your classes directly into the container using an XML file. This
means that the Spring container instantiates all classes and injects into others as defined by XML. You
no longer have any dependency lookup problems.
Think of Spring as a container that assembles all your classes together and any part can easily be
swapped out. Each part is just a plain Java object.
Without DI, you would have to create a layer that assembles everything, and probably you would
also have to change the code for any environment because of the code embedded relationship between
the different classes.
public UserService(){
userDao = new UserDao();
}
}
With DI, you solve this problem because you have to create a parameterized version of the same
code, allowing it to accept injected classes
But Spring is not just an IOC framework (though everything is based on the IOC framework). Spring
provides services and resources for database connection pools, database transaction, security,
messaging, caching, and much more. To manage the security of all your application with groups, roles,
and permissions, for example, you only have to inject some classes into the Spring security framework.
Spring supports all major data access technologies such as JDBC, Hibernate, JPA, and Ibatis. For
example, to query a database you don’t have to create the code to manage the connection, process the
result set, and release the connection itself. All these processes are handled by Spring.
The typical architecture of a Spring application comprises a presentation layer that uses a service
layer to communicate to the data access layer, which can deal with database, mail servers, or any other
data containers, as shown in Figure 1-1.
5
CHAPTER 1 ■ DEVELOPING WITH JAVA AND FLEX
The presentation layer contains all views and components that are concerned with the presentation
of the application to the user. Typically, the view is implemented with JSP or a similar technology; in this
book we’ll use Flex.
The service layer represents the business logic of the application. All operations pass through the
service layer. You can have different service layers for different services, such as UserServices,
MailServices, and so on. In the upcoming chapters, you will learn how to expose the Java Spring service
layer to Flex/AS, and to allow the presentation layer to use it.
The data access layer provides all methods to save, send, and retrieve data. Usually the data access
layer works with the database, mail servers, .xml, or the file system.
As mentioned previously, Spring is based on a IoC container where all objects(beans) are
instantiated. To help you understand this concept better, I’m going to use a basic IOC Flex container I
wrote to inject different .xml files to different service layers. My application needed to provide different
content to the view, such as video, images, and text, and everything is based on different XML files. At
the time, I had to create the application as quickly as possible, and I had other applications to create, so
the more code I could reuse and the faster I could deliver the project, the better I would be.
My goal was to create a container where I could inject the .xml files and relate them to the different
content factories of the application. I copied precisely the Spring .xml syntax to make it readable by the
Spring developer. Below is the application .xml file to show you how I injected the .xml files to the
different content factories.
6
CHAPTER 1 ■ DEVELOPING WITH JAVA AND FLEX
<beans>
<bean id="XMLArticlesList" claz="com.publicis.iocframework.core.XMLLoader"
path="articlesList.XML" />
XMLLoader is a core class of my IOC framework that loads XML from a given path.
<bean id="articlesService"
claz="com.publicis.articles.business.ArticlesServiceImpl">
<constructorarg value="articlesDao" ref="articlesDao" />
</bean>
ArticlesServiceImpl is the application service layer, and you have to pass into the default
constructor the object type articlesDao.
ArticlesDaoXML is the data access layer and you have to pass into the constructor an object XML
type.
As you can see, I am able to inject classes and manage their dependencies directly from an XML file
without recompiling and changing my code. Moreover, I can reuse the XmlLoader core class to load into
the IOC container any XML file and reuse it for a different application. For example, I could pass the
XmlArticlesList object to another object simply by adding a new XML tag like this:
Dependency injection frameworks exist for a number of platforms and languages, such as AS, Flex,
Java, C++, PHP, ColdFusion, Microsoft, .NET, Ruby, Python and Perl. Below is a table with the most
popular IOC frameworks for AS, Flex, and Java.
Language/platform DI Framework
AS di-as3
AS Syringe
Flex Flicc
Flex Mate
Flex Swiz
7
CHAPTER 1 ■ DEVELOPING WITH JAVA AND FLEX
Java Spring ME
Introduction to Hibernate
Hibernate is another very popular lightweight POJO Java framework. Before I discuss Hibernate, let me
introduce you to object-relational mapping (ORM) frameworks.
Many software applications use relational databases to store data, including such products as
Oracle, MySql, Microsoft SQL Server, PostgreSql, and others. Various frameworks, such as JDBC or ORM,
are used to retrieve data from such databases. An ORM framework provides a service to map the
relational model to the OO model. Hibernate is an ORM framework that has become a natural choice for
working with POJO (though it supports EJB 3.0 as well).
In practice, Hibernate maps your database tables to classes. A standard ORM also provides
persistence objects, which means it will persist data for you so that you don't have to write tedious SQL
statements using JDBC. For example, to insert or update data into the database, you can use the method
save(entity), which saves you a lot of time compared with writing the full SQL INSERT or UPDATE.
The table mapped in the OO model is called an entity and all entities are persistent in a Hibernate
session. You will learn how to inject this session into the Spring container and also how to use Spring
Hibernate Templates to make your life easier. After mastering these techniques, you’ll see how easy it is
to work with databases and OO, and if you have worked with SQL, JDBC and other technologies before, I
think you will be pleasantly surprised.
Hibernate also provides Hibernate Query Language (HQL), in which you can write code that’s
similar to SQL to retrieve data from a persisted object. For example, imagine that you have mapped the
database table users to the entity User, and you want to select a user by his id. To do so, you can write an
HQL query like this:
int id = 2;
String hql='from User u where u.id = :id ';
Query query = session.createQuery(hql);
query.setInt(id);
User user = (User)query.uniqueResult();
Hibernate works with a large number of databases such as Oracle, MySQL, MS SQL server, Sybase,
IBM DB2, and others. You just have to tell Hibernate the database dialect you want to use, to ensure that
Hibernate uses the correct and fully optimized SQL for that database. In the next chapter, you will learn
how to set the dialect for MySQL and the other databases.
To round off this Hibernate introduction, let me use a UML diagram, shown in Figure 1-2, to
illustrate a simple physical relational database mapped to OO classes.
8
CHAPTER 1 ■ DEVELOPING WITH JAVA AND FLEX
9
CHAPTER 1 ■ DEVELOPING WITH JAVA AND FLEX
A key advantage of Hibernate from my point of view is its integration with Spring. In fact, Spring
provides a Hibernate Template that simplifies the use of Hibernate. The Hibernate Template provides
convenience methods that enable the developer to write less code, as you can see from the following:.
Hibernate also provides hooks so Spring can manage sessions and transactions in a transparent and
elegant way.
Introduction to BlazeDS
Now we’re ready to look at another important piece for connecting Spring services to the user
interface—BlazeDS, a technology for remotely connecting to Java objects and for sending messages
between clients. As Adobe points out, BlazeDS allows you to connect to back-end distributed data and
push data in real time to Adobe Flex and Adobe AIR rich Internet applications (RIA). You can think of
Blaze as a bridge between Adobe Flex (the presentation layer) and Java Spring Services (the business
logic layer), as shown in Figure 1-3. Figure 1-4 outlines the BlazeDS server architecture.
If you are an AS developer, you may have developed many applications using XML or SOAP.
Adopting BlazeDS means your application will load data up to 10 times faster than with those text-based
formats, as it employs an AMF (Action Message Format) data transfer format. (AMF is based on SOAP. If
you’re from an AS and Flash background, you should be familiar with AMF; if you’re from a Java
background, you just need to know AMF is much faster than standard SOAP in this environment).
10
Exploring the Variety of Random
Documents with Different Content
that the best chance of the Allies would have been to attempt a
storm on this breach when first it became more or less practicable.
The delay enabled the besieged to execute repairs, to scarp down the
broken front, and to cut off the damaged corner by interior
retrenchments.
Meanwhile, since doubts were felt as to the main operation of
storming the new breach, No. III, subsidiary efforts were made to
incommode the enemy in other ways. At intervals on the 9th, 10th,
and 11th red-hot shot were fired at the church of Santa Maria la
Blanca, where it was known that the French magazine of food lay.
The experience of the Salamanca forts had led the artillery officers to
think that a general conflagration might be caused. But the plan had
no success; the building proved to be very incombustible, and one or
two small fires which burst out were easily extinguished. Another
device was to mine out from the end houses of the city towards the
church of San Roman, an isolated structure lying close under the
south-east side of the Castle, which the French held as an outwork.
Nothing very decisive could be hoped from its capture, as if taken it
could only serve as a base for operations against the two enceintes
above it[52]. But, as an eye-witness remarked, at this period of the
siege any sort of irregular scheme was tried, on the off chance of
success. By October 17 the mine had got well under the little church.
A more feasible plan, which might have done some good if it had
succeeded, was to run out a small mine or fougasse from the sap-
head of the trench in front of breach I to the palisades of the second
enceinte. It was a petty business, no more than two barrels of
powder being used, and only slightly damaged an angle of the work
in front when fired on October 17. An attempt to push on the sap
after the explosion was frustrated by the musketry fire of the
besieged.
On the 18th the engineers reported that the church of San Roman
was completely undermined, and could be blown up at any moment.
On the same morning the one good and two lame 18-pounders in
battery 2 on San Miguel swept away, not for the first time, the
sandbag parapets and chevaux de frise with which the French had
strengthened the breach III. They were then turned against the third
enceinte, immediately behind that breach, partly demolished its
‘fraises,’ and even did some damage to its rampart. This was as much
as could have been expected, as the whole of the enemy’s guns
were, as usual, turned upon the battering-guns, and presently
obtained the mastery over them, blowing up an expense-magazine in
No. 2, and injuring a gun in No. 1. But in the afternoon the defences
were in a more battered condition than usual, and Wellington
resolved to make his last attempt. Already the French army outside
was showing signs of activity; and, as a precaution, some of the
investing troops—two brigades of the 6th Division—had been sent
forward to join the covering army. If this assault failed, the siege
would have to be given up, or at the best turned into a blockade.
The plan of the assault was drawn up by Wellington himself, who
dictated the details to his military secretary, Fitzroy Somerset, in
three successive sections, after inspecting from the nearest possible
point each of the three fronts which he intended to attack[53].
Stated shortly the plan was as follows:
(1) At 4.30 the mine at San Roman was to be fired, and the ruins
of the church seized by Brown’s caçadores (9th battalion), supported
by a Spanish regiment (1st of Asturias) lent by Castaños. A brigade of
the 6th Division was to be ready in the streets behind, to support the
assault, if its effect looked promising, i.e. if the results of the
explosion should injure the enceinte behind, or should so drive the
enemy from it that an escalade became possible.
(2) The detachments of the Guards’ brigade of the 1st Division,
who were that day in charge of the trenches within the captured
outer enceinte, and facing the west front of the second enceinte,
were to make an attempt to escalade that line of defence, at the
point where most of its palisades had been destroyed, opposite and
above the original breach No. I in the lower enceinte.
(3) The detachments of the German brigade of the 1st Division,
who were to take charge of the trenches for the evening in
succession to the Guards, were to attempt to storm the breach III in
the re-entering angle, the only point where there was an actual
opening prepared into the inner defences.
From all the works, both those on St. Miguel and those to the
west of the Castle, marksmen left in the trenches were to keep up as
hot a musketry fire as possible on any of the enemy who should
show themselves, so as to distract their attention from the stormers.
The most notable point in these instructions was the small
number of men devoted to the two serious attacks. Provision was
made for the use of 300 men only in the attack to be made by the
Guards: they were to move forward in successive rushes—the first or
forlorn hope consisting of an officer and twenty men, the supports or
main assaulting force, of small parties of 40 or 50 men, each of which
was to come forward only when the one in front of it had reached a
given point in its advance. Similarly the German Legion’s assault was
to be led by a forlorn hope of 20, supported by 50 more, who were
only to move when their predecessors had reached the lip of the
breach, and by a reserve of 200 who were to charge out of the
trench only when the support was well established on the rampart.
Burgoyne, the senior engineer present, tells us that he protested
all through the siege, at each successive assault, against the paucity
of the numbers employed, saying that the forlorn hope had, in fact,
to take the work by itself, since they had no close and strong column
in immediate support; and if the forlorn hope failed, ‘the next party,
who from behind their cover have seen them bayoneted, are
expected to valiantly jump up and proceed to be served in the same
way.’ He reminded Wellington, as he says, that the garrison at Burgos
was as large as that at Ciudad Rodrigo, where two whole divisions
instead of 500 or 600 men had been thrown into the assault. The
Commander-in-Chief, condescending to argument for once, replied,
‘why expose more men than can ascend the ladders [as at the
Guards’ attack] or enter the work [as at the breach in the K.G.L.
attack] at one time, when by this mode the support is ordered to be
up in time to follow the tail of the preceding party[54]?’ And his
objection to the engineer’s plea was clinched by the dictum, ‘if we fail
we can’t lose many men.’ This controversy originally arose on the
details of the abortive storm of September 22, but Burgoyne’s
criticism was even more convincing for the details of the final assault
on October 18. The number of men risked was far too small for the
task that was set them.
The melancholy story of the storm runs as follows. On the
explosion of the mine at San Roman, punctually at 4.30, all three of
the sections of the assault were duly delivered. At the breach the
forlorn hope of the King’s German Legion charged at the rough slope
with great speed, reached the crest, and were immediately joined by
the support, led most gallantly by Major Wurmb of the 5th Line
Battalion. The first rush cleared a considerable length of the rampart
of its defenders, till it was checked against a stockade, part of the
works which the French had built to cut off the breach from the main
body of the place. Foiled here, on the flank, some of the Germans
turned, and made a dash at the injured rampart of the third line, in
their immediate front: three or four actually reached the parapet of
this inmost defence of the enemy. But they fell, and the main body,
penned in the narrow space between the two enceintes, became
exposed to such an overpowering fire of musketry that, after losing
nearly one man in three, they finally had to give way, and retired
most reluctantly down the breach to the trenches they had left. The
casualties out of 300 men engaged were no less than 82 killed and
wounded[55], among the former, Wurmb, who had led the assault, and
among the latter, Hesse, who commanded the forlorn hope, and was
one of the few who scaled the inner wall as well as the outer.
The Guards in their attack, 100 yards to the right of the breach,
had an even harder task than the Germans, for their storm was a
mere escalade. It was executed with great decision: issuing from the
front trench they ran up to the line of broken palisades, passed
through gaps in it, and applied their ladders to the face of the
rampart of the second enceinte. Many of them succeeded in
mounting, and they established themselves successfully on the
parapet, and seized a long stretch of it, so long that some of their
left-hand men got into touch with the Germans who had entered at
the breach. But they could not clear the enemy out of the terre-
pleine of the second enceinte, where a solid body of the French kept
up a rolling fire upon them, while the garrison of the upper line
maintained a still fiercer fusillade from their high-lying point of
vantage. The Guards were for about ten minutes within the wall, and
made several attempts to get forward without success. At the end of
that time a French reserve advanced from their left, and charging in
flank the disordered mass within the enceinte drove them out again.
The Guards retired as best they could to the advanced trenches,
having lost 85 officers and men out of the 300 engaged. The French
returned their casualties at 11 killed and 30 wounded.
Wellington’s dispatch, narrating the disaster, gives the most
handsome testimonial to the resolution of both the bodies of
stormers. ‘It is impossible to represent in adequate terms the conduct
of the Guards and the German Legion upon this occasion. And I am
quite satisfied that if it had been possible to maintain the posts which
they gained with so much gallantry, these troops would have
maintained them[56].’ But why were 600 men only sent forward, and
no support given them during the precious ten minutes when their
first rush had carried them within the walls? Where were the brigades
to which the stormers belonged? It is impossible not to subscribe to
Burgoyne’s angry comment that ‘the miserable, doubting, unmilitary
policy of small storming-parties’ caused the mischief[57]. He adds,
‘large bodies encourage one another, and carry with them confidence
of success: if the Castle of Badajoz was stormed with ten or twelve
ladders, and not more than 40 or 50 men could mount at once, I am
convinced that it was only carried because the whole 3rd Division was
there, and the emulation between the officers of the different
regiments got their men to mount; although we lost 600 or 700 men,
it caused success—which eventually saves men.’
The third section of the assault of October 18, the unimportant
attack on the church of San Roman, had a certain measure of
success. The mine, though it did not level the whole building, as had
been hoped, blew up the terrace in front of, and part of its west end.
Thereupon the French evacuated it, after exploding a mine of their
own which brought down the bell-tower and much more, and
crushed a few of the caçadores and Spaniards[58] who were ahead of
their comrades. The besiegers were able to lodge themselves in the
ruins, but could make no attempt to approach the actual walls of the
second enceinte. So the 6th Division remained behind, within the
streets of Burgos, and never came forward or showed themselves.
Such was the unhappy end of this most unlucky siege. All through
the day of the assault there had been heavy skirmishing going on at
the outposts of the covering army; Souham was at last on the move.
On the 19th the Guards’ brigade and the K.G.L. brigade of the 1st
Division marched to join the 5th and 7th Divisions at the front,
leaving only the line brigade (Stirling’s) to hold the trenches on the
north and west sides of the Castle. Two-thirds of the 6th Division had
already gone off in the same direction before the storm: now the rest
followed, handing over the charge of Burgos city and the chain of
picquets on the east side of the Castle to Pack’s Portuguese. There
was little doing in the lines this day—the French built up the oft-
destroyed parapet of breach III with sandbags, and made an
incursion into the church of San Roman, driving out the Portuguese
guard for a short time, and injuring the lodgement which had been
made in the ruins. But they withdrew when the supports came up.
On the 20th, news being serious at the front—for Souham showed
signs of intending to attack in force, and it was ascertained that he
had been reinforced by great part of the Army of the North, under
Caffarelli in person—Wellington gave orders to withdraw the guns
from the batteries, leaving only two of the captured French pieces to
fire an occasional shot. All transportable stores and ammunition were
ordered to be loaded up. There was some bickering in San Roman
this day, but at night the Portuguese were again in possession of the
much-battered church.
On the 21st came the final orders for retreat. The artillery were
directed to burn all that could not be carried off—platforms, fascines,
&c.—to blow up the works on San Miguel, and to retire down the
high-road to Valladolid. The three 18-pounders were taken a few
miles only. The roads being bad from heavy rain, and the bullocks
weak, it was held that there was no profit in dragging about the two
guns which had lost trunnions and were practically useless. The
surviving intact gun shared the fate of its two ‘lame’ fellows: all three
were wrecked[59], their carriages were destroyed, and they were
thrown out on the side of the road. The artillery reserve, now
reduced to the five ineffective 24-lb. howitzers, then continued its
retreat.
BURGOS
On the night of the 21st-22nd, Pack’s brigade and the other
troops left to hold the works retired, the covering army being now in
full retreat by various roads passing through or around the city. The
main column crossed at the town bridge—the artillery with wheels
muffled with straw to deaden their rumbling—risking the danger of
being shelled in the darkness by the Castle, which had several guns
that bore upon it. The long series of mishaps which constituted the
history of the siege of Burgos ended by the failure of the plan for the
explosions on San Miguel: the French found there next day more
than twenty barrels of powder intact. The arsenal in the town was
fired when the last troops had passed, but was only partly consumed.
Next morning (October 22) the advanced guard of the Army of
Portugal entered Burgos, and relieved the garrison after thirty-five
days of siege. Dubreton had still nearly 1,200 effective men under
arms: he had lost in his admirable and obstinate defence 16 officers
and 607 men, of whom 304 were killed or died of their wounds. The
corresponding total British casualty list was no less than 24 officers
and 485 men killed, 68 officers and 1,487 men wounded and missing
[the last item accounting for 2 officers and 42 men]. Almost the
whole of the loss came from the ranks of the 1st Division and Pack’s
Portuguese, the 6th Division troops having had little to do with the
trenches or assaults[60].
The external causes of the raising of the siege will be dealt with in
their proper place—the strategical narrative of the general condition
of affairs in both the Castiles which opens the next chapter. Here it
remains only to recapitulate the various reasons which made the
siege itself a failure. They have been summed up by several writers
of weight and experience—John Jones, the official historian of the
sieges of Spain, John Burgoyne the commanding engineer, William
Napier, and Belmas the French author, who (using Jones as a primary
authority) told its story from the side of the besieged. Comparing all
their views with the detailed chronicle of the operations of those
thirty-five eventful days, the following results seem to emerge.
(1) Burgos would not have been a strong fortress against an army
provided with a proper battering-train, such as that which dealt with
Ciudad Rodrigo or Badajoz. But Wellington—by his own fault as it
turned out in the end—had practically no such train at all: three 18-
pound heavy guns were an absurd provision for the siege of a place
of even third-rate strength. If Wellington had realized on September
20 that the siege was to last till October 21, he might have had
almost as many guns as he pleased. But the strength of Burgos was
underrated at the first; and by the time that it was realized,
Wellington considered (wrongly, as it turned out) that it was too late
to get the necessary ordnance from the distant places where it lay.
(2) Encouraged by the experience of Badajoz and Almaraz,
Wellington and his staff considered that an imperfect fortification like
the Castle of Burgos might be dealt with by escalade without artillery
preparation. The Hornwork of San Miguel was taken on this irregular
system; but the attempts against the enceintes of the Castle failed.
Burgoyne is probably right in maintaining that the repeated failures
were largely due to the general’s reluctance to put in large masses of
men at once, owing to his wish to spare the lives in units already
worked down to a low strength by long campaigning. The principle ‘if
we fail we can’t lose many men’ was ruinous. On October 18 the
place must have fallen if 3,000 instead of 600 men had been told off
for the assault.
(3) Notwithstanding the lack of artillery, Burgos might have been
taken if Wellington had owned a large and efficient body of
engineers. But (as at Badajoz, where he had made bitter complaints
on this subject[61]) the provision of trained men was ludicrously small
—there were just five officers of Royal Engineers[62] with the army,
and eight ‘Royal Military Artificers’. The volunteers from the Line, both
officers and men, used as auxiliaries, were not up to the work
required of them. It was a misfortune that none of the divisions
before Burgos had experience of siege-work, like that which the
Light, 3rd, and 4th Divisions (all left at Madrid) had been through.
(4) After the heavy losses in the early assaults the rank and file,
both the British and still more the Portuguese, were much
discouraged. As Burgoyne says, ‘the place might have been, and
ought to have been, taken if every one had done his duty[63].’ In the
actual assaults splendid courage was often displayed, but in the
trench-work there was much sulkiness, apathy, and even shirking.
‘Our undertaking, every night that we broke ground, appeared most
pitiful: there was scarcely a single instance where at least double the
work was not projected, with sufficient men and tools collected, that
was afterwards executed, owing to the neglect and misconduct of the
working parties. It was seldom that the men could be induced to take
out their gabions and set to work, and I myself placed at different
times hundreds of gabions with my own hands, and then entreated
the men to go and fill them, to no purpose. The engineers blamed
the men—the men blamed the engineers, who, as they grumbled,
were by unskilful direction ‘sending them out to be butchered[64].’ All
this, in the end, was due to the want of artillery for proper
preparation, and of trained sappers.
(5) Burgoyne, D’Urban, and other observers are probably right in
saying that the failure of the assaults was partly due to the bad
principle of composing the storming-parties of drafts from many
different corps, collected, under officers whom they did not
personally know, from the units that chanced to be on duty that day.
The one case where a brilliant success was scored with small loss,
was seen when a whole battalion, the 2/24th, carried the outer
enceinte on October 4.
(6) Wellington’s doubts, expressed almost from the first, as to the
practicability of the affair that he had taken in hand, were known to
many officers, and affected the general morale.
(7) Dubreton deserves unstinted praise. A general of more
ordinary type, such as Barrois at Ciudad Rodrigo, would have lost
Burgos for want of the extraordinary resourcefulness, determination,
and quick decision shown by this admirable governor. His garrison
must share his glory: the French 34th certainly got in this siege a
good revanche for their last military experience, the surprise of
Arroyo dos Molinos.
SECTION XXXIV: CHAPTER III
WELLINGTON’S RETREAT FROM BURGOS:
OCTOBER-NOVEMBER 1812. (1) FROM THE
ARLANZON TO THE DOURO: OCTOBER 22-
OCTOBER 30
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebooknice.com