data binding (original) (raw)

What is data binding?

Data binding is the process that couples two data sources together and synchronizes them. With data binding, a change to an element in a data set automatically updates in the bound data set.

Data binding may be used for many reasons, such as to link an application's user interface (UI) and the data it displays, for data entry, reporting and in text box elements. It also lets internet users manipulate the representation of data in the elements of a web page without needing to use a complicated programming or scripting processes.

Data and data objects of different logic functions can be bound together in data binding. Data types with different languages can also be bound, such as data binding Extensible Markup Language (XML) and UI.

Each data change in one data set automatically reflects in the other bound data set. In binding syntax, the data source is the data provider, and the other data set is the data consumer. The binding forms the link between the data provider and the data consumer, enabling the connection between visual element data and a data source.

Data binding eliminates the need for Document Object Model (DOM) manipulation. DOM is an application programming interface, or API, for Hypertext Markup Language (HTML) and XML.

What are the types of data binding?

Types of data binding are typically defined by their data flow and include the following:

Data binding can be simple or complex. Microsoft defines simple data binding as the ability to bind to a single data element. Complex data binding is when multiple elements are bound together.

diagram of how data binding works

Learn how data binding works through this visualization.

How to use data binding

The data binding architecture consists of data source objects (DSOs) that supply information to viewed pages. DSOs also supply information to data consumers that display the DSO information and agents that ensure the data is synchronized between the DSOs and the consumers.

In a Windows .NET framework, both simple and complex data binding options are available. Simple data binding is configured so that one control in the UI is bound to the data value from the data source.

Windows Presentation Foundation in .NET uses data binding by connecting the properties of target objects and data sources, including Common Language Runtime, Language Integrated Query and XML objects. Data templates are also provided to control the presentation of data.

Data binding libraries enable users to bind UI components to data sources in a declarative format. These libraries also provide classes and methods to make changes in data observable. Consequently, collections, fields and objects are more visible.

Data binding examples

The following examples show how data binding can be used:

Data binding tools

Data binding tools include the following:

Learn about security compromises in XML data binding and other automated processes found in third-party toolkits.

This was last updated in May 2022

Continue Reading About data binding