Praise for Mashup Patterns “Enterprise architects think in high-level architectural patterns. This book cuts through the mashup marketing fluff and gets right down to presenting patterns as a way to analyze and solve enterprise problems using mashups.” —John Crupi, Chief Technology Officer of JackBe and Coauthor of Core J2EE Patterns “Mashups offer an opportunity to rapidly deliver value to the business, either on top of an existing internal corporate SOA or on common freely available Internet services. In this work, Ogrinz guides the reader through frequently encountered scenarios in the mashup space. The examples alone will help you think laterally about the problems facing your business and new ways of solv- ing them.” —Kevin P. Davis, Ph.D., Software Architect “Mashup Patterns is an excellent, comprehensive treatment of a subject increas- ingly central to corporate IT management. With the benefit of his extensive software architecture experience, Michael is able to provide a wide array of mashup solutions to real world data wrangling problems. He clearly explains how to successfully apply mashup patterns and avoid going down anti-pattern rabbit holes. This book is a must-have for developers venturing into the vast and rapidly expanding enterprise mashup space.” —Daniel Leuck, CEO, Ooi “Michael Ogrinz takes a broad view of mashups, focusing on their growing (and potentially revolutionary) role for harvesting and repurposing data within the modern information-driven enterprise. Don’t look for code or programming tips here, because you won’t find them. What you’ll find instead are inspiring examples, clever ideas, and new ways to use the data already hiding in your business and in the Web around you.” —Rob Miller, Associate Professor of Computer Science, Massachusetts Institute of Technology “To a user, a mashup has all the personal qualities of an advanced form of spreadsheet, except it’s not limited only to figures; this is only a fraction of the value that enterprises can gain from deploying mashups as well-managed sophisticated tools. Michael has done us all a service by producing this book as a great step forward in helping IT and business managers to access this value.” —Andy Mulholland, Global Chief Technology Officer, Capgemini “Mike Ogrinz has done an excellent job with thorough analysis of the various mashup patterns. What makes this book very exciting is the timing, when everyone wants to know more about mashups as well as the wide range of audi- ence this book caters to. From director to engineer, everyone can find examples relevant to them. Congrats, Mike, on a job well done!” —Sona Srinivasan, IT Engineer/ITG Architect, Cisco Systems “Michael Ogrinz does for mashups what the illustrious Gang of Four (Gamma, Helm, Johnson, and Vlissides) did for object-oriented software design. He starts with a buzzword-free explanation of what mashups are and how they matter to the enterprise. He then presents a taxonomy of ready-to-implement design pat- terns, chock-full of concrete examples. Finally, he includes an appendix of real- world case studies, ranging from a Web 2.0 startup to the Defense Intelligence Agency. This clear, readable, no-nonsense book is a must-have for enterprise IT workers who are ready to embrace the brave new world of Enterprise 2.0.” —Daniel Tunkelang, Ph.D., Chief Scientist, Endeca Mashup Patterns This page intentionally left blank Mashup Patterns Designs and Examples for the Modern Enterprise Michael Ogrinz Upper Saddle River, NJ • Boston • Indianapols • San Francisco New York • Toronto • Montreal • London • Munich • Paris • Madrid Capetown • Sydney • Tokyo • Singapore • Mexico City Many of the designations used by manufacturers and sellers to distinguish their products Editor-in-Chief are claimed as trademarks. Where those designations appear in this book, and the pub- Mark Taub lisher was aware of a trademark claim, the designations have been printed with initial Acquisitions Editor capital letters or in all capitals. Trina MacDonald The author and publisher have taken care in the preparation of this book, but make no Development Editor expressed or implied warranty of any kind and assume no responsibility for errors or Songlin Qiu omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. Managing Editor John Fuller The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales, which may include electronic versions and/or custom covers Project Editor and content particular to your business, training goals, marketing focus, and branding Anna V. Popick interests. For more information, please contact: Copy Editor U.S. Corporate and Government Sales Jill Hobbs (800) 382-3419 [email protected] Indexer Michael Loo For sales outside the United States please contact: Proofreader International Sales Kelli Brooks [email protected] Cover Designer Visit us on the Web: informit.com/aw Chuti Prasertsith Library of Congress Cataloging-in-Publication Data Composition Ogrinz, Michael. Rob Mauhar Mashup patterns : designs and examples for the modern enterprise / Michael Ogrinz. p. cm. Includes index. ISBN 978-0-321-57947-8 (pbk. : alk. paper) 1. Web 2.0. 2. Mashups (World Wide Web) 3. Business enterprises—Technological innovations. 4. Application software—Development. I. Title. TK5105.88817.O57 2009 005.7'2—dc22 2008053762 Copyright © 2009 Pearson Education, Inc. All rights reserved. Printed in the United States of America. This publication is protected by copyright, and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying, recording, or likewise. For information regarding permissions, write to: Pearson Education, Inc. Rights and Contracts Department 501 Boylston Street, Suite 900 Boston, MA 02116 Fax (617) 671-3447 ISBN-13: 978- 0-321-57947-8 ISBN-10: 0-321-57947-X Text printed in the United States on recycled paper at R.R. Donnelley in Crawfordsville, Indiana. First printing, March 2009 To my wife, Monica, and our two little mashups, Meghan and Alexis This page intentionally left blank Contents Preface. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xix About the Author. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxiii About the Cover Picture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xxv Chapter 1: Understanding Mashup Patterns . . . . . . . . . . . . . . . . . . . . . . . . . 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Web 2.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Enterprise 2.0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 The Birth of Mashups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Types of Mashups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Acquiring Data from the Web . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 The Long Tail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Meeting User Demand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Mashups and the Corporate Portal . . . . . . . . . . . . . . . . . . . . . . . . 20 Mashups and Service-Oriented Architecture . . . . . . . . . . . . . . . . . 22 Mashups and EAI/EII . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 Mashups and Software as a Service . . . . . . . . . . . . . . . . . . . . . . . . 25 Mashups and the User . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 A Patterns Primer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 The Fragility Factor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 The Future of Mashups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 Chapter 2: Mashup Patterns Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 33 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Semantics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33 Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 Where’s the UML? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 Chapter 3: Core Activities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 Support for Open Standards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42 ix