Data Binding and Asynchronous Business Objects - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

Data Binding and Asynchronous Business Objects

Description:

Data Binding and Asynchronous Business Objects. Paul Stovell. www.paulstovell.net. Or... Reason for this presentation. Designed to teach basic double-entry ... – PowerPoint PPT presentation

Number of Views:97
Avg rating:3.0/5.0
Slides: 14
Provided by: ssw6
Category:

less

Transcript and Presenter's Notes

Title: Data Binding and Asynchronous Business Objects


1
Data Binding and Asynchronous Business Objects
Or... AJAX for Windows Forms
  • Paul Stovell
  • www.paulstovell.net

2
Before we begin
  • Data Binding

! DataSets
Bad ?
Good ?
3
Trial Balance
  • Personal Project
  • Reason for this presentation
  • Designed to teach basic double-entry accounting
    to high school and university students.
  • Uses multiple data providers Access, XML, SQL
    Server
  • Windows Presentation Foundation UI
  • Available at www.paulstovell.net

4
Principals
5
ErrorProvider The most abused component?
  • Detects and displays errors from data sources
  • Data Sources should implement
  • IDataErrorInfo (System.ComponentModel)
  • INotifyPropertyChanged (System.ComponentModel)

6
The Problem
  • Lots of accounts
  • Each account shows an Opening and Closing
    Balance, which must be calculated

7
Step 1
  • Using a BackgroundWorker to calculate the Opening
    and Closing balance
  • Drawbacks
  • Duplicated code.
  • Still have to wait for accounts to load.

8
Step 2
  • Anonymous delegates and inheritance to reduce
    code duplication.
  • Drawbacks
  • Duplicated code.
  • Still have to wait for accounts to load.

9
Step 3
  • Custom collection class for lazy loading.
  • Drawbacks
  • Duplicated code.
  • Still have to wait for accounts to load.
  • w0ot!!

10
Extras
  • Custom DataGridView Column/Cell
  • Filtering

11
Principals
12
Conclusion
  • INotifyPropertyChanged
  • ErrorProvider and IDataErrorInfo
  • BackgroundWorker
  • Easy peasy lemon-squeezie!
  • Suggested uses
  • Complex database queries
  • Legacy systems/licensing problems
  • Web services/remoting
  • Calling Java systems ?
  • Data Binding rocks!

13
Links and Resources
  • Brian Noyes
  • .NET Rocks! - Brian Noyes on Data Binding in .NET
    2.0http//shrinkster.com/gjq (G J Q)
  • Amazon Data Binding with Windows Forms
    2.0http//shrinkster.com/gjr (G J R)
  • Delegates and Business Objects (more
    ErrorProvider information)
  • http//shrinkster.com/gpk (G P K)
  • SSW Rules to Better Windows Forms
  • http//shrinkster.com/gpl (G P L)
  • Trial Balance
  • http//shrinkster.com/gpm (G P M)
  • Interfaces Related to Data Binding
  • http//shrinkster.com/gpn (G P N)
Write a Comment
User Comments (0)
About PowerShow.com