[go: nahoru, domu]

Jump to content

UI data binding: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
wikified; fixed JSR number
 
(43 intermediate revisions by 34 users not shown)
Line 1: Line 1:
{{Unreferenced|date=March 2009}}
{{Refimprove|date=February 2015}}


'''UI data binding''' is a [[Design pattern (computer science)|software design pattern]] to simplify development of [[GUI]] applications. UI [[data binding]] binds UI elements to an application [[domain model]]. Most frameworks employ the [[Observer pattern]] as the underlying binding mechanism. To work efficiently, UI data binding has to address [[Data validation|input validation]] and data type mapping.
'''UI data binding''' is a [[Design pattern (computer science)|software design pattern]] to simplify development of [[GUI]] applications. UI [[data binding]] binds UI elements to an application [[domain model]]. Most frameworks employ the [[Observer pattern]] as the underlying binding mechanism. To work efficiently, UI data binding has to address [[Data validation|input validation]] and data type mapping.


A ''bound control'' is a [[GUI widget|widget]] whose value is tied or [[data binding|bound]] to a field in a [[recordset]] (i.e., a [[column (database)|column]] in a [[row (database)|row]] of a [[table (database)|table]]). Changes made to data within the control are automatically saved to the database when the control's exit [[event trigger]]s.
A ''bound control'' is a [[GUI widget|widget]] whose value is tied or [[data binding|bound]] to a field in a [[recordset]] (e.g., a [[column (database)|column]] in a [[row (database)|row]] of a [[table (database)|table]]). Changes made to data within the control are automatically saved to the database when the control's exit [[event trigger]]s.

== Example ==
<syntaxhighlight lang="xml">
<TextBlock Text="{Binding Username}" />
</syntaxhighlight>
<syntaxhighlight lang="csharp">
public class ExampleViewModel
{
public string Username { get; set; }
}
</syntaxhighlight>


== Data binding frameworks and tools ==
== Data binding frameworks and tools ==

=== [[Delphi (programming language)|Delphi]] ===
* [[DSharp (data binding)|DSharp]] third-party data binding tool{{cn|date=December 2016}}
* [[OpenWire (library)|OpenWire]] Visual Live Binding - third-party visual data binding tool

=== Java ===
=== Java ===
* [[JFace]] Data Binding
* JSR-227 A Standard Data Binding & Data Access Facility for J2EE [http://jcp.org/en/jsr/detail?id=227]
* [[JavaFX]] Property<ref>{{Cite web | url=https://docs.oracle.com/javafx/2/binding/jfxpub-binding.htm |title = Using JavaFX Properties and Binding &#124; JavaFX 2 Tutorials and Documentation}}</ref>
* [[JFace]] Data Binding [http://wiki.eclipse.org/index.php/JFace_Data_Binding]


=== .NET ===
=== .NET ===
* [[Windows Forms]] data binding overview [http://msdn.microsoft.com/en-us/library/aa984214.aspx]
* [[Windows Forms]] data binding overview
* [[Windows Presentation Foundation|WPF]] data binding overview [http://msdn.microsoft.com/en-us/library/ms752347.aspx]
* [[Windows Presentation Foundation|WPF]] data binding overview
* Unity 3D data binding framework (available in modifications for NGUI, iGUI and EZGUI libraries) [http://tools.artofbytes.com/]
* Unity 3D data binding framework (available in modifications for NGUI, iGUI and EZGUI libraries){{cn|date=December 2016}}


=== JavaScript ===
=== JavaScript ===
* [[Angular_(web_framework)|Angular]]
* [http://knockoutjs.com/ knockout.js]
* [[AngularJS]]
* [http://backbonejs.org/ Backbone.js]
* [[Backbone.js]]
* [http://rivetsjs.com/ Rivets.js]
* [[Ember.js]]
* Datum.js<ref>{{cite web |url=http://datumjs.com|title=Datum.js|access-date=7 November 2016}}</ref>
* [[knockout.js]]
* [[Meteor (web framework)|Meteor]], via its ''Blaze'' live update engine<ref>{{cite web|title=Meteor Blaze|url=https://www.meteor.com/blaze|quote=Meteor Blaze is a powerful library for creating live-updating user interfaces. Blaze fulfills the same purpose as Angular, Backbone, Ember, React, Polymer, or Knockout, but is much easier to use. We built it because we thought that other libraries made user interface programming unnecessarily difficult and confusing.}}</ref>
* [[OpenUI5]]
* [[React (JavaScript library)|React]]
* [[Vue.js]]


==See also==
==See also==
*[[Data binding]]
* [[Data binding]]

==References==
{{Reflist}}


[[Category:Data management]]
[[Category:Data management]]
[[Category:Software design patterns]]
[[Category:Software design patterns]]



{{compu-prog-stub}}
{{compu-prog-stub}}

Latest revision as of 16:47, 20 September 2021

UI data binding is a software design pattern to simplify development of GUI applications. UI data binding binds UI elements to an application domain model. Most frameworks employ the Observer pattern as the underlying binding mechanism. To work efficiently, UI data binding has to address input validation and data type mapping.

A bound control is a widget whose value is tied or bound to a field in a recordset (e.g., a column in a row of a table). Changes made to data within the control are automatically saved to the database when the control's exit event triggers.

Example

[edit]
<TextBlock Text="{Binding Username}" />
public class ExampleViewModel
{
    public string Username { get; set; }
}

Data binding frameworks and tools

[edit]

Java

[edit]

.NET

[edit]
  • Windows Forms data binding overview
  • WPF data binding overview
  • Unity 3D data binding framework (available in modifications for NGUI, iGUI and EZGUI libraries)[citation needed]

JavaScript

[edit]

See also

[edit]

References

[edit]
  1. ^ "Using JavaFX Properties and Binding | JavaFX 2 Tutorials and Documentation".
  2. ^ "Datum.js". Retrieved 7 November 2016.
  3. ^ "Meteor Blaze". Meteor Blaze is a powerful library for creating live-updating user interfaces. Blaze fulfills the same purpose as Angular, Backbone, Ember, React, Polymer, or Knockout, but is much easier to use. We built it because we thought that other libraries made user interface programming unnecessarily difficult and confusing.