Programming .NET 3.5

Book description

.NET 3.5 will help you create better Windows applications, build Web Services that are more powerful, implement new Workflow projects and dramatically enhance the user's experience. But it does so with what appears to be a collection of disparate technologies. In Programming .NET 3.5, bestselling author Jesse Liberty and industry expert Alex Horovitz uncover the common threads that unite the .NET 3.5 technologies, so you can benefit from the best practices and architectural patterns baked into this newest generation of Microsoft frameworks.

While single-topic .NET 3.5 books delve into Windows Presentation Foundation and the other frameworks in greater detail, Programming .NET 3.5 offers a "Grand Tour" of the release that describes how the four principal technologies can be used together, with Ajax, to build modern n-tier and service-oriented applications. Developers have struggled to implement these patterns with previous versions of the .NET Framework, but this hands-on guide uses real-world examples and fully annotated source code to demonstrate how .NET 3.5 can make it easy.

The concepts and technologies that this book covers include:

  • XAML -- Microsoft's new XML-based markup language for UI, used with WPF
  • Windows Presentation Foundation (WPF) -- a new presentation framework and graphics subsystem for Windows that puts Vista-like effect in your grasp
  • Ajax
  • Windows Communication Foundation (WCF) - a new standards-based framework that enables applications to communicate across a network using a variety of protocols
  • Workflow Foundation (WF) -- framework for defining, executing, and managing workflows
  • CardSpace -- framework for managing the identities of your users

You'll learn how to use each of the four frameworks alone and in concert to build a series of meaningful example applications. Examples are written in C#, and all of the source code will be available for download at both the O'Reilly and the authors' site, which offers access to a free support forum.

Between them, authors Jesse Liberty and Alex Horovitz have nearly forty years of experience in delivering commercial applications for companies such as Citibank, Apple, AT&T, NeXt, PBS, Ziff Davis, and dozens of smaller organizations. Their combined experience is valuable for telling the story of .NET 3.5 and how it will shorten the development life cycle for applications developers, and enhance your productivity.

Publisher resources

View/Submit Errata

