Preface

Web 2.0 Ajax portals are among the most successful web applications of the Web 2.0 generation. iGoogle and Pageflakes are the pioneers in this market and were among the first to show Ajax’s potential. Portal sites give users a personal homepage with one-stop access to information and entertainment from all over the Web, as well as dashboards that deliver powerful content aggregation for enterprises. A Web 2.0 portal can be used as a content repository just like a SharePoint or DotNetNuke site. Because they draw on Ajax to deliver rich, client-side interactivity, Web 2.0 portals improve usability and provide faster performance compared to non-Ajax web sites. Also, because portals are commonly composed of widgets (small plug-and-play type applications), there’s no limit to how much functionality you can provide, simply by adding more and more widgets. Their use also keeps the core architecture of the portal clean and simple because widgets are developed and maintained independently. DotNetNuke is a great example of a widget-powered portal concept that has created a new era in highly decoupled enterprise web applications.

This book takes a fresh new look at portal solutions using the latest cutting-edge technologies from Microsoft. In developing personal, educational, community, and enterprise portals, I have had to deal with many interesting design, development, scalability, performance, and production challenges. In this book, I have tried to show solutions to some of these challenges by building an open source Web 2.0 Portal prototype, and then walk you through through the design and architectural challenges, advanced Ajax concepts, performance optimization techniques, and server-side scalability challenges involved. The prototype also shows you practical implementation of the cutting-edge .NET 3.0 and 3.5 frameworks, including LINQ and the Windows Workflow Foundation. Moreover, it explores Ajax web site details, browser performance and compatibility challenges, security challenges, and ASP.NET AJAX framework advantages and shortcomings.

The project is available at Dropthings.OmarALZabir.com. Dropthings is an open source example of what can be done with the new technologies from Microsoft. It is intended for educational purposes only. Although it does come close to real web portal (like Page-flakes) in terms of its feature set, performance, security, and scalability, it does a good job of showing you how to put together several new technologies in a working web application.

Who This Book Is for

This book is primarily for ASP.NET 2.0 or 3.5 developers who have already developed one or more web applications and have a good grip on JavaScript and ASP.NET 2.0. The reader is also expected to have basic understanding of ASP.NET AJAX. This information is available in numerous publications, including several from O’Reilly that are listed in the Roadmap page for this book.

Intermediate developers, looking for ways to gain insight into web development challenges and learn how a successful production web site is built and run, will greatly benefit from this book. Advanced developers will learn how to build a rock solid web application that can withstand millions of hits every day around the clock, survive sudden scalability demands, prevent hack attempts and denial of service attacks, deploy and run a web site on a distributed cluster environment utilizing Content Delivery Networks (CDN), face real-life production challenges, and much more.

How This Book Is Organized

This book first describes what an Ajax web portal (aka a Web 2.0 portal) is and how it can be useful as a model for personal web sites, corporate intranets, or a mass consumer web application. Then it walks you through the architectural challenges of such an application and provides a step-by-step guide to solving design issues. It explains what a widget is and how widget architecture can create a highly decoupled web application that allows the addition of an infinite number of features to a web site.

It following chapters, you’ll find step-by-step guides for developing several components of the web project using ASP.NET 2.0/3.5 and ASP.NET AJAX 1.0, the business layer in Workflow Foundation, and the data access layer using LINQ to SQL. Once the basic foundation is up, it goes deep into difficult challenges like first-time visit performance, browser compatibility and memory leaks, advanced caching techniques, putting too much content and functionality on a single page and so on. It then goes into some real-life Ajax and ASP.NET 2.0/3.5 challenges that I have solved in building high-volume commercial portals.

I have also sprinkled a number of real-life war stories throughout the book that highlight some of the real-life problems I have encountered in building portals like Dropthings. You’ll find them, not surprisingly, wherever you encounter the heading, “Real-Life.”

Finally, it presents some hard-to-solve scalability and security challenges of Ajax portals and 13 production disasters that are common to web applications that reach millions of users all over the world.

Here’s a chapter-by-chapter summary:

Chapter 1, Introducing Web Portals and Dropthings.OmarALZabir.com

Introduces you to the attributes of a web portal and to the applications that you will learn to build throughout the book. Chapter 1 also shows you how ASP.NET AJAX and .NET 3.5 are used in the product.

Chapter 2, Architecting the Web Portal and Widgets

Gives you an architectural overview of Dropthings.OmarALZabir.com. It also explains the widget architecture and how to build highly decoupled web applications using widgets. It touches on some performance and security challenges of Ajax web sites.

Chapter 3, Building the Web Layer Using ASP.NET AJAX

