Laszlo in Action

Norman Klein and Max Carlson with Glenn MacEwen

February 2008 | 552 pages | B&W
ISBN: 1-932394-83-4

Out of Print $44.99 Softbound print + PDF eBook
$35.99 eBook edition (PDF only)


 Look Inside Resources
  • Author Online Forum
  • Excerpt: Interfacing OpenLaszlo Applications to Web Services
    In this excerpt from Laszlo in Action, authors Max Carlson and Norman Klein explain how interfacing to Laszlo is just like that old Talking Heads song "same as it ever was". In other words, Laszlo uses the same HTTP standards that you're familiar with; allowing Laszlo applications to coexist with your HTML web applications to further leverage your server-side web services.


Laszlo in Action is the first comprehensive guide to the Laszlo system and its language LZX. OpenLaszlo is an increasingly popular open-source platform for the development and delivery of rich internet applications across multiple platforms: Flash, DHTML, and J2ME. The dramatic emergence of Ajax over the past year was a first step in the transition from page-oriented HTML web applications towards more full-featured rich internet applications. OpenLaszlo provides another important step in this continuing evolutionary process through the increased productivity resulting from LZX's declarative approach. It provides developers with the tools to create web-based applications offering the usability and interactivity associated with desktop applications, and the low costs associated with web-based deployment. The cross-platform nature of Laszlo LZX applications allows source code with only minimum modifications to run natively on all popular web browsers, on all desktop operating systems, on the Flash platform, and other platforms in the future.

Written to address the needs of a wide spectrum of developers, ranging from client-side HTML and JavaScript developers all the way to enterprise-class Java or Rails engineers, this book provides a very hands-on approach towards building applications that solve real-world problems across both the Flash and DHTML platforms. Starting with the fundamentals of Laszlo LZX, the authors quickly move towards applying this knowledge to the design and development of a full-scale application called the Laszlo Market. This provides a working context to assist understanding the underlying concepts of Laszlo LZX and, more importantly, how to apply this knowledge in innovative ways. The construction of the Laszlo Market proceeds over the course of the book illustrating topics starting with an initial wireframe and storyboard design to optimization issues dealing with the application's deployment across the Flash and DHTML platforms.


In the first four chapters readers are given a thorough overview of the Laszlo LZX language. You are shown how to design a Laszlo Market rich internet application using traditional design techniques such as wireframes and storyboards. This application is built in accordance with the principles of user-centered design, so you begin with a series of prototypes that are continually refined. The initial work on this application focuses on building its general architecture and providing a unit-testing framework. In subsequent chapters, you further refine this prototype by developing the individual screens utilizing Laszlo's components, layouts, and services.

The prototype you use is continually refined to first work with local datasets which allows your screens to be populated with data. Afterwards, you begin developing the API for communicating to back-end web servers. To demonstrate Laszlo's independence from any particular web server, two implementations featuring the Java Struts and Ruby on Rails frameworks are used to interface to a MySQL database. This provides your instructional application with a fully operational web server conforming to the REST web-service interface.

Once we are satisfied with the look of the prototype created with stock Laszlo components, we cover the conversion process progressing from a prototype to a finished application containing a branded application look. This branded appearance involves selecting a color scheme and fonts, and designing custom components to provide the branded appearance. Differences in platform capabilities are addressed to provide an identical look across both the DHTML and Flash platforms.

We also examine how to integrate Laszlo DHTML applications with Laszlo Flash components providing audio and video capabilities not available within DHTML. These audio and video capabilities range from SWF-embedded services to the streaming media services provided by the open-source streaming-media Red5 server.

Finally, the book shows you how to optimize your Laszlo application. This covers the tradeoffs involved in trading responsiveness for overall performance and the different techniques to achieve these goals.


Norman Klein, a former consultant with Laszlo Systems, has been a software engineer for over 20 years, and has been involved in internet development since its inception. He has also done extensive development work with both web frameworks and other RIA languages such as Adobe's Flex.

Max Carlson, one of the founders of Laszlo Systems, is the lead engineer on the OpenLaszlo DHTML 4.0 project. He is also responsible for implementing many of the features of the current 3.X OpenLaszlo release.

Glenn MacEwen, after 26 years on the Computing Science faculty of Queen's University in Canada, retired to Princeton, New Jersey, to work out of his home office as a technical writer and editor. When not writing or editing, Glenn plays bagpipes, flies small aircraft, and homebrews beer.