Data model definition and binding to an UI-based observer

Introduction

Model / Observer design pattern is commonly used to separate the data model from its visual representation. ACF contains standard components and basic implementations for this design pattern.

This tutorial demonstrates how to develop a simple application with following requirements:
  • The application shows values of a simple data object (AB) which has two properties: A is a number and B is a string
  • The initial values of the A and B can be set via component attributes
  • A must be in range [0, 100]
  • The data model object should support persistence
  • The data model component must be observable

The application would look like:
Running AB-Application

The complete sourcecode to this example is located in "<ACF_DIR>/Docs/Tutorial/Impl".

For implementation of the data model component (called simple AB) following steps are required:
  1. Define your Model interface
  2. Implement the data model component
  3. Create and register a component
  4. Use the Component in the Compositor
Now we have to implement the graphical user interface for the AB component. ACF provides a template for those implementation, so we need to do the following steps:
  1. Create the UI-form
  2. Implement the component
  3. Register the component

ABTutorial3.png - Running AB-Application (2.7 kB) Kirill Lepski, 11/13/2011 08:06 pm

Abtutorial3