Gives a detailed explanation on how the web application is built, starting from the homepage and the widgets. It shows how the drag-and-drop functionality is provided using ASP.NET AJAX 1.0, how a real widget is built, and how ASP.NET 3.5 is used to build the server-side part of the web layer.

Chapter 4, Building the Data and Business Layers Using .NET 3.5

Shows how LINQ is used to build the data access later and .NET 3.0 is used to build the business layer by extensively using Workflow Foundation.

Chapter 5, Building Client-Side Widgets

Shows how to build widgets using JavaScript for faster performance and better caching. It shows how a content bridge or proxy service is built that allows widgets to fetch content from external sources.

Chapter 6, Optimizing ASP.NET AJAX

Goes deep into Ajax-enabled principles for making sites faster, more cache friendly, and scalable. It talks about browser specific challenges and many under-the-hood techniques to get maximum performance out of the Ajax framework.

Chapter 7, Creating Asynchronous, Transactional, Cache-Friendly Web Services

Shows you how to build a custom web service call handler for Ajax calls in order to overcome some shortcomings in ASP.NET AJAX 1.0 and enable your web services to become asynchronous, transactional, and more cache-friendly. It also talks about scalability and security challenges of web applications that rely heavily on web services.

Chapter 8, Improving Server-Side Performance and Scalability

An ASP.NET 2.0 web application has many scalability and performance surprises as it grows from a hundred-user to a million-user web site. Learn how to solve performance, reliability, and scalability challenges of a high volume web site.

Chapter 9, Improving Client-Side Performance

Ajax web sites provide a lot of functionality on the client-side browser that introduces many browser specific challenges and JavaScript performance problems. This chapter provides many tips and tricks for overcoming speed and memory problems on the browser and making the UI load faster and be more responsive.

Chapter 10, Solving Common Deployment, Hosting, and Production Challenges

Last step of a web project development is to successfully deploy the product and run it 24x7. Learn what it takes to deploy and run a high volume production web site solving software, hardware, hosting, and internet infrastructure problems that can bring down your web site and cause great harm to your business.

What You Need to Use this Book

You need Visual Studio 2008 Professional Edition and SQL Server 2005 Developer Edition. You can download the latest source code of the open source project from www.codeplex.com/dropthings and set it up locally.

The open source project running at Dropthings will greatly benefit from your contribution. You are welcome to participate in its development by extending the core framework or building new widgets for the project.

Conventions Used in This Book

The following typographical conventions are used in this book:

Plain text

Indicates menu titles, menu options, menu buttons, and keyboard accelerators (such as Alt and Ctrl).

Italic

Indicates new terms, URLs, email addresses, filenames, file extensions, path-names, directories, and Unix utilities.

Constant width

Indicates commands, options, switches, variables, attributes, keys, functions, types, classes, namespaces, methods, modules, properties, parameters, values, objects, events, event handlers, XML tags, HTML tags, macros, the contents of files, or the output from commands.

Constant width bold

Shows commands or other text that should be typed literally by the user.

Constant width italic

Shows text that should be replaced with user-supplied values.

Tip

This icon signifies a tip, suggestion, or general note.

Warning

This icon indicates a warning or caution.

Using Code Examples

This book is here to help you get your job done. In general, you may use the code in this book in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing a CD-ROM of examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.

We appreciate, but do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: “Building a Web 2.0 Portal with ASP. NET 3.5, by Omar AL Zabir. Copyright 2008 Omar AL Zabir, 978-0-596-51050-3.”

If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us at

Safari® Books Online

Safari Books Online (www.safaribooksonline.com) is an on-demand digital library that delivers expert content in both book and video form from the world’s leading authors in technology and business.

Safari offers a solution that’s better than e-books. It’s a virtual library that lets you easily search thousands of top tech books, cut and paste code samples, download chapters, and find quick answers when you need the most accurate, current information.

How to Contact Us

Please address comments and questions concerning this book to the publisher:

O’Reilly Media, Inc.
1005 Gravenstein Highway North
Sebastopol, CA 95472
800-998-9938 (in the United States or Canada)
707-829-0515 (international or local)
707-829-0104 (fax)

There is a web page for this book, where we list errata, examples, and any additional information. You can access this page at:

http://www.oreilly.com/catalog/9780596510503

To comment or ask technical questions about this book, send email to:

For more information about our books, conferences, Resource Centers, and the O’Reilly Network, see our web site at:

http://www.oreilly.com

The author of this book and Dropthings project can be reached at:

The code for this book can be found here:

www.codeplex.com/dropthings

Acknowledgments

My deepest respect and appreciation to my parents for their support in writing this book. Special thanks to Mike Pope at Microsoft and Craig Wills at Infusion for their sincere support, ideas, and thorough reviews.

Get Building a Web 2.0 Portal with ASP.NET 3.5 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.