Puffin: A Tojaso FowlPlay Project

1. User Interface Model

Puffin lets you create new kinds of user interface elements that can combine properties of unit frames, action buttons, aura/cooldown timers, and information displays. Each element can be customized with special effects and interactivity options. Elements can be controlled (e.g., arranged, hidden, disabled, faded) based on current game conditions (within limits allowed by Blizzard). Elements can be attached to anchor points and to each other. You can mimic traditional unit frames, action bars, etc. or create entirely new combinations.

A Puffin-based UI has the following advantages over a traditional collection of addons:

	- Integration: one addon for unit frames, action bars, alerts, etc. 
	- Customization: use pre-defined templates or customize each display element
	- Simplified configuration: one options panel to define how your UI looks and acts, one profile to manage
	- Interactivity: add buttons or click-casting to any display element
	- Efficiency: no duplication of game information or event handling across multiple addons
	- Extensibility: new features can be added by anyone using a well-documented API

2. Architecture

Puffin is built on a modular framework that includes three primary component types: model, view, and controller.

Model components represent the current game state. They provide callbacks to alert other components when changes occur and datafeeds which other components can use to inquire about the state they represent. Model components support both basic game state information (e.g., a player's current health points) and derived state information (e.g., Raven-like conditions, PowerAura activation settings).

View components implement display elements and capture user input. They support basic elements such as icons, bars, borders, indicators and text as well as composite elements that are assembled from basic elements. View components also provide animations and sounds. Other components can register for user inputs and receive callbacks when they are detected.

Controller components respond to changes (through callbacks) in game state, configuration settings, and user inputs. They implement unit frames, buff bars, etc. by calling view components to create and maintain display elements that match the current game state represented by model components, while referencing configuration data and current UI state in database components.

The Puffin framework manages these components and provides basic data management. When the player logs in, Puffin imports saved configuration information from a profile file, initializes components, and registers for game-generated events. During play, the framework detects events (buffering and throttling them for performance optimization), calls components that need updating, and provides memory management (including recycling tables to minimize garbage collection). When the player logs out, Puffin exports configuration changes to the profile file.
