JP5010625B2 - Recording medium and system storing program for controlling user interface property by data - Google Patents
Recording medium and system storing program for controlling user interface property by data Download PDFInfo
- Publication number
- JP5010625B2 JP5010625B2 JP2009032012A JP2009032012A JP5010625B2 JP 5010625 B2 JP5010625 B2 JP 5010625B2 JP 2009032012 A JP2009032012 A JP 2009032012A JP 2009032012 A JP2009032012 A JP 2009032012A JP 5010625 B2 JP5010625 B2 JP 5010625B2
- Authority
- JP
- Japan
- Prior art keywords
- binding
- user interface
- source data
- data value
- property
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61K—PREPARATIONS FOR MEDICAL, DENTAL OR TOILETRY PURPOSES
- A61K47/00—Medicinal preparations characterised by the non-active ingredients used, e.g. carriers or inert additives; Targeting or modifying agents chemically bound to the active ingredient
- A61K47/50—Medicinal preparations characterised by the non-active ingredients used, e.g. carriers or inert additives; Targeting or modifying agents chemically bound to the active ingredient the non-active ingredient being chemically bound to the active ingredient, e.g. polymer-drug conjugates
- A61K47/51—Medicinal preparations characterised by the non-active ingredients used, e.g. carriers or inert additives; Targeting or modifying agents chemically bound to the active ingredient the non-active ingredient being chemically bound to the active ingredient, e.g. polymer-drug conjugates the non-active ingredient being a modifying agent
- A61K47/62—Medicinal preparations characterised by the non-active ingredients used, e.g. carriers or inert additives; Targeting or modifying agents chemically bound to the active ingredient the non-active ingredient being chemically bound to the active ingredient, e.g. polymer-drug conjugates the non-active ingredient being a modifying agent the modifying agent being a protein, peptide or polyamino acid
- A61K47/64—Drug-peptide, drug-protein or drug-polyamino acid conjugates, i.e. the modifying agent being a peptide, protein or polyamino acid which is covalently bonded or complexed to a therapeutically active agent
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61K—PREPARATIONS FOR MEDICAL, DENTAL OR TOILETRY PURPOSES
- A61K38/00—Medicinal preparations containing peptides
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61K—PREPARATIONS FOR MEDICAL, DENTAL OR TOILETRY PURPOSES
- A61K47/00—Medicinal preparations characterised by the non-active ingredients used, e.g. carriers or inert additives; Targeting or modifying agents chemically bound to the active ingredient
- A61K47/30—Macromolecular organic or inorganic compounds, e.g. inorganic polyphosphates
- A61K47/42—Proteins; Polypeptides; Degradation products thereof; Derivatives thereof, e.g. albumin, gelatin or zein
-
- A—HUMAN NECESSITIES
- A61—MEDICAL OR VETERINARY SCIENCE; HYGIENE
- A61K—PREPARATIONS FOR MEDICAL, DENTAL OR TOILETRY PURPOSES
- A61K48/00—Medicinal preparations containing genetic material which is inserted into cells of the living body to treat genetic diseases; Gene therapy
-
- C—CHEMISTRY; METALLURGY
- C07—ORGANIC CHEMISTRY
- C07K—PEPTIDES
- C07K2319/00—Fusion polypeptide
Landscapes
- Engineering & Computer Science (AREA)
- Health & Medical Sciences (AREA)
- Life Sciences & Earth Sciences (AREA)
- Proteomics, Peptides & Aminoacids (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Theoretical Computer Science (AREA)
- Molecular Biology (AREA)
- Epidemiology (AREA)
- Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Chemical & Material Sciences (AREA)
- Medicinal Chemistry (AREA)
- Pharmacology & Pharmacy (AREA)
- General Physics & Mathematics (AREA)
- Animal Behavior & Ethology (AREA)
- General Health & Medical Sciences (AREA)
- Public Health (AREA)
- Veterinary Medicine (AREA)
- Stored Programmes (AREA)
- User Interface Of Digital Computer (AREA)
Description
本発明は、ユーザインターフェースプロパティをデータにより制御するためのプログラムを格納した記録媒体およびシステムに関する。 The present invention relates to a recording medium and a system storing a program for controlling user interface properties by data.
ユーザに情報がどのように提示されるかにより、ユーザが情報をどの程度理解し把握できるかが決まる。コンピュータの表示装置では、色、フォントのスタイルなどを使用することにより、情報に強調(emphasis)を加えるのが標準的慣例となっている。このような強調を加えると、ユーザは情報の重要性を容易に把握することができる。情報(ユーザインターフェース)の表示を処理するコードおよび情報に対しアプリケーションのロジックを実行するコードは、通常、密接に結びついている。例えば、ロジックは、ユーザインターフェースのプロパティ(例えば、色、フォント、位置、サイズ)に直接データを割り当てる。したがって、ユーザインターフェースに変更があれば、ロジックも変わらなければならない。例えば、テキストボックス(text box)の場合、ユーザインターフェースコード(user interface code)はリッスン(listen)してテキストが変更(change)されたかどうかを判定(determine)し、変更(a change)があった場合、ユーザインターフェースコードは変更されたテキスト(changed text)が有効かどうかを確認(validate)し、その後、変更されたテキスト(changed text)を表示(display)する。ユーザインターフェースとロジックがこのように密接に結びついているという性質(nature)のため、コードは非常に脆弱(fragile)なものとなる。この脆弱なコード(fragile code)のメンテナンス(maintaining)は、非常にコストがかかり、時間も要する。 How the information is presented to the user determines how much the user can understand and grasp the information. In computer display devices, it is standard practice to add emphasis to information by using colors, font styles, and the like. By adding such emphasis, the user can easily grasp the importance of information. The code that handles the display of information (user interface) and the code that executes application logic on the information are usually closely tied. For example, the logic directly assigns data to user interface properties (eg, color, font, position, size). Therefore, if the user interface changes, the logic must change. For example, in the case of a text box, the user interface code is listened to determine if the text has changed, and there has been a change. If so, the user interface code validates whether the changed text is valid, and then displays the changed text. Because of this close nature of the user interface and logic, the code is very fragile. The maintenance of this fragile code is very expensive and time consuming.
本発明は、ユーザインターフェースプロパティをデータにより制御するプログラムを格納した記録媒体およびシステムを提供する。 The present invention provides a recording medium and system storing a program for controlling user interface properties by data.
本発明は、データをユーザインターフェースに関連付けるメカニズムを用意することにより、ユーザインターフェースとデータをそのアプリケーションロジック(application logic)とともに分離(decouple)する。本発明により、アプリケーションロジックを書くユーザインターフェース設計者(user interface designers)およびアプリケーション作成者(application authors)は独立に作業することができる。設計者(designers)も作成者(authors)も、互いに相手のコード(other's code)を理解する必要がないか、あるいは相手のコード開発(other's code development)に影響を与える(impact)こともない。本発明では、さらに、ユーザインターフェースへの変更をまったく簡単に行うことができる。例えば、新しい、よりユーザに訴える力のあるユーザインターフェースプラットフォーム(user interface platform)が使用可能になった場合、またはユーザインターフェース設計者がアプリケーションの外観(look of the application)を変更したくなった場合でも、設計者はアプリケーションロジック(application logic)を変更(change)する必要はない。さらに、データをユーザインターフェースに関連付けるメカニズムは、動的(dynamic)である。これにより、データの変更を自動的にプレゼンテーションに反映させることができる。さらに、ユーザインターフェースを介してユーザが行った入力により自動的にデータをアップデートすることができる。本発明を使用すると、ユーザインターフェースのデータ表示態様(data display aspect)(例えば、テキスト)だけでなく視覚的態様(visual aspect)(例えば、背景、フォントサイズなど)の関連付け(association)を行えるので、データの記述的な、視覚的効果の高い、柔軟性の高いプレゼンテーションが可能になる。例えば、株価が上昇しているときに、負数は赤色で表示されるか、または矢印は上方向を指すように表示できる。 The present invention provides a mechanism for associating data with a user interface, thereby decoupling the user interface and data along with its application logic. The present invention allows user interface designers and application authors who write application logic to work independently. Neither designers nor authors need to understand each other's code or affect other's code development. In the present invention, it is also possible to make changes to the user interface quite simply. For example, if a new, more user-friendly user interface platform becomes available or the user interface designer wants to change the look of the application The designer does not need to change the application logic. Furthermore, the mechanism for associating data with the user interface is dynamic. Thereby, the data change can be automatically reflected in the presentation. Furthermore, the data can be automatically updated by the input made by the user via the user interface. Using the present invention, it is possible to associate not only the data display aspect (eg, text) of the user interface, but also the visual aspect (eg, background, font size, etc.) Allows descriptive, highly visual and flexible presentation of data. For example, when the stock price is rising, negative numbers can be displayed in red, or arrows can be displayed pointing up.
したがって、本発明によれば、アプリケーション(an application)は、独立したパーツ(independent parts)と、ロジック部分(a logic portion)と、UI部分(UI portion)とに分けられる。ロジック部分では、アプリケーション内のデータバリュー(data values)を操作(manipulate)する。UI部分は、データのプレゼンテーション(presentation of the data)を受け持つ。バインディング仕様(binding specification)により、UIプロパティ(UI property)とデータバリュー(data value)との間の関係を記述(describe)する。バインディング仕様は、データバリューに変更(a change)が生じたときに通知される方法と、その変更をUIプロパティに反映(reflect)するようにUI部分を指令する方法を決定するために、システムレベルコード(system level code)により使用される。バインディング仕様は、ソースデータ項目(source data item)、ソースデータ項目内のデータバリューへのパス(a path to the data value)、ターゲットUIエレメント(target UI element)、およびターゲットUIエレメントのUIプロパティ(UI property on the target element)を識別(identify)する。バインディング(binding)は、コードまたはマークアップ言語(markup language)を使用して特定(specify)される。 Therefore, according to the present invention, an application is divided into independent parts, a logic portion, and UI portion. In the logic part, data values in the application are manipulated. The UI part is responsible for the presentation of the data. A relationship between a UI property and a data value is described by a binding specification. The binding specification is system level to determine how to be notified when a change occurs in the data value and how to instruct the UI part to reflect that change in the UI properties. Used by system level code. The binding specification includes a source data item, a path to the data value in the source data item, a target UI element, and a UI property (UI for the target UI element). property on the target element). A binding is specified using code or a markup language.
本発明は、ユーザインターフェースをデータにより制御するシステムおよび方法を対象とする。本発明は、データをユーザインターフェースに関連付けるメカニズムを用意することにより、ユーザインターフェースとアプリケーションロジックとを分離する。後に詳述するが、関連するロジックとともに、ユーザインターフェースとデータとの間で行われるこのような分離により、さまざまな開発者グループは、他のグループのコード開発に影響を与えることなく、ユーザインターフェースおよびロジックの両方を取り扱うことができる。さらに、後に詳述するが、本発明は、データソースからユーザインターフェースへ、ユーザインターフェースからデータソースへデータを自動的に転送するシステムをおよびメカニズムを実現する。以下の説明全体を通して、「データバインディング(databinding)」という用語は、データバリュー(data value)をUIプロパティに関連付け、データバリューを転送(transfer)しアップデート(update)するなどのプロセスを指す。 The present invention is directed to a system and method for controlling a user interface with data. The present invention separates the user interface and application logic by providing a mechanism for associating data with the user interface. As detailed below, this separation between the user interface and the data, along with the associated logic, allows various groups of developers to interact with the user interface and without affecting the other groups' code development. Both logic can be handled. Further, as described in detail below, the present invention implements a system and mechanism for automatically transferring data from a data source to a user interface and from the user interface to the data source. Throughout the following description, the term “databinding” refers to processes such as associating a data value with a UI property, transferring and updating the data value.
コンピューティング環境
図1は、本発明を実施する際に使用することが可能なコンピューティングデバイスの一例を示す。図1を参照すると、非常に基本的な構成では、コンピューティングデバイス100は、少なくとも1つの処理ユニット102およびシステムメモリ104を備えるのがふつうである。コンピューティングデバイス100の正確な構成と種類に応じて、システムメモリ104は揮発性(RAMなど)、不揮発性(ROM、フラッシュメモリなど)、またはこれら2つの何らかの組み合わせとすることができる。システムメモリ104は、通常、オペレーティングシステム105、1つまたは複数のプログラムモジュール106を格納し、プログラムデータ107を含むこともある。プログラムモジュール106の例としては、ブラウザアプリケーション、財務管理アプリケーション、ワードプロセッサなどがある。基本構成は、図1において点線108内のコンポーネントにより示されている。
Computing Environment FIG. 1 illustrates an example of a computing device that can be used in practicing the present invention. With reference to FIG. 1, in a very basic configuration,
コンピューティングデバイス100は、さらに特徴または機能を追加することもできる。例えば、コンピューティングデバイス100は、磁気ディスク、光ディスク、またはテープなどの追加データ記憶デバイス(取り外し可能および/または取り外し不可能)を備えることもできる。このような追加ストレージ(additional storage)は、図1では、取り外し可能ストレージ109および取り外し不可能ストレージ110により例示されている。コンピュータ記憶媒体は、コンピュータ可読命令、データ構造体、プログラムモジュール、またはその他のデータなどの情報を格納する方法または技術で実施される揮発性および不揮発性、取り外し可能および取り外し不可能媒体を含むことができる。システムメモリ104、取り外し可能ストレージ109、および取り外し不可能ストレージ110は、コンピュータ記憶媒体のすべての例である。コンピュータ記憶媒体としては、RAM、ROM、EEPROM、フラッシュメモリまたはその他のメモリ技術、CD−ROM、デジタル多目的ディスク(DVD)またはその他の光ストレージ、磁気カセット、磁気テープ、磁気ディスクストレージまたはその他の磁気記憶デバイス、または目的の情報を格納するために使用されることができコンピューティングデバイス100によりアクセスされることが可能なその他の媒体がある。このような任意のコンピュータ記憶媒体をデバイス100の一部とすることができる。さらにコンピューティングデバイス100は、キーボード、マウス、ペン、音声入力デバイス、タッチ入力デバイスなどの入力デバイス112を備えることもできる。表示装置、スピーカー、プリンタなどの出力デバイス114を備えることもできる。これらのデバイスは、当業ではよく知られているため、本明細書でさらに詳しい説明をする必要はない。
The
また、コンピューティングデバイス100は、デバイスがネットワークなどで他のデバイス118と通信するために使用する通信接続(communication connection)116も含むことができる。通信接続116は、通信媒体の一例である。通信媒体は、通常、搬送波またはその他のトランスポートメカニズムなどの変調データ信号を介して、コンピュータ可読命令、データ構造体、プログラムモジュール、またはその他のデータによって実現されることができ、情報配信媒体を含む。「変調データ信号(modulated data signal)」という用語は、信号内の情報を符号化する方法によりその特性のうち1つまたは複数が設定または変更された信号を意味する。例えば、通信媒体としては、有線ネットワークまたは直接配線接続などの有線媒体、および音響、RF、赤外線、およびその他の無線媒体などの無線媒体がある。本明細書で使用されているコンピュータ可読媒体という用語は、記憶媒体と通信媒体の両方を含む。
The
実施例
図2は、本発明によりユーザインターフェースプロパティをデータにより制御するシステム200の一実施形態を例示する機能ブロック図である。システム200は、アプリケーション202、プラットフォーム220、およびデータソース230を含む。アプリケーション202は、図1に示されているコンピューティングデバイス100上の複数のアプリケーション106のうちの1つとすることができる。アプリケーション202は、データバリュー(例えば、ソースデータバリュー(source data value)238)を操作するためのコード(これ以降、ロジック204と呼ぶ)を含む。一般に、ロジック204はデータバリューに対し検証(validation)を実行し、データバリューをアップデートする。データバリュー(例えば、データバリュー238)は、データ項目(例えば、データ項目232)のプロパティ(つまり、データソースプロパティ)の内容を表す。データ項目232は、データソース(例えば、データソース230)内に配置されている。それぞれのデータソース230は、複数のデータ項目を含むことができ、それぞれのデータ項目は、1つまたは複数のプロパティを備え、ソースデータバリューがそのプロパティに格納される。ロジック203は、複数のデータソースからのデータバリューを操作することができる。データソースは、XMLドキュメント、オブジェクト、データセットなどを含むことができる。後で詳述するが、データ項目のそれぞれのプロパティは、ユーザインターフェース(UI)を制御するために使用されることが可能である。
Example FIG. 2 is a functional block diagram illustrating one embodiment of a
アプリケーション202はさらに、情報を表示するためのコード(これ以降ユーザインターフェース206と呼ぶ)も含む。ユーザインターフェース206は、複数のユーザインターフェースエレメント(例えば、ユーザインターフェースエレメント208)を含む。それぞれのユーザインターフェースエレメント208は、表示されるテキスト、色、フォント、位置、サイズなどの1つまたは複数のプロパティ(例えば、UIプロパティ210および212)を含む。次に、後で詳述するが、これらのUIプロパティ210および212は、本発明により、データバリュー238および242の1つまたは複数に関連付けられる。一般に、関連付けは、プラットフォーム220内のバインディングエンジン(binding engine)224を介して実行される。プラットフォーム220は、オペレーティングシステム、仮想エンジンなどのシステムレイヤのサービスを表す。プラットフォーム220は、さらに、データバリュー234および242に関係する階層情報を保持し、関連付けられているプロパティをデータバリューでアップデートする役割を持つプロパティエンジン222を備える。バインディングエンジン224およびプロパティエンジン222は別々のコンポーネントとして示されているとしても、当業者であれば、それぞれに備えられている機能は、本発明から逸脱することなく、1つのコンポーネント内に収められることを理解するであろう。
The
データバリュー238および242とそのUIプロパティ210および212との関連付け(つまり、バインディング)は、図2において、データバリューからUIプロパティへの点線で表されている(これ以降バインディング226および228と呼ぶ)。以下の説明では、「データバリュー」という用語は「ソースデータバリュー」という用語に言い換えられることができる。同様、UIプロパティという用語は、「ターゲットプロパティ」という用語に言い換えられることもできる。これらのバインディング226および228を使用すると、動的プロパティ(つまり、ターゲットプロパティ)は任意のオブジェクトのプロパティなどのデータバリュー(つまり、ソースデータバリュー)から自動的に設定されるようにできる。これらのバインディングは動的であり、ソースデータバリューの変更を反映するようにバインドされたターゲットプロパティは自動的にアップデートされる。
The association (that is, binding) between the data values 238 and 242 and the
この自動的にアップデート機能を実現するために、本発明では、さらに、通知メカニズム(notification mechanism)を用意している(例えば、図2において、ノーティファイヤ(notifier)236および240とノーティファイヤからプラットフォーム220までの矢印で表されている)。各データ項目232および234にはそれぞれ、対応するノーティファイヤ236および240がある。通知メカニズムは、ソースデータバリューが変更されたこと、およびデータバリューはターゲットプロパティ(つまり、UIプロパティ)に伝搬されることが可能であることをシステムに通知する役割を持つ。
In order to realize this automatic update function, the present invention further provides a notification mechanism (for example, in FIG. 2,
マークアップ、コードなどを通じてバインディング226および228が作成されると、バインディングエンジン224はバインディングに関連付けられているバインディングオブジェクト(例えば、バインディングオブジェクト250および252)を作成する。例えば、バインディングオブジェクト252は、バインディングエンジン224内のバインディング228を表すことができる。それぞれのバインディングオブジェクトは、複数のプロパティを含む(例えば、バインディングプロパティ260〜272)。これらのバインディングプロパティ260〜272は、プログラムによる設定が可能である。以下の説明では、これらのプロパティのそれぞれについて説明し、図4に、それらプロパティのいくつかを特定(specify)するバインディングをアクティブにするコード例を示す。
When
バインディングプロパティの1つ(one of the binding properties)(これ以降、パス(path)260と呼ぶ)は、(ソースオブジェクトを介して)ソースデータバリューを特定する方法を識別する。パス260は、ソースオブジェクト上のプロパティ、サブプロパティ、またはインデクサ(indexer)、ADO(ActiveX Data Objects)内の列、XML上のXPathなどを参照することができる。それとは別に、パスによりリフレクションまたはADOパスを参照することもできる。
One of the binding properties (hereinafter referred to as path 260) identifies the way to identify the source data value (via the source object). The
バインディングプロパティのもう1つ(これ以降、バインドタイプ(bindtype)262と呼ぶ)により、バインディング226および228の型を定義する。一実施形態では、バインドタイプは、単方向(oneWay)の、双方向(twoWay)の、および一度だけ(oneTime)の、ものを含む。図のように、バインディング226は、双方向バインディング(twoWay binding)を表し、バインディング228は、単方向バインディング(oneWay binding)を表す。これらのバインディングタイプの1つはデフォルトとして設定される。一実施形態では、双方向バインディングが、デフォルトバインディングタイプとして設定されている。
The types of
バインドタイプ262が単方向(oneWay)として指定されている場合、これは、バインディングエンジン224に、関連するソースデータバリューに変更が生じる毎にターゲットプロパティ(例えば、UIプロパティ210)をアップデートするよう通知する。OneWayバインドタイプは、データバリューを、テキスト色、テキスト背景色などの編集不可能なUIプロパティにバインドする場合に使用される。単方向バインドタイプを使用すると、後述するように、双方向バインドタイプのオーバーヘッドを避ける(avoid)ことができる。このようにオーバーヘッドの減少は、レイアウト内容に関するUIプロパティの変更をリッスン(listen)している場合に最も顕著である。これらのUIプロパティに対して、UIプロパティの子のそれぞれの動的プロパティは、UIプロパティ変更に関してリッスンされなければならない。単方向バインドタイプもまた、UIプロパティの変更が単に他の表示の詳細を示すためだけであれば、有用であると思われる。
If the
バインドタイプ262が双方向として指定されている場合、これは、バインディングエンジン224に、ソースデータバリューに変更が生じる毎にターゲットプロパティをアップデートし、またその逆を行うよう通知する。双方向バインディングは、ユーザが編集ボックスで行った変更がソースデータバリューに伝搬される必要がある場合にデータを編集ボックスにバインドするときに特に有用である。双方向バインディングの別のシナリオは、他のアプリケーションがソースデータフィールドを受け持ち、変更が編集ボックスの中に反映される場合である。
If the
バインドタイプ262が一度だけのものとして指定されている場合、これは、バインディングエンジン224に、関連するソースデータバリューが変更された場合でも、ターゲットプロパティを1回アップデートしてからそのまま終了するよう通知する。一度だけのバインドタイプ(oneTime bindtype)は、一部のターゲットプロパティがソースフィールドからの何らかのバリューで初期化される必要があり、データコンテキストがあらかじめ知られていない場合に使用される。さらに、一度だけのバインドタイプは、ソースデータバリューを変更せずに読み取り専用で使用する場合に有用である。データソースが本発明のプロパティ通知メカニズムをサポートしていない場合(例えば、IPropertyChangeインターフェース)、単方向として指定されているターゲットプロパティは、バインディングがバインドタイプとして一度だけを指定している場合と同様にアップデートされる。
If the
バインディングプロパティのもう1つ(これ以降、アップデートタイプ264と呼ぶ)により、バインドタイプ262が双方向を指定する場合に対するアップデートの種類を定義する。通常、双方向バインディングは、ターゲットプロパティの変更をリッスンし、その変更をソースデータバリューに伝搬させて返す。このプロセスは、ソースをアップデートすると言われる。通常、ターゲットプロパティが変更されると必ずアップデートすることが望ましい。しかし、状況によっては、キーを押す毎にアップデートするのでは無駄なサイクルが発生し、ユーザには入力エラーなどを訂正するチャンスがない。アップデートタイプ(updatetype)264では、ユーザはアップデートを実行する時期を特定することができる。一実施形態では、アップデートタイプ264により、Immediate、OnLostFocus、およびExplicitを特定(specify)することができる。Immediateを特定すると、バインディングエンジンは、ターゲットプロパティが変更される毎に、ソースデータバリューをアップデートする。OnLostFocusを特定すると、バインディングエンジンは、ターゲットエレメントがキーボードのフォーカスを失った後、ソースデータバリューをアップデートする。Explicitを特定すると、バインディングエンジンは、アプリケーションがアップデートを明示的に要求した場合のみ、ソースデータバリューをアップデートする。通常、この明示的な要求はメソッドを介して実行される。このメソッドはアップデートタイプ264の設定のため呼び出されることが可能であっても、このメソッドは、アップデートタイプがExplicitに設定されている場合に使用される。方法例を1つ以下に示す。
Binding.GetBinding(myElement, myProperty).Update();
Another type of binding property (hereinafter referred to as update type 264) defines the type of update for the case where the
Binding.GetBinding (myElement, myProperty) .Update ();
バインディングプロパティのもう1つ(これ以降、ソース(source)266と呼ぶ)により、バインディングに対するソースデータ項目を識別する。簡単にいうと、図4に示され、それに関して説明されているように、ソース266は、プログラムにより、またはマークアップを使用して、設定されることが可能である。プログラムに関しては、開発者は、バインディングでソースデータ項目として使用しなければならないオブジェクトへのobjectrefを用意する。簡単にいうと、図4に関して詳細に説明していうように、マークアップでは、ソースプロパティを設定するさまざまな方法がある。
Another of the binding properties (hereinafter referred to as source 266) identifies the source data item for the binding. Briefly, as shown and described in FIG. 4,
バインディングプロパティのもう1つ(これ以降、トランスフォーマ(transformer)268と呼ぶ)は、クラス参照(class reference)を受け入れる。クラス参照は、<Namespace>.<Class>,<Assembly>を使用して特定されることが可能である。特定されているクラス参照は、バインディングエンジン224により呼び出され、ソースデータバリューをターゲットプロパティによって受け入れられる形式にトランスフォームする。クラス参照内のメソッドはこのトランスフォームを呼び出すが、図2にトランスフォーム244として表されている。クラス参照では、さらに、ターゲットプロパティをソースデータバリューにより受け入れられる形式にトランスフォームする逆トランスフォーム(inverse transform)(図に示されていない)も特定することができる。トランスフォーム244は、UIの意味を供給するか、またはカスタムタイプのコンバータとすることができる。
Another of the binding properties (hereinafter referred to as transformer 268) accepts a class reference. The class reference is <Namespace>. It can be specified using <Class>, <Assembly>. The identified class reference is invoked by the binding
バインディングプロパティのもう1つ(これ以降カルチャー270と呼ぶ)は、ソースデータバリューをトランスフォームする前/後にソースデータバリューが処理されるべき方法を定義する。カルチャー270は、トランスフォーマ268とともに動作し、開発者はいソースデータバリューをトランスフォームする規則を特定することができる。例えば、カルチャーでは、数バリュー、日付などに対する特定の形式を特定することができる。一実施形態では、カルチャー270は、CultureInfo型のバリューを受け入れる。開発者は、トランスフォームを実行する際にカルチャー270により特定された規則を使用するオプションを用意する。
Another of the binding properties (hereinafter referred to as culture 270) defines how the source data value should be processed before / after transforming the source data value.
バインディングプロパティのもう1つ(これ以降、バインドフラグ272と呼ぶ)は、イベントを受信し、データの転送を通知するイベントを受信するメカニズムを備える。データバインディングの上述の方法は非同期であるが、バインドフラグ272では、開発者はいつターゲットが新しいバリューでアップデートされているかを知ることができる。このメカニズムを使用するために、バインドフラグ272は「NotifyOnTransfer」に設定される。その後、いつもの方法を使用しイベントに関してハンドラを登録する。このようなメカニズムの一使用例を以下に示す。
Public static void main()
{
//ハンドラを追加する
elem.AddAttachedHandler(Binding.DataTranferEvent,
new DataTranferEventHandler(OnDataTransfer),
RoutedEventArgs.EventStage.Direct);
//イベントハンドラ
private static void OnDataTransfer(Element e, DataTransferEventArgs args)
{
DynamicProperty DP=args.DP;
v=e.GetValue(DP);
DoSomething(v);
}
source.field="new value";
}.
Another of the binding properties (hereinafter referred to as the bind flag 272) has a mechanism for receiving an event and receiving an event notifying the transfer of data. Although the above method of data binding is asynchronous, the
Public static void main ()
{
// add a handler
elem.AddAttachedHandler (Binding.DataTranferEvent,
new DataTranferEventHandler (OnDataTransfer),
RoutedEventArgs.EventStage.Direct);
//Event handler
private static void OnDataTransfer (Element e, DataTransferEventArgs args)
{
DynamicProperty DP = args.DP;
v = e.GetValue (DP);
DoSomething (v);
}
source.field = "new value";
}.
上記のコード例に示されているように、OnDataTransferイベントが発生すると、開発者は動的プロパティがアップデートされていることが通知される。したがって、開発者は、さらに処理を進めるためターゲットバリューを使用することが可能である。 As shown in the code example above, when the OnDataTransfer event occurs, the developer is notified that the dynamic property has been updated. Therefore, the developer can use the target value for further processing.
図3は、本発明の一実施形態によるバインディングメカニズムを例示する論理流れ図である。概して、バインディングメカニズムは、バインディングをセットアップするアクションを実行し(ブロック302〜306)、その後、バインディングで特定されているようにターゲットプロパティまたはソースデータバリューの変更に関係するアクションを実行する(ブロック310〜338)。処理は、ブロック302に続く。
FIG. 3 is a logic flow diagram illustrating a binding mechanism according to one embodiment of the invention. In general, the binding mechanism performs an action to set up the binding (blocks 302-306), and then performs an action related to changing the target property or source data value as specified in the binding (blocks 310-306). 338). Processing continues at
ブロック302において、作成時に特定された引数(argument)に基づいてバインディングオブジェクトが作成される。簡単に言うと、バインディングオブジェクト252に対する各プロパティ(つまり、図2に示されているプロパティ260〜272)は、作成時に引数として特定されることが可能である。バインディングは、マークアップを通じて、プログラムで、および類似の方法で作成されることが可能である。図4は、バインディングを作成し、プロパティ260〜272を特定する構文例を示している。それぞれの作成方法で、ソースデータ項目、ソースデータ項目内のデータバリューへのパス、ターゲットUIエレメント、およびおUIエレメント上のターゲット動的プロパティを特定する。現在の流れ図には示されていないが、バインディングオブジェクトのプロパティも、アプリケーションプログラミングインターフェース(API)を使用するなどして、実行時に動的に修正されることが可能である。処理はステップ306に進む。
In
ブロック304において、バインディングがアクティブにされる。一実施形態では、バインディングは、バインディングエンジンがソースオブジェクトを存在させる、ターゲットエレメントを表示できる状態にするなど、バインディングに十分なコンテキストがあることを通知した後、自動的にアクティブ化されることが可能である。バインディングエンジンは、バインディングのアクティブ化を認識することを受け持つ。処理は、ブロック304に続く。
In
ブロック306において、特定されたソースプロパティのバリューが見つけられる。一実施形態では、バリューを見つけるためにリフレクションが使用される。リフレクションは、要求されたオブジェクトに関する情報を呼び出し側が取得するために使用する一般的なメカニズムである。この情報は、サポートされているオブジェクト、パブリックプロパティなどを含む。他の実施形態では、データ項目がコレクションである場合、バインディングエンジンは、発見的手法を何度も実行して、現在のレコードまたはデータオブジェクト(コレクション)自体を使用しているかどうかを判別する。第1の発見的手法は、バインディングがプロパティまたはインデクサを参照したときに適用される。このような状況では、コレクションオブジェクト上の対応するプロパティまたはインデクサは、そのようなプロパティまたはインデクサが存在する場合に使用される。それとは別に、コレクションの現在のレコードはデータ項目として使用される。プロパティまたはインデクサが存在しない場合、他の発見的手法が適用される。このような状況では、コレクションオブジェクトは、コレクションオブジェクトは有効である限り、ターゲットプロパティに使用される。そうでない場合、現在のレコードが使用される。ブロック308に進む前に、バインディングでトランスフォームを特定している場合(ブロック307)、トランスフォームがバリューに適用される。トランスフォームの適用については、以下のブロック316に関して詳しく説明されている。処理は、ブロック308に続く。
At
ブロック308において、見つかったバリューは、ターゲットプロパティに割り当てられる。一実施形態では、プロパティの階層保持する役割を持つプロパティエンジンがバリューを割り当てることができる。他の実施形態では、ターゲットプロパティにバリューを割り当てる前に、バリューをトランスフォームするためにバインディングの作成時に特定されたトランスフォームを呼び出すことが可能である。他の精密化では、プロパティエンジンはプロパティに新しいバリューを持つというマークをつけることができる。ブロック302〜308が実行された後、バインディングエンジンは、ターゲットプロパティおよびソースデータバリューを必要に応じてアップデートする用意ができている。一般に、バインディングメカニズムは非同期である。
At
したがって、ブロック308から、処理は2つの非同期パスを辿る。第1のパス(ブロック310〜318)は、ターゲットプロパティをアップデートすることに関連付けられており、第2のパス(ブロック330〜338)は、ソースデータバリューをアップデートすることに関連付けられている。これらのパスのそれぞれについて以下で説明する。第1に、ターゲットプロパティをアップデートする役割を持つパスについて示される。
Thus, from
決定ブロック(decision block)310において、バインディングエンジンは、ソースデータバリューおよびターゲットプロパティに関連付けられているバインディングでバインドタイプを一度だけとして特定しているかどうかを判別する。バインドタイプが一度だけの場合、そのバインドに関して処理は完了しており、終了に進む。当業者であれば、バインドタイプが一度だけの場合、バインディングエンジンはソースプロパティの変更イベントをリッスンしないことを理解するであろう。したがって、実際の運用では、バインディングエンジン内のロジックは必ずしも、ブロック310で示されているようにチェックを実行しない。さらに、データ項目がIPropertyChangeを実施しない場合、処理は完了する。しかし、バインドタイプが一度だけでない場合には、処理はブロック312に続く。
In a
ブロック312において、バインディングエンジンはバインディングに関連付けられている通知をリッスンする。データバインディングでソースデータバリューを使用してターゲットを直接アップデートしないため、本発明では通知メカニズムを実施する。プロパティ変更通知およびコレクションビュー「CurrentChanged」通知などの通知メカニズムは、当業では知られており、ここではさらに詳しい説明を要しない。異なるアクションにより、データバリュー変更、ページナビゲーション、シャットダウン、データコレクション内の注目するレコードの変更などの通知が実行される。本発明はデータコレクション内の注目するレコードの変更があるとアップデートをトリガするので、本発明は、ユーザインターフェースおよびロジックをさらに分離する便利なメカニズムを備える。例えば、本発明により、開発者は、データコレクション内の注目する次のレコードにどのように変更を加えるかを特定するコードをロジック内に作成するだけでよい。変更が実行されると、バインディングエンジンは、本発明により、すでに特定されているバインディングに基づき、ユーザインターフェースをアップデートする。すでに述べたように、ユーザインターフェースとロジックとのこのような分離により、ユーザインターフェースおよびロジックが相互に関連していたときに比べてアプリケーションはより堅牢になり、また保守も容易になっている。
At
以下のコードは、通知メカニズムの一実施例である。以下で作成されたコード例はC#で書かれているが、当業者であれは、通知メカニズムを実施するためにさまざまな言語および構文が使用されることが可能であることを理解するであろう。このような実施については、各データ項目で使用できるようにインターフェースが定義される。各データ項目は、動的アップデートを実施するためにこのインターフェースを継承する。
Public interface IPropertyChange
{
event PropertyChangedEventHandler PropertyChanged;
}.
The following code is an example of a notification mechanism. The code examples created below are written in C #, but those skilled in the art will understand that various languages and syntaxes can be used to implement the notification mechanism. Let's go. For such implementations, an interface is defined for use with each data item. Each data item inherits this interface to perform a dynamic update.
Public interface IPropertyChange
{
event PropertyChangedEventHandler PropertyChanged;
}.
次に、イベントハンドラ(event handler)およびその引数(argument)が定義される。
public delegate void PropertyChangedEventHandler(object sender, PropertyChangedEventArgs e);
public class PropertyChangedEventArgs:EventArgs
{
public virtual string PropertyName { get ;}
}.
Next, an event handler and its arguments are defined.
public delegate void PropertyChangedEventHandler (object sender, PropertyChangedEventArgs e);
public class PropertyChangedEventArgs: EventArgs
{
public virtual string PropertyName {get;}
}.
クラスPropertyChangedEventArgsは型文字列を持つPropertyNameという名前の読み取り専用プロパティを1つ含む。PropertyNameプロパティは、変更されたプロパティに対する名前を含む。次に、各ソースデータ項目は、そのプロパティの1つが変更された場合に必ず、PropertyChangedデリゲートを呼び出すことによりこのインターフェースを実施する。以下は、通知メカニズムの実施形態により、ソースオブジェクト(例えば、データ項目232)を実施する例である。
public class myClass : IPropertyChange
{
private string foo = "Hello World";
public string Foo
{
get {return foo;}
set {if(foo ! = value)
{
foo = value;
NotifyPropertyChanged("foo");
}
}
public event PropertyChangedEventHandler Property Changed;
private void NotifyPropertyChanged(string propName)
{
PropertyChanged(this, new
PropertyChangedEventArgs(propName));
}
}.
The class PropertyChangedEventArgs contains one read-only property named PropertyName with a type string. The PropertyName property contains the name for the changed property. Next, each source data item implements this interface by calling the PropertyChanged delegate whenever one of its properties changes. The following is an example of implementing a source object (eg, data item 232) according to an embodiment of a notification mechanism.
public class myClass: IPropertyChange
{
private string foo = "Hello World";
public string Foo
{
get {return foo;}
set (if (foo! = value)
{
foo = value;
NotifyPropertyChanged ("foo");
}
}
public event PropertyChangedEventHandler Property Changed;
private void NotifyPropertyChanged (string propName)
{
PropertyChanged (this, new
PropertyChangedEventArgs (propName));
}
}.
上記のコード例に示されているように、「foo」プロパティの「set」メソッドは、新しいバリューが旧いバリューと異なるかどうかを判別する。バリューが異なる場合、ハンドラが呼び出される。PropertyInfoを取得するためリフレクションが実行される。他の精密化では、バインディングエンジンは、リフレクションを通じて取得されたプロパティの型をキャッシュすることができる。したがって、リフレクションは1回実行され、プロパティについて通知が受信される毎に実行されるわけではない。他の精密化では、引数で空文字列が渡され、データ項目のデータバリューのそれぞれに対するすべてのバインディングをアップデートすべきであることを通知することができる。これは、ソースオブジェクトで、どのプロパティが変更され、各バインディングをアップデートしたいかがはっきりしない場合に実行できる。バインディングエンジンが、データソースバリューが変更されたという通知を受信すると、処理は決定ブロック314に進む。
As shown in the code example above, the “set” method of the “foo” property determines whether the new value is different from the old value. If the values are different, the handler is called. Reflection is performed to get PropertyInfo. In other refinements, the binding engine can cache property types obtained through reflection. Thus, reflection is performed once and not every time a notification is received about a property. In other refinements, an empty string can be passed in as an argument to signal that all bindings for each data value of the data item should be updated. This can be done if the source object is not sure which properties have changed and each binding needs to be updated. When the binding engine receives a notification that the data source value has changed, processing proceeds to
決定ブロック314において、変更されたソースデータバリューに関連付けられているバインディングでバインディングに対するトランスフォームを特定していたかどうかを判別する。バインディングでトランスフォームを特定していない場合には、処理はブロック318に続く。しかし、バインディングでトランスフォームを特定している場合には、処理はブロック316に続く。
At
ブロック316において、バインディングで特定されているトランスフォームが実行される。一実施形態では、トランスフォーマ268は後述のようなオブジェクトである。
Public interface IDataTransformer
{
Public object Transform(object o, DynamicProperty dp, CultureInfo c) {;}
}.
At
Public interface IDataTransformer
{
Public object Transform (object o, DynamicProperty dp, CultureInfo c) {;}
}.
上記のインターフェースでは、oはソースバリューを表し、dpはターゲットの動的プロパティを表し、cはトランスフォーム時(transfomation)に使用するカルチャー(culture)を表す。Transform()メソッドは、ソースバリューoを型dpの動的プロパティに割り当てるのに適しているオブジェクトにトランスフォームする。Transform()メソッドは、バインディングのソースからターゲットプロパティにデータバリューを伝搬させるとき呼び出される。Transform()メソッドがnullバリューを返した場合、バインディングエンジンに対し、バリューの伝搬を停止することが通知される。 In the above interface, o represents the source value, dp represents the dynamic property of the target, and c represents the culture used for transformation. The Transform () method transforms the source value o into an object suitable for assigning to a dynamic property of type dp. The Transform () method is called when the data value is propagated from the binding source to the target property. When the Transform () method returns a null value, the binding engine is notified that value propagation is to be stopped.
トランスフォーマは、さらに、バインディングで特定された関連ソースデータバリューに基づいて幅、高さ、フォント、位置(x、y)などの他のUIプロパティを制御するために使用されることも可能である。トランスフォーマでは、複数の方法でデータを表示するためデータバリューに対しロジックを実行することができる。他の精密化では、カルチャーは、バインディングで特定されているようにトランスフォーム時に適用されることも可能である。処理は、ブロック318に続く。
The transformer can also be used to control other UI properties such as width, height, font, position (x, y) based on the associated source data value specified in the binding. Transformers can perform logic on data values to display data in multiple ways. In other refinements, the culture can also be applied at the time of transformation as specified in the binding. Processing continues at
ブロック318において、ターゲットプロパティがアップデートされる。一実施形態では、プロパティエンジンはバリューをターゲットプロパティに割り当てる。さらに、ターゲットプロパティは新しいバリューを持つとマーク付けされることも可能である。その後処理はブロック312に続き、バインディングに関連付けられている次のプロパティ変更通知をリッスンする。アプリケーションが終了するか、またはバインディングが他の何らかの手段により打ち切られると、処理は終わりに進む。
At
上述のように、処理は、ブロック308から第2のパスへと続くことが可能である。したがって、ブロック308から、処理は決定ブロック330に続く。上述のように、決定ブロック310に関して、バインディングエンジン内のロジックは決定ブロック310でバインドタイプのチェックを必ずしも実行することはできないが、むしろ、バインディングエンジンはバインディングが作成されたときに通知をリッスンするように指示されていたため、プロセスは第2のパス内を流れない。しかし、流れの説明を明確にするために、バインドタイプを反映する決定ブロックが示されている。したがって、決定ブロック330において、バインディングが双方向(twoWay)のバインドタイプとして特定したかどうかの判別が行われる。すでに述べたように、双方向では、ターゲットプロパティの変更をソースデータバリューに伝搬させることができる。バインディングで双方向バインドタイプとして特定していない場合、処理は終わりに進む。しかし、バインディングで双方向バインドタイプとして特定している場合には、処理はブロック332に続く。
As described above, processing can continue from
ブロック332において、バインディングエンジンは、ソースデータバリューのアップデートをトリガするいくつかのアクションを認識する。トリガが発生すると、処理は決定ブロック334に続く。
At
決定ブロック334において、バインディングがバインドに対し逆トランスフォームを特定したかどうかの判別が行われる。バインディングで逆トランスフォームを特定していない場合には、処理はブロック338に続く。しかし、バインディングで逆トランスフォームを特定している場合には、処理はブロック336に続く。
At
ブロック336において、逆トランスフォームがソースプロパティに適用される。一実施形態では、逆トランスフォーマは後述のようなオブジェクトである。
Public interface IDataTransformer
{
Public object InverseTransform(object o, PropertyInfo pinfo, CultureInfo c){;}
}.
At
Public interface IDataTransformer
{
Public object InverseTransform (object o, PropertyInfo pinfo, CultureInfo c) {;}
}.
上記のインターフェースでは、oはソースバリューを表し、cはトランスフォーム時に使用するカルチャーを表し、pinfoはターゲットプロパティのPropertyInfoを表す。InverseTransform()メソッドは、ソースバリューoを型infoのプロパティに割り当てるのに適しているオブジェクトにトランスフォームする。このメソッドは、バインディングのターゲットからソースにバリューを伝搬させるとき呼び出される。InverseTransform()メソッドがnullバリューを返した場合、バインディングエンジンはバリューを伝搬しない。InverseTransformが実行されると、処理は決定ブロック338に続く。
In the above interface, o represents the source value, c represents the culture to be used at the time of transformation, and pinfo represents the target property PropertyInfo. The InverseTransform () method transforms the source value o into an object suitable for assigning to a property of type info. This method is called when propagating value from the binding target to the source. If the InverseTransform () method returns a null value, the binding engine does not propagate the value. Once InverseTransform is executed, processing continues to
ブロック338において、アップデートタイプに応じてソースプロパティがアップデートされる。上述のように、アップデートタイプは、即時、フォーカスの喪失、明示的、およびその他をきっかけとしてよい。ソースプロパティがアップデートされた後、処理は終了へ進む。
At
図4は、バインディングを作成するいくつかの例を示している。作成手段(creation means)400〜410では、マークアップを通じてバインディングを作成する。作成手段410では、コードを通じてバインディングを作成する。図4に示されている手段例は網羅的ではない。他の手段(構文)は、本発明の範囲から逸脱することなく、使用されることが可能である。
FIG. 4 shows some examples of creating bindings. In creation means 400-410, the binding is created through markup. The
作成手段400は、エレメント424に対しDataContext名/バリューのペア(これ以降、DataContext 422と呼ぶ)およびId名/バリューのペア(これ以降、Id 420と呼ぶ)を含む。作成手段400はさらに、DataContext 422も含むため、Id 420は不要である。Id 420は、マークアップでElementSourceを使用したり、コード内でIdObjectRegを使用したりするなど、明示的なソースを参照するのが望ましい場合に必要である。これらの両方の用途について後で説明される。DataContext 422は、エレメント(例えば、エレメント424)で定義されている動的プロパティである。DataContext 422に関連付けられているバリューは、デフォルトのソースデータ項目を表し、継承可能なプロパティである。バインディングエンジンは、DataContext 422にクエリを実行し、エレメント424および子孫エレメント(例えば、Buttonエレメント426)のバインディングを作成するときにDataContext 422を使用する。バインディングエンジンは、さらに、DataContext 422の変更についてもリッスンするし、そのトリガによりアップデートを実行する。したがって、必要はないけれども、DataContext 422は共通データ項目にバインドされるすべてのプロパティについてスコープを確立する便利なメカニズムを備える。子孫エレメントは、自DataContextを持つことができ、これは親エレメントのDataContext 422に優先する。バインディングは、作成手段402に関して後述するnullでないソースを供給することにより、DataContext 422をオーバーライドすることができる。
The creation means 400 includes a DataContext name / value pair (hereinafter referred to as a DataContext 422) and an Id name / value pair (hereinafter referred to as an Id 420) for the
Buttonエレメント426は、ターゲットプロパティで例示されている(例えば、 Button.Text 428)。本発明では、バインディングエンジンは、「Data:Bind」を見つけると、バインディングが特定されていることを認識する。後の名前/バリューのペアは、図2で特定されているように、バインディングプロパティ260〜272を設定する。当業者であれば、バインディングを示す「Data:Bind」という用語は任意の用語であり、本発明を逸脱することなく用語はいくつ使用されていてもかまわない。作成手段400は、詳細マークアップ形式を表す。
作成手段402は、コンパクトマークアップ形式を表す。UIプロパティ(例えば、Button Text)は、さらにコンパクトな方式で表される。ここでもまた、「Data:Bind」は、バインディングエンジンに対し後に続くのがバインディングであることを知らせるシグナルとして使用される。さらに、名前/バリューのペアと後に続く「Data:Bind」は、図2でバインディングオブジェクト250についてすでに説明している所望のプロパティ260〜272に対応する。例えば、ElementSource名/バリューのペア(これ以降ElementSource 434と呼ぶ)はソース266に対応している。
The
マークアップでは、ソースプロパティを設定する方法は、ElementSourceおよびDataSourceの2つがある。これらのいずれも使用されない場合、ソースのデフォルトバリューはnullであり、作成後、エレメントのDataContextプロパティのバリューを取得し、そのバリューをソースオブジェクトとして使用するようバインディングエンジンに通知する。 In markup, there are two methods for setting a source property: ElementSource and DataSource. If none of these are used, the default value of the source is null, and after creation, the value of the DataContext property of the element is obtained and the binding engine is notified to use that value as the source object.
作成手段(例えば、作成手段402)でElementSourceを特定した場合、バインディングエンジンは、ElementSourceプロパティにより特定されているIDを持つエレメントを見つける。その後、エレメントのDataContextisは、ソースオブジェクトとして使用される。/Parent/Parentおよび/Previous/Previousなどの相対パス名は、データソースを特定するために使用されることが可能である。バインディングエンジンは、/Parentを見つけると、オブジェクト階層に関して現在のエレメントの親であるエレメントを探す。例えば、エレメントが顧客注文である場合、/Parentを特定すると、現在の注文に対する顧客に対応するエレメントを探すようにバインディングエンジンに通知することができる。/Parentを特定するのは、内側リピータのスコープ内にある外側リピータからのバリューを使用するのが望ましいネストされているリピータの場合に役立つ。/Previousを特定すると、バインディングエンジンはRepeaterの下にある現在のエレメントの前のエレメントを探す。/Previousを特定するのは、棒グラフなど、現在の項目の他に現在のn項目にアクセスするのが望ましい場合に便利である。連続する/Previousと/Parentは、本発明に従って使用されることが可能である。 When the ElementSource is specified by the creation means (for example, the creation means 402), the binding engine finds an element having the ID specified by the ElementSource property. The element DataContext is then used as the source object. Relative pathnames such as / Parent / Parent and / Previous / Previous can be used to identify the data source. When the binding engine finds / Parent, it looks for the element that is the parent of the current element with respect to the object hierarchy. For example, if the element is a customer order, specifying / Parent can inform the binding engine to look for the element corresponding to the customer for the current order. Specifying / Parent is useful for nested repeaters where it is desirable to use the value from the outer repeater that is within the scope of the inner repeater. When / Previous is specified, the binding engine looks for the element before the current element under Repeater. Specifying / Previous is useful when it is desirable to access the current n items in addition to the current item, such as a bar graph. The sequence / Previous and / Parent can be used according to the present invention.
他の実施形態では、マークアップでDataSourceを特定することができる。DataSourceが特定された場合、バインディングエンジンはResourceのリソースIDを受け入れる。Resourceがデータプロパティを公開する場合、バインディングエンジンは、バインディングのソースを、DataSourceリソースのデータプロパティによって返されるオブジェクトに設定する。そうでない場合、バインディングエンジンはバインディングのソースをリソースオブジェクト自体に設定する。 In other embodiments, the DataSource can be identified in the markup. If the DataSource is specified, the binding engine accepts the Resource ID of the Resource. When the Resource exposes a data property, the binding engine sets the source of the binding to the object returned by the data property of the DataSource resource. Otherwise, the binding engine sets the binding source to the resource object itself.
当業者であれば、マークアップ言語を使用してプロパティ260〜272が表現され、したがって、これは他のプロパティのそれぞれがマークアップ言語を使用して表現されることが可能であることを理解するであろうし、ここで詳細には説明しない。 One skilled in the art will appreciate that the properties 260-272 are expressed using a markup language, and thus this allows each of the other properties to be expressed using a markup language. It will not be described in detail here.
次の3つの作成手段404〜410は、本発明でバインドすることができる項目の種類に関して例を与える。作成手段404は、サブプロパティおよびインデクサへのバインディングのサポートを示している。作成手段404は、di.a.b[3].cのようにC#で書かれているバインディングに対応しており、diは関連するデータ項目である。データ項目、di.aを実施するクラス、di.a.bを実施するクラス、およびdi.a.b[3].cを実施するクラスが本発明の通知メカニズム(例えば、IPropertyChange)をサポートし、プロパティが変更されたときに通知する限り、作成手段404を使用して特定されたバインディングにより、バインディングエンジンは自動的にバインドされているプロパティ(例えば、ターゲットプロパティ)をアップデートし、ソースデータバリューの変更を反映する。 The next three creation means 404-410 give examples regarding the types of items that can be bound in the present invention. The creation means 404 shows support for binding to sub-properties and indexers. The creation means 404 is di. a. b [3]. It corresponds to the binding written in C # like c, and di is a related data item. Data item, di. a class that implements a. a. a class that implements b, and di. a. b [3]. As long as the class that implements c supports the notification mechanism of the present invention (eg, IPropertyChange) and notifies when a property has changed, the binding specified using the creation means 404 will cause the binding engine to automatically Update bound properties (eg, target properties) to reflect changes in the source data value.
作成手段406は、データコレクションへのバインディングのサポートを示している。バインディングエンジンは、自動的に、各レベルでコレクションの現在のレコードを使用する(a、b、およびcは異なるレベルを表す)。例えば、di.aがIDataCollection型であれば、バインディングでは、「b」プロパティをフェッチするためにコレクションの現在のレコードを使用する。したがって、バインディングエンジンは、現在のレコードが変更された場合に必ず、データコレクションに関連付けられているバリューを自動的にアップデートする。 Creation means 406 shows support for binding to a data collection. The binding engine automatically uses the current record of the collection at each level (a, b, and c represent different levels). For example, di. If a is an IDataCollection type, the binding uses the current record of the collection to fetch the “b” property. Thus, the binding engine automatically updates the value associated with the data collection whenever the current record changes.
作成手段408は、XMLノードへのバインディングのサポートを示している。バリューへのパス260は、図4に示されているように、「/Customer/Order[@OrderID=10]/Amount)」などのxpath表現を使用して与えられる。作成手段410は、ADOデータテーブルへのバインディングのサポートを示している。この実施に関しては、バリューへのパス260は、図4に示されているように、「OrderlD」などの特定の行に対するフィールド名として与えられる。
The creation means 408 indicates support for binding to an XML node. The
作成手段410では、プログラムによりバインディングを作成する。開発者は、バインディングでソースデータ項目として使用しなければならないオブジェクトへのobjectrefを用意する。作成手段412に示されているプログラムのステートメントは、作成手段410により例示されているのと同じ動作でバインディングを作成する。SetBindingメソッドは、プログラマが上述のバインディングプロパティを特定する際に使用できるより精巧な変更形態を多数備える。上の単純な例では、ボタンのDataContextをソースオブジェクトとして使用する。以下のプログラムのステートメントは、特定のオブジェクト(実行時に知られる)をソースとして使用する単方向バインディングを作成する。
Object source = ... 何らかの任意のオブジェクト ...;
Binding.SetBinding(myButton, Element.BackgroundProperty, "Color", BindType.OneWay, new ExplicitObjectRef(source));
The
Object source = ... any arbitrary object ...;
Binding.SetBinding (myButton, Element.BackgroundProperty, "Color", BindType.OneWay, new ExplicitObjectRef (source));
以下のコード例は、本発明のバインディングメカニズムを介してデータによりユーザインターフェースプロパティを制御するための一実施を示している。この例では、データバリュー(例えば、myInteger)およびUIプロパティ(例えば、TextContent)は、バインディングとしてアクティブ化にされる。さらに、トランスフォーム(例えば、MyTranformer)は、このバインディングに対して特定される。
<Test TextContent="*Data:Bind(Path=myInteger)"
Foreground="*Data:Bind(Path=MyInteger;
Transformer=MyTransformer)"/>
public class MyTransformer:IDataTransformer
{
public object Transform(object o, DynamicProperty dp, CultureInfo culture)
{
if ((int)o <0) return Red;
else return Black;
}
public object InverseTransform(object o, PropertyInfo info, CultureInfo culture)
{
return null;
}
}.
The following code example illustrates one implementation for controlling user interface properties with data via the binding mechanism of the present invention. In this example, the data value (eg, myInteger) and UI property (eg, TextContent) are activated as bindings. In addition, a transform (eg, MyTransformer) is specified for this binding.
<Test TextContent = "* Data: Bind (Path = myInteger)"
Foreground = "* Data: Bind (Path = MyInteger;
Transformer = MyTransformer) "/>
public class MyTransformer: IDataTransformer
{
public object Transform (object o, DynamicProperty dp, CultureInfo culture)
{
if ((int) o <0) return Red;
else return Black;
}
public object InverseTransform (object o, PropertyInfo info, CultureInfo culture)
{
return null;
}
}.
したがって、説明したように、本発明は、ユーザインターフェースおよびロジックのコーディングの変更が分離されるようにソースデータバリューをターゲットプロパティに関連付けるメカニズムを備える。したがって、本発明により、開発者はアプリケーションの基本ロジックを修正することなく、ユーザインターフェースを容易に修正し、機能強化することができる。 Thus, as described, the present invention provides a mechanism for associating source data values with target properties such that user interface and logic coding changes are isolated. Thus, the present invention allows a developer to easily modify and enhance the user interface without modifying the basic logic of the application.
上記の明細、実施例、およびデータにより、本発明の構成の製造および使用に関する説明が完全になされている。本発明の多くの実施形態は、本発明の精神と範囲を逸脱することなく実施できるため、本発明は付属の請求項によって定められる。 The above specification, examples and data provide a complete description of the manufacture and use of the composition of the invention. Since many embodiments of the invention can be made without departing from the spirit and scope of the invention, the invention is defined by the appended claims.
Claims (16)
前記ユーザインターフェース部分のユーザインターフェースプロパティを前記記憶手段に記憶されたソースデータバリューと関係付けるバインディングのバインディングオブジェクトであって、前記ソースデータバリューを特定するための方法を含むパスと、バインディングのタイプを定義するバインディングタイプと、前記ユーザインターフェースプロパティに対するアップデートが発生した時期を特定するアップデートタイプと、前記ソースデータバリューをトランスフォームするための規則を特定するためのカルチャープロパティとを含むバインディングプロパティを有するバインディングオブジェクトを作成するステップと、
前記ソースデータバリューが変更された通知を受けたとき、当該ソースデータバリューに係る前記バインディングオブジェクトに基づいて前記ユーザインターフェースプロパティに前記変更を反映させ、ユーザインタフェースをアップデートするステップと、を実行させ、
前記バインディングタイプは、前記ソースデータバリューを編集不可能な前記ユーザインターフェースプロパティに前記バインディングにより関係付ける場合に使用される「単方向」、又は前記ソースデータバリューを編集可能な前記ユーザインターフェースプロパティに前記バインディングにより関係付ける場合に使用される「双方向」を含み、
前記受ける通知は、前記変更されたソースデータバリューに係る前記バインディングオブジェクトの前記バインディングタイプに基づいていること
を特徴とするコンピュータ可読記録媒体。 A computer-readable recording medium storing a computer-executable program comprising a user interface portion having user interface elements each including one or more user interface properties and a logic portion configured to manipulate source data values. The program is a binding object for binding that associates the user interface property of the user interface part with the source data value stored in the storage means, and specifies the source data value. Updates to the user interface properties, the path that contains the method, the binding type that defines the type of binding, and Creating a binding object having a binding property including an update type that identifies when it occurred and a culture property for identifying rules for transforming the source data value;
When said source data value is notified that have changed, on the basis of the binding object according to the source data value to reflect the changes to the user interface property, it is executed and step you update the user interface, and
The binding type is “unidirectional” used when the source data value is related to the user interface property that cannot be edited by the binding, or the binding to the user interface property that can edit the source data value. Including "bidirectional" used when relating by
The received notification is based on the binding type of the binding object related to the changed source data value.
前記ユーザインターフェースプロパティが変更されたときに、前記ユーザインターフェースプロパティに関連付けられた前記ソースデータバリューを更新するステップを実行させること
を特徴とする請求項1又は請求項2に記載のコンピュータ可読記録媒体。 3. The program according to claim 1, wherein the program causes the computer to execute a step of updating the source data value associated with the user interface property when the user interface property is changed. The computer-readable recording medium as described.
ソースデータバリューを操作するように構成されたロジック部分と、
記憶手段と、
前記ユーザインターフェース部分のユーザインターフェースプロパティを前記記憶手段に記憶されたソースデータバリューと関係付けるバインディングのバインディングオブジェクトであって、前記ソースデータバリューを特定するための方法を含むパスと、バインディングのタイプを定義するバインディングタイプと、前記ユーザインターフェースプロパティに対するアップデートが発生した時期を特定するアップデートタイプと、前記ソースデータバリューをトランスフォームするための規則を特定するためのカルチャープロパティとを含むバインディングプロパティを有するバインディングオブジェクトを作成する手段と、
前記ソースデータバリューが変更された通知を受けたとき、当該ソースデータバリューに係る前記バインディングオブジェクトに基づいて前記ユーザインターフェースプロパティに前記変更を反映させ、ユーザインタフェースをアップデートする手段とを備え、
前記バインディングタイプは、前記ソースデータバリューを編集不可能な前記ユーザインターフェースプロパティに前記バインディングにより関係付ける場合に使用される「単方向」、又は前記ソースデータバリューを編集可能な前記ユーザインターフェースプロパティに前記バインディングにより関係付ける場合に使用される「双方向」を含み、
前記受ける通知は、前記変更されたソースデータバリューに係る前記バインディングオブジェクトの前記バインディングタイプに基づいていること
を特徴とするコンピュータシステム。 A user interface portion having user interface elements each including one or more user interface properties;
A logic part configured to manipulate the source data value;
Storage means;
A binding object of a binding that associates a user interface property of the user interface part with a source data value stored in the storage means, including a path including a method for identifying the source data value, and a type of binding A binding object having a binding property including a binding type, an update type specifying when an update to the user interface property occurs, and a culture property for specifying a rule for transforming the source data value Means to create,
When receiving the notification that the source data value is changed, on the basis of the binding object according to the source data value to reflect the changes to the user interface property, and means you update the user interface,
The binding type is “unidirectional” used when the source data value is related to the user interface property that cannot be edited by the binding, or the binding to the user interface property that can edit the source data value. Including "bidirectional" used when relating by
The received notification is based on the binding type of the binding object related to the changed source data value.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2009032012A JP5010625B2 (en) | 2003-05-17 | 2009-02-13 | Recording medium and system storing program for controlling user interface property by data |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| PCT/US2003/015708 WO2004107200A1 (en) | 2003-05-17 | 2003-05-17 | System and method for controlling user interface properties with data |
| JP2009032012A JP5010625B2 (en) | 2003-05-17 | 2009-02-13 | Recording medium and system storing program for controlling user interface property by data |
Related Parent Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2005500405A Division JP2006526192A (en) | 2003-05-17 | 2003-05-17 | System and method for controlling user interface properties with data |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2009151810A JP2009151810A (en) | 2009-07-09 |
| JP5010625B2 true JP5010625B2 (en) | 2012-08-29 |
Family
ID=56291106
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2009032012A Expired - Fee Related JP5010625B2 (en) | 2003-05-17 | 2009-02-13 | Recording medium and system storing program for controlling user interface property by data |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP5010625B2 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US12394191B2 (en) * | 2021-07-14 | 2025-08-19 | Google Llc | Neural networks based multimodal transformer for multi-task user interface modeling |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JPH11191062A (en) * | 1997-12-26 | 1999-07-13 | Hitachi Ltd | Application screen development support system |
| WO2000057271A1 (en) * | 1999-03-24 | 2000-09-28 | Fujitsu Limited | Apparatus for assisting in writing graphical user interface program, and write-assisting method, and recording medium on which write-assisting program is recorded |
| JP3506087B2 (en) * | 2000-01-25 | 2004-03-15 | 日本電気株式会社 | Style and data structure simultaneous creation device |
-
2009
- 2009-02-13 JP JP2009032012A patent/JP5010625B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2009151810A (en) | 2009-07-09 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US7519969B2 (en) | System and method for controlling user interface properties with data | |
| KR101331260B1 (en) | Metadata driven user interface | |
| US8799857B2 (en) | XML application framework | |
| US8793649B2 (en) | XML application framework | |
| JP5882829B2 (en) | Programmability for binding data | |
| US9483257B2 (en) | Universal and adaptive software development platform for data-driven applications | |
| US7577938B2 (en) | Data association | |
| US20050188350A1 (en) | Data binding | |
| US20090077091A1 (en) | System for development and hosting of network applications | |
| AU2004208330A2 (en) | XML types in Java | |
| JP2006526192A (en) | System and method for controlling user interface properties with data | |
| US7506341B2 (en) | System and method for controlling user interface properties with data | |
| US7212212B2 (en) | Context attribute determination | |
| JP5010625B2 (en) | Recording medium and system storing program for controlling user interface property by data | |
| WO2025145849A1 (en) | Application program processing method and apparatus, computer device and storage medium | |
| RU2358307C2 (en) | System and method of controlling user interface properties using data | |
| KR20060059335A (en) | System and method for controlling user interface attributes in accordance with data | |
| ZA200405128B (en) | System and method for controlling use interface properties with data. | |
| Hashimi et al. | Using Resources, Content Providers, and Intents | |
| Pulakhandam et al. | ODP. NET Developers Guide: Oracle Database 10g Development with Visual Studio 2005 and the Oracle Data Provider for. NET | |
| Horspool et al. | The Scripting Language |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20120207 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20120502 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20120525 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20120601 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 5010625 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150608 Year of fee payment: 3 |
|
| S111 | Request for change of ownership or part of ownership |
Free format text: JAPANESE INTERMEDIATE CODE: R313113 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| LAPS | Cancellation because of no payment of annual fees |