Skip to content

High Level View of ATF

Gary edited this page Mar 10, 2015 · 10 revisions

ATF is a software framework for developing applications that are especially useful to game developers.

The key frameworks to understand in ATF are Managed Extensibility Framework (MEF), Document Object Model (DOM), adaptation, and contexts. These frameworks are described briefly here, and you can also get an overview of these areas at Core ATF Frameworks.

Many ATF classes are constructed as Microsoft MEF components, and this allows incorporating them into an application very easily—you can add a component to your application with one line of code! MEF is actually a Microsoft framework, but is heavily used by ATF. MEF components offer capabilities common to many applications, such as adding a File menu with its standard commands, providing standard file dialogs, or adding a palette of objects to a UI, so you don't have to develop these pieces yourself. To learn more, see MEF with ATF. For a list of especially useful components, see Important ATF Components.

Applications typically allow for creating and editing data, and the following data-related functionality is usually necessary: keeping multiple views of the data in sync, undo/redo, cut/copy/paste, and persistence in a file. The ATF Document Object Model (DOM) is a simple hierarchical in-memory database with a mechanism for observing changes in the data and provides all these necessary features. The DOM is very similar to an in-memory XML file, and classes are provided to persist application data in XML files, although you can persist your data in other ways. The DOM structure reflects application data structure, and can be defined using schema files. However, the DOM and XML-support are completely independent, and one is not required for the other. For a guide to the DOM, see DOM in a Nutshell. For a description of documents in general, see Documents in ATF.

Adaptation is a technique used in ATF to allow one type of C# object to look like another—without using inheritance. If the DOM is used, adaptation is especially important, because it allows the basic DOM class, DomNode, to look like a more convenient application-specific class throughout your code. This also allows the data representation to be independent of "business logic". In terms of software engineering design patterns, adaptation consists of the Adapter and Decorator pattern. For more information, see Adaptation in ATF.

Applications often support viewing and editing multiple documents at once, each with their own selections and their own undo/redo history. ATF calls these independent groups of data contexts. In most applications, a context is associated with a single document that is loaded into memory, but documents and contexts are separate. A single document can contain multiple contexts, and a single context might know about data in multiple documents. Editors and various tools and commands typically make use of the currently active context. For more details, see ATF Contexts.

ATF is oriented toward developing the kind of applications game developers can use with the controls and components ATF provides. For instance, it offers a statechart renderer to use in developing an editor that shows states and transitions, as illustrated in the StateChartEditor sample. ATF also offers extensive support for circuit editors. For more on these specialized offerings, see Specialized ATF Topics.

You can develop applications using both Windows Forms (WinForms) and Windows Presentation Foundation (WPF), as shown in the SimpleDOMEditor and SimpleDOMEditorWPF samples. These samples do the same thing, but are implemented in WinForms and WPF respectively. For more information on these and other samples, see ATF Code Samples.

ATF contains a large number of classes and interfaces. For different ways of seeing how ATF is organized, see ATF Structure.

ATF can also be regarded as an extension of the .NET framework, because it is a set of C# .NET components. ATF has followed design guidelines to provide a unified programming model with .NET to enhance developer productivity. For more details on this, see Learn About Framework Development.

Clone this wiki locally