Table of contents

  1. Programming .NET 3.5
    1. SPECIAL OFFER: Upgrade this ebook with O’Reilly
    2. A Note Regarding Supplemental Files
    3. Preface
      1. Who This Book Is For
      2. How This Book Is Organized
        1. Part I, Presentation Options
        2. Part II, Interlude on Design Patterns
        3. Part III, The Business Layer
      3. What You Need to Use This Book
      4. Conventions Used in This Book
      5. Using Code Examples
      6. Comments and Questions
      7. Safari® Books Online
      8. Acknowledgments
    4. I. Presentation Options
      1. 1. .NET 3.5: A Better Framework for Building MVC, N-Tier, and SOA Applications
        1. Integration Versus Silos
          1. Big Ideas, Small Examples
          2. It Ain't Just the Framework
          3. It's a Moving Target
        2. What? All That in One Book?
      2. 2. Introducing XAML: A Declarative Way to Create Windows UIs
        1. XAML 101
          1. Interface Versus Implementation
          2. Getting Yourself Up and Running
        2. Simple XAML Done Simply
          1. Panel Elements
          2. Root Elements
          3. Control Elements
            1. Simple controls
            2. Content controls
            3. Item controls
            4. Headered content controls
          4. Document Elements
        3. Over Here…No, Wait, I Meant Over There!
          1. StackPanel and DockPanel
            1. Moving beyond columns and rows
        4. It's Alive! (Or, How I Learned to Stop Worrying and Love Animation)
          1. Animation Overview
          2. The Animation Storyboard
          3. Hooked Yet?
      3. 3. Introducing Windows Presentation Foundation: A Richer Desktop UI Experience
        1. Starting Simple: Panels
          1. DockPanel
            1. Order of declaration is important
          2. StackPanel
          3. Canvas and ViewBox
          4. Control Presentation
            1. Resources
            2. Styles
            3. Making effects more pronounced
        2. Nesting
        3. Resources
        4. Transformations
        5. Animation
          1. Simultaneous Animations
          2. A Composite Control
        6. Data Binding
          1. Creating a CheckOut Application in Visual Studio
          2. Binding to a List
          3. Master/Detail Records
            1. Event handling
      4. 4. Applying WPF: Building a Biz App
        1. Breaking the Application into Pieces
        2. Adorners
        3. Business Classes
        4. Page 1—Adding Items to the Shopping Cart
          1. Displaying the Selected Image
          2. Adding Cropping with the Adorner
            1. MouseDown
            2. Handling the Crop button
          3. Adding the Shopping Cart
            1. Adding scroll bars
        5. Page 2—Validating the Credit Card
          1. Layout
          2. Validating the Credit Card
      5. 5. Introducing AJAX: Moving Desktop UIs to the Web
        1. Web Applications Just Got a Whole Lot Faster
        2. Getting Started
          1. ASP.NET and JavaScript
        3. Creating a "Word Wheel" with AJAX
          1. The Data
          2. The Pages
          3. Where the Action Is
            1. Security issues
            2. Asynchronous updates
          4. Step-by-Step Walkthrough
        4. ScriptManager
          1. Partial Page Rendering
          2. A Better Calendar Control
          3. Adding a Watermark
          4. Adding Stylesheets to Extender Controls
        5. What's Next?
      6. 6. Applying AJAX: ListMania
        1. Creating the To-Do List Manager
          1. Create the Application Master Page
          2. Create the Database
          3. Create the To-Do List Page
          4. Persist the List
        2. Personalizing the To-Do List
          1. Confirm the Database Table
          2. Create a DataHelper Class
          3. Create the Login Page
          4. The CollapsiblePanelExtender Control
      7. 7. Introducing Silverlight: A Richer Web UI Platform
        1. Silverlight in One Chapter
        2. The Breadth of Silverlight
        3. Diving Deep: Building an Application
        4. Controls
          1. Canvases
          2. StackPanels
            1. Horizontal StackPanels
          3. Grids
            1. Sizing rows and columns
            2. Placing controls into cells
        5. Events and Event Handlers
          1. Declaring Event Handlers in Code
          2. The Content Property
            1. Property elements
        6. Creating Controls Dynamically
        7. Data Binding
          1. Binding to a Business Object
          2. DataContext
          3. The Event Handlers
        8. Styling Controls
          1. Applying Styles Inline
          2. Creating and Using Style Objects
    5. II. Interlude on Design Patterns
      1. 8. Implementing Design Patterns with .NET 3.5
        1. .NET 3.5 Fosters Good Design
          1. Undermining Good Design?
          2. Standing on the Shoulders of Giants
          3. Software Design Patterns
        2. The N-Tier Pattern
        3. The MVC Pattern
          1. The ASP.NET MVC Framework
            1. Controller classes and action methods
            2. Model classes
            3. View classes
          2. An MVC Example
            1. Creating the database
            2. Creating the MVC application
            3. The model
            4. The controller
            5. The view(s)
            6. Adding new people to the database
        4. The Observer Pattern/Publish and Subscribe
          1. An Observer Example
          2. Running the Code
        5. The Factory Method Pattern
          1. A Factory Method Example
        6. The Chain-of-Command Pattern
          1. A Chain-of-Command Example
        7. The Singleton Pattern
          1. Singletons and Multithreading
          2. A Singleton Example
    6. III. The Business Layer
      1. 9. Understanding LINQ: Queries As First-Class Language Constructs
        1. Defining and Executing a LINQ Query
          1. Creating the Query
            1. The from clause
            2. Filtering
            3. Projection
          2. Deferred Query Evaluation
          3. Joining
          4. Ordering
          5. Implicitly Typed Local Variables
          6. Anonymous Types
          7. Grouping
        2. Extension Methods
          1. Defining and Using Extension Methods
          2. Lambda Expressions in LINQ
        3. Adding the AdventureWorksLT Database
        4. LINQ to SQL Fundamentals
        5. Using the Visual Studio LINQ to SQL Designer
        6. Retrieving Data
          1. Creating Properties for Each Table
          2. A LINQ Query
        7. LINQ to XML
      2. 10. Introducing Windows Communication Foundation: Accessible Service-Oriented Architecture
        1. Defining a Service More Precisely
          1. Boundaries Are Explicit
          2. Services Are Autonomous
          3. Schemas and Contracts Are Shared, But Not Classes
          4. Compatibility Is Based on Policy
        2. Implementing Web Services
          1. SOAP: More Than Just a Cleanser
          2. WSDL Documents: Describing the Service Endpoints
        3. UDDI: Who Is Out There, and What Can They Do for Me?
          1. UDDI Data Types
        4. How It All Works
        5. WCF's SOA Implementation
          1. The ABCs of WCF
            1. Addresses
            2. Bindings
            3. Contracts
          2. Talk Amongst Yourselves
        6. Putting It All Together
      3. 11. Applying WCF: YahooQuotes
        1. Creating and Launching a Web Service
          1. Creating the Service
          2. Launching the Web Service
        2. Consuming the Web Service
          1. Creating a WPF Client Application
      4. 12. Introducing Windows Workflow Foundation
        1. Conventional (Pre-WF) Flow Control
          1. A Console Application: TalkBack
          2. An ASP.NET Web Service: OrderStatus
        2. Using Windows Workflow
          1. Activities
          2. A Simple Workflow Application: HelloWorkflow
            1. Adding activities
            2. Implementing the first Code activity
            3. Adjusting the Delay activity's properties
            4. Completing the workflow
          3. A More Sophisticated Workflow Application: WFOrderStatus
            1. Adding the IfElse activity
            2. Adding Code activities for the IfElseBranches
            3. Declarative rule conditions
            4. Looping with the While activity
        3. Understanding the WF Runtime
        4. Workflow Services
      5. 13. Applying WF: Building a State Machine
        1. Windows Workflow and State Machines
        2. Building an Incident Support State Machine
          1. State
          2. An Event-Driven State Machine
          3. Run 'Em If You Got 'Em
          4. Persisting Your State (Machine)
          5. Back to Our Regularly Scheduled Programming
      6. 14. Using and Applying CardSpace: A New Scheme for Establishing Identity
        1. About Windows CardSpace
          1. Understanding the Identity Metasystem
        2. Creating a CardSpace Identity
          1. What You Need for Our CardSpace Examples
          2. CardSpace on Board, Ready to Create My Identity
          3. Using Your Card
        3. Adding CardSpace Support to Your Application
          1. Setting Up Your Machine for the CardSpace Examples
            1. IIS7
            2. About the certificates
            3. \etc\hosts
          2. Configuring IIS for Your Application
          3. Creating a Sample ASP.NET Application
          4. Processing the Information Card
        4. Summary
    7. A. Epilogue
    8. Index
    9. About the Authors
    10. Colophon
    11. SPECIAL OFFER: Upgrade this ebook with O’Reilly

Product information

  • Title: Programming .NET 3.5
  • Author(s): Jesse Liberty, Alex Horovitz
  • Release date: July 2008
  • Publisher(s): O'Reilly Media, Inc.
  • ISBN: 9780596551414