Concept : Understanding Adapters

Page Status: Beta
Jump to: navigation, search

Back to Concepts and HOW TOs

Contents

[edit] Description

Adapters are Model side implementations of the interfaces provided through adapter interfaces. Because adapter interfaces provide interfaces to objects representing the behavior of Bungee system controls, implementing those interfaces with adapters aids runtime communication between View elements and portions of your Model.

At design time, you either bind a control or add an adapter directly to a class. Either scenario makes the adapter a member of a class. Since the class is contained in a project, the adapter can access any adapter interface you add to the project. This means that at runtime, the object instance of the class to which you added the adapter has the ability to respond to queries for a particular control behavior you identified by assigning an interface to the control by setting a property on the control to point to the interface.

[edit] Model and View Code

When you add an adapter, you can either assign portions of your Model to the fields in the adapter, or you can programmatically update the control using the adapter's Model and View code. Every adapter supplies two intrinsic functions:

The Model code is used to handle changes in the Model and propogate those changes to the View. Likewise, user interaction with the View can be handled by View code and used to update the Model. A good example of Model code being used to trigger updates to the View can be seen in the DynamicForm control's Example 3. You can also find an example of View code in Example 5 of the List control documentation.

[edit] See Also

ControlAdapter
Adding an Adapter
Understanding Interfaces
Adding an Interface

[edit] Tags

    Copyright © 2005 - 2008 Bungee Labs. All rights reserved.