Properties

In a system which attempts to model a rich and varied reality, especially one in which many people are collaborating to create the codebase on which it is defined, programmers are often faced with the problem that the functionality they are implementing requires some added behaviour of the objects to which it is to be applied.

If one is to code generically, this presents a dilemma: Does the programmer modify every class of every object to add the desired hooks so that her new code can properly access the objects in the ways it needs to?

Ideally, one would simply modify the most parent class that the functionality could possibly be applied to, but this action is fraught with peril. Altering the base object class every time a new spell is invented, for example, is certainly not desirable. Every modification has a chance of introducing new bugs and misfeatures, and introducing them at the roots of the class library can have disastrous in-game results.

Some measure of safety can be had with a strict adherence to established coding standards, a robust testing suite, and the use of controlled versioning and release schedules, but it would be better if some generic mechanism could be constructed that would allow simple instance-level changes to the behaviour and attributes of particular objects.

The answer, we believe, is the concept we're calling Properties (or Property Objects, to disambiguate them from regular object attributes).

Property Types

These are a few of the property types planned:

  • EventuatingProperties - a property that indicates that an action or state continues or is repeated
  • BooleanProperties? - properties which confer a function or attribute absolutely
  • FuzzyProperties? - objects which confer a degree of a bi-value property to the object to which they're added