Feature schema strive to represent knowledge about a domain as simple relationships between the objects that model the domain. It relies on Domain Object Model (DOM) concept which enables avoiding hard-coding this knowledge into the source code, since usually code can't change at runtime. Even when it does, the people who can perform these changes are a scarce resource. One of the fundamental ideas of this architectural style lies in the ability to configure and manipulate its objects as any kind of data. A domain-specific data, to be more precise.
Most object-oriented systems have a static object model. In other words, the object model does not change at run-time, but is fixed when the program is designed. A system based on a DOM de/serializes an object model to a file and interprets it, while special-purpose modeling tools help reshape it as per developers or end-users will.
It has simple yet powerful structure, applicable to almost any data model out there. Its internal architecture strongly resembles to building blocks of Object-Oriented Programming (OOP) in general, and not without reason - it's intended for developers already fluent in OOP.
Below is a short list of advantages of such pattern over existing ones:
- Explicit model - Feature Schema pattern provides you with a (typically high-level) model that can be consulted at runtime. For instance, when developing a generic store-retrieve relational database application you can generate forms, query screens and SQL statements on the fly using the available meta-information. For this to work, your model must be able to describe things like properties, relationships and totality constraints, and you must be able to describe how object structures and data types are mapped onto the database.
- End-user configuration - Feature Schema pattern lets end-users define the key concepts from their application domain at runtime, without lengthy development cycles in between. Effectively, the Feature Schema pattern provides a (possibly domain-specific) language that users use to describe their domain.
- Introduces runtime typing - Feature Schema pattern introduces full-fledged typing information at runtime. This is particularly helpful in dynamically typed languages like .NET CLI.
- Runtime object type creation - using the Feature Schema pattern, new and complex types of objects can be created at runtime. They describe the structure of their instances: their properties and the constraints on the values their properties can assume.
- Domain-specific typing - Feature Schema pattern introduces typed properties. This feature has a lot of useful applications, for instance when generating forms for data entry and when validating input. The behavior and semantics of these functions are typically domain-specific.
- Controlled dynamic type change - Type Object pattern allows instance objects to dynamically change their type. The Feature Schema pattern extends this behavior by controlling in a generic way the type changing process and when the changes may take place.
- Runtime component type modification - Feature Schema pattern allows for runtime modification of types and hence supports flexibility and fast evolution of applications. However, dynamic type modification requires us to resolve several questions. For instance, do we allow for live update of existing objects?
- Language independent - the "language" described by the Feature Schema pattern is essentially independent from the implementation language. Thus porting of applications described in terms of this domain specific language usually involves less rewriting when porting to another environment.