Philosopher thinking

From Programming Paradigms to Metaphysics

How do we model potency in software?

Every time we define a class, construct a type system, design a database schema, or decide how behaviour should attach to data, we make claims about what exists in the universe of our application. We decide what kinds of things there are, what makes one thing different from another, which properties belong to things necessarily, which can change, and what those things are capable of doing.

When we model a domain, we abstract from reality and reconstruct those abstractions within a formal system. Paradigms provide different conceptual structures through which that representation can be organised.

Different paradigms make different aspects of reality natural to express. Some emphasise stable kinds and explicitly defined structures; others emphasise behaviour and changing capabilities; still others separate identity, state, and the operations acting upon them. This article considers three broad approaches.

Static Composition

A statically typed language such as C# encourages us to define explicit types and contracts whose structures and permissible operations can be checked at compile time, even when the composition of individual objects and their available behaviours can change at runtime. More generally, compile-time metaprogramming techniques such as macros and templates can generate or compose additional structure, but that structure is still determined before runtime; some forms of AOP operate similarly through compile-time weaving.

Dynamic Composition

A dynamic object-oriented language such as Ruby allows an object's capabilities to change at runtime, even when those capabilities were not anticipated by its original type.

Data-Oriented Composition

And a data-oriented architecture such as Entity-Component-System (ECS), with architectural affinities to ideas familiar from functional programming, separates identity, state and behaviour almost entirely: entities become thin identities, components describe their current properties and dispositions, and external systems operate upon entities possessing the relevant data.

Each approach captures certain aspects of reality extremely well while making others awkward to express.

And the differences between them become particularly interesting when viewed through concepts developed more than two thousand years before the first computer: substance and accident, essence and property, potency and act, and acquired habit.

A note on asides: This article includes occasional asides exploring technical or philosophical details. They provide additional context or commentary but can be safely skipped.


1. Types, Universals, and the Stability of Essence

An interesting exchange between Antisthenes and Plato is recounted by Simplicius in his Commentary on Aristotle's Categories (208.29-32):

Antisthenes: "I see a horse, but I do not see horseness."

Plato: "Because you have the faculty with which a horse is seen, but you have not yet acquired the faculty by which horseness is contemplated."

As developers, we encounter individual things—a particular horse, a particular person, a particular invoice—but our intellect identifies something common by which those particulars can be understood as instances of a kind.

We understand horseness; we model horses.

In a statically typed object-oriented language, we might write:

public class Human
{
    public string Name { get; set; }
    
    // ...
}

Human describes something universal. John, by contrast, is one concrete instance of it:

var john = new Human();
john.Name = "John";

There is another interesting parallel here with Aristotelian-Thomistic metaphysics. We understand both John and Peter as human because they share the same nature—humanity—yet John is not Peter.

For Aristotle, form is the principle by which a material thing is the kind of thing it is. In Aquinas, designated matter (materia signata) accounts for its individuation—why John is this particular human rather than Peter.

Identity, Equality, and Likeness

Consider John and Peter, two distinct human beings. Both are 1.8 metres tall, have brown hair, and share the same human nature.

In Aristotelian-Thomistic thought, we can distinguish:

Concept Meaning Applied to John and Peter
Numerical identity Being one and the same individual John is not Peter
Equality Agreement in quantity Both are 1.8 metres tall
Likeness Agreement in quality Both have brown hair
Sameness in species Sharing a specific nature Both are human

John and Peter may therefore agree in quantity, resemble one another in quality, and share the same human nature, while remaining numerically distinct individuals.

The analogy with programming is interesting.

A type or class plays something like the role of form within our computational model: Human expresses what our software understands a human to be, while john is a particular instantiation of that definition.

Distinct reference-type instances possess their own object identities, even when they share the same type and property values. This provides an analogue of individuation within the computational model, although not through anything equivalent to designated matter.

Value types introduce a further distinction. Their equality is generally determined by their values rather than by independent object identity. Two values may therefore be interchangeable within the model, even when they occupy distinct storage locations.

This reminds us that numerical identity and equality of value are different concepts. In our computational model, reference identity provides an analogue of the former, although not every representation requires the same notion of individuation.

The analogy is representational rather than metaphysical. In Aristotelian-Thomistic thought, substantial form is an intrinsic principle by which a material substance is what it is; a software type, by contrast, is a formal specification through which we represent and constrain the entities of our model.

Note: Object identity should not be confused with domain identity. Domain entities may possess persistent identifiers that distinguish them independently of their particular in-memory representations.

There is also a terminological distinction worth noting:

  • C# value types and reference types concern the language's type system and runtime semantics
  • DDD value objects and entities concern whether domain concepts are distinguished by identity or characterised by their values

In this post, where the distinction is relevant, we're concerned with the former.

In computational modelling, we can distinguish three questions concerning identity and equality:

Concept Question
Reference identity Which particular object is this?
Value equality Does this value equal another?
Type identity What kind of computational thing is this?

The compiler knows what a Human is within our model. It knows which properties the type defines, which operations are available, and which relationships between types are legitimate.

An Invoice, Currency, PostalAddress, or LegalContract may have important constraints. A type system allows the programmer to express certain propositions about the domain and have the compiler enforce those that can be represented as static constraints.

Other invariants may require encapsulation, runtime validation or additional architectural mechanisms.

The compiler can establish that a program respects the rules encoded in its type system, but it cannot establish that those rules adequately capture the nature of the domain being modelled.

The Practical Significance

These distinctions help us recognise that different kinds of sameness require different modelling decisions.

Consider John and Peter:

Distinction Modelling significance
Sameness in species Both are human. This suggests a common conceptual classification, which we might represent with a Human type.
Numerical distinction John and Peter are different individuals. Our model must be capable of representing them independently, even when their attributes coincide.
Equality in quantity Both are 1.8 metres tall. Their heights can be represented using comparable values.
Likeness in quality Both have brown hair. They may share the same value for a property without becoming the same individual.

These distinctions do not prescribe a particular software design. Rather, they help us identify what our representation must distinguish. A shared type does not imply a shared identity, just as equality of properties does not imply that two objects represent the same individual.

The architect must therefore distinguish between understanding the domain and choosing how to represent it. Types, properties, values and identifiers are computational mechanisms through which we express selected aspects of that understanding.

The Problem of Change

Identity, quantity and quality help us describe what something is and how it presently exists. But our models must often account for something more: what a thing can become, acquire or do.

A difficulty appears when we confuse what something is with everything it might become capable of doing. Our concern here is specifically with dispositions and potencies that give rise to capabilities and operations, rather than mutable properties such as hair colour.

Here we encounter a tension between type and object. The type may describe what belongs to the nature of the thing within our model, but a particular object may acquire dispositions and capabilities that actualise potencies grounded in that nature without being essential to it.

This tension does not arise from static typing itself, but from the choice to encode contingent capabilities within a fixed type structure. As we shall explore later, a statically typed object can also acquire behaviours at runtime through composition, delegation or other mechanisms without changing its underlying type. What remains statically defined is the structure through which those capabilities are represented, attached or invoked, even when their particular composition changes dynamically.

A related case is state transition, which can represent the actualisation of a possibility. In the classic State pattern, the possible behaviours are generally established structurally in advance, while at runtime the object changes which state governs its behaviour:

John
  └── CurrentState → StateA
                   → StateB
                   → StateC

State therefore has an interesting relationship to potency and act, but represents a different concern from the acquisition of new dispositions explored here. A similar observation applies to runtime AOP, where behaviour may be selected or introduced through interception without structurally modifying the object.

A human being can become a programmer, boxer, singer, carpenter, mathematician, chess player, or pianist. Yet none of these things appears to belong to the definition of humanity itself.

If we attempt to express all of these possibilities through a conventional class hierarchy, we encounter trouble.

Should we write:

Mathematician : Human
Boxer         : Human
Singer        : Human

What happens when the same human is both a mathematician and a boxer?

And what happens when someone learns mathematics at thirty years old?

The person's identity has persisted. Something about them has changed, but they have not become a different kind of substance in the same sense that distinguishes a human from a horse.

To understand this difficulty, we must first distinguish the nature of the domain from our formal representation of it, and from the constraints our programming language can enforce.

We can therefore distinguish three levels of reasoning involved in software modelling, each addressing a different question:

Level Fundamental question
Domain ontology What is true of the things being modelled?
Formal representation Which of those truths have we expressed as constraints?
Compiler enforcement Which expressed constraints can be checked statically?

This is where the Aristotelian distinction between potency and act becomes useful.


2. Aristotle, Aquinas, and Acquired Habit

Aristotle's account of change distinguishes between what something presently is and what it has the potency to become or do. A seed is not presently a mature tree, but possesses a potency toward becoming one. A person who has never studied algebra does not presently possess mathematical knowledge, but ordinarily possesses the capacity to acquire it.

Thomas Aquinas develops this Aristotelian framework through distinctions between substance and accident, and through the particularly important notion of habit (habitus).

A substance exists in itself. Accidents exist in a substance and modify it without necessarily changing what kind of thing it fundamentally is. Among these accidental qualities, a habit represents a relatively stable disposition. Aquinas describes habit as a quality or disposition with a certain lastingness and an ordering toward nature or operation. Acquired knowledge provides a particularly useful example.

Kind of habit Scholastic term Meaning
Scientific knowledge Scientia An intellectual habit of demonstrative knowledge, understanding conclusions through their causes or principles.
Art or skill Ars An intellectual habit of right reasoning concerning things to be made (recta ratio factibilium).
Prudence Prudentia Right reasoning concerning things to be done (recta ratio agibilium).
Moral virtue Virtus moralis A stable disposition of the appetitive powers towards good action, such as justice or temperance.

Suppose John studies mathematics.

Before studying algebra, John has the underlying human capacity to learn it. After studying and practising, something real has changed in John. He has acquired knowledge and therefore a new disposition toward operations he previously could not perform. He can now solve equations.

His underlying humanity has not been replaced. Yet his actual dispositions and capabilities have changed.

This distinction creates an interesting problem for software modelling.

If Human contains every possible behaviour, the class becomes an inventory of human potentiality:

class Human
{
    void Walk();
    void Sing();
    void Box();
    void Program();
    void SolveEquation();
    void PlayPiano();
    // ...
}

John can now apparently solve equations simply because he is human.

The software has confused potency with actuality.

Inheritance does not entirely solve the problem either.

Mathematician : Human models mathematician as a kind of human. But being a mathematician is not a different kind of human in the same sense that a taxonomic subtype represents a different kind of thing. It is something a human can become through acquiring knowledge.

Interface composition encounters the same problem. A Human can implement several capability contracts—IProgrammer, IBoxer, IMathematician—but if every possible habit is represented by another interface, we risk interface explosion. More fundamentally, those capabilities remain part of the static definition of the type.

But being a mathematician is acquired. John can become one while remaining a human. Peter may not know mathematics, but he remains equally human.

A type represents what a thing is, but a particular thing can actualise potencies and acquire dispositions without ceasing to be what it is. How should software represent that?

This is precisely the sort of problem that dynamic object systems handle remarkably naturally.


3. Ruby and the Acquisition of Capability

We might represent mathematical capability as a module:

module Algebra
  def apply_equations
    # ...
  end
end

John can initially exist without it:

john = Human.new

Later, he acquires the capability:

john.extend(Algebra)

john.apply_equations

Something significant has happened. John remains a human. His original identity has not been replaced, and we did not need to anticipate Algebra when defining Human.

Yet John can now perform an operation that he previously could not.

Ruby's extend mechanism specifically adds a module's functionality to the receiving object, rather than requiring the module to be included in the object's class.

As a computational analogy, this maps surprisingly well onto the notion of an acquired habit (habitus): an existing subject acquires a relatively stable disposition without undergoing a change in its underlying nature. Ruby's extend mechanism provides an analogous structural change in an object's effective capabilities, without replacing its identity.

There is a distinction between possessing a habit and exercising it.

John may possess mathematical knowledge without presently solving an equation.

The acquired habit disposes him toward an operation, while the actual exercise of that knowledge constitutes a further actualisation, traditionally understood as actus secundus (second act).

This flexibility is one of the attractions of dynamic languages.

Instead of demanding that the programmer determine the entire taxonomic structure of reality before execution, the runtime itself can participate in the composition of objects.

We suddenly encounter a beautiful world of living, breathing objects.

But that freedom has a price.

If John can acquire Algebra, what prevents a BankAccount, HTTPConnection, or Potato from acquiring it?

Dynamic languages can therefore express changing capabilities extremely naturally, but the same mechanism that gives them their flexibility can weaken the structural guarantees available to us. We potentially lose some of our ability to assert domain predicates and have those predicates enforced by the type system, and with it some of the predictability that such constraints provide. The program may permit combinations that make no sense within the ontology of the domain.

We have gained expressive freedom, but surrendered some constraint.

It is worth noting that prototype-based languages such as JavaScript also provide dynamic object models, allowing individual objects to acquire properties and behaviour at runtime:

const john = {
    name: "John"
};

john.solveEquation = function () {
    // ...
};

There is a further practical difficulty with dynamically acquired structure and behaviour: persistence.

When an object acquires new methods, properties or capabilities at runtime, serialising its ordinary state may not be sufficient to reconstruct it later. Rehydration may also require the system to restore its dynamically acquired structure, the implementations associated with its capabilities, and the relationships that give those capabilities meaning.

This introduces questions of persistence integrity, versioning and identity.

A rehydrated object should not merely contain the same data; it should recover the capabilities, dependencies and relationships, with their relevant state preserved consistently.

In effect, the relevant object graph must be persisted and reconstituted as a coherent whole.

And this brings us naturally back to runtime composition.


4. A Third Model: Separating Identity, Disposition, and Action

Modern game development faced an unusually difficult modelling problem. A game world can contain thousands or millions of things whose capabilities overlap in unpredictable ways.

  • A wooden door can burn.
  • A tree can burn.
  • A shield can burn.
  • Perhaps a character's clothes can burn.

Yet these things should not automatically be placed in an inheritance hierarchy merely because they share the disposition of flammability.

At the same time, games care intensely about performance. The unconstrained runtime flexibility of a highly dynamic object model is often undesirable when enormous numbers of entities must be processed every frame.

One influential response is the Entity-Component-System, or ECS, architecture. ECS has a strong connection to data-oriented design, which offers significant performance opportunities on modern CPUs.

Predictable memory access patterns and sequential processing of densely packed data can improve computational efficiency. Many ECS implementations exploit this by storing components in contiguous arrays or archetype-based chunks, allowing systems to process large numbers of entities without repeatedly traversing scattered object graphs. This can offer substantial advantages through improved cache locality, fewer cache misses, reduced pointer chasing, and opportunities for SIMD vectorisation.

This is a case where non-functional requirements can determine the architecture.

An architecture can be conceptually elegant yet operationally unsuitable.

Non-functional requirements, therefore, can be particularly expensive to discover late:

  • Scalability: How many users, transactions or entities must the system support?
  • Performance: What latency and throughput are acceptable?
  • Availability and resilience: What happens when a dependency fails?
  • Security and compliance: What constraints must shape the system from the outset?
  • Data integrity: What consistency guarantees are required, especially across distributed operations?

Requirements may evolve incrementally, but architectural constraints must be investigated early enough to inform decisions that are costly to reverse.

ECS separates three things that conventional object-oriented design tends to combine:

ENTITY
    identity

COMPONENTS
    data, properties, state, dispositions

SYSTEMS
    operations over entities possessing relevant components

This produces a radically different model of the software universe.

An entity may be little more than an identifier:

Entity 2048

By itself, that tells us almost nothing about what entity 2048 is.

Instead, the entity participates in the world through its associated components:

Position
Velocity
Health
Flammable

And behaviour is moved outside the entity into systems:

MovementSystem
DamageSystem
CombustionSystem

The result has interesting parallels with Aristotelian and Thomistic ontology.


5. Flammability, Potency, and Efficient Cause

Consider a piece of wood.

The fact that it is not currently burning does not mean that burning is impossible for it. Given the relevant characteristics and circumstances, it possesses a disposition toward combustion.

We might describe it as flammable.

In an ECS design, this could be represented explicitly:

struct Flammable
{
    public float IgnitionTemperature;
}

The component contains no Burn() method.

It represents data describing a disposition.

A completely separate system can then operate upon things possessing the relevant disposition:

CombustionSystem:

    find entities with:
        Flammable

    if Temperature >= IgnitionTemperature:
        initiate combustion

The system does not need to ask whether the entity is a Tree, Chair, House, or Shield.

Those classifications may matter elsewhere, but they are not what matters to combustion.

For this particular operation, what matters is whether the relevant potency or disposition is present and whether the conditions required for its actualisation obtain.

The component represents a disposition possessed by the entity, while the system models the operations and causal conditions under which that disposition may be actualised.

In Aristotelian terms, combustion involves the actualisation of a potency through efficient causality. The CombustionSystem is not itself an efficient cause in the metaphysical sense, but a computational representation of the causal processes through which combustion occurs.

Instead of asking:

"What class of thing is allowed to burn?"

we ask:

"Which things presently possess the characteristics required for combustion?"

A distinction is worth making here between disposition and habit. Broadly understood, a disposition is a quality or characteristic by which a thing is inclined or capable of acting, or being acted upon, in a particular way. Such dispositions may be stable and grounded in the nature or material constitution of a thing, as with rigidity or flammability.

A habit (habitus), in the more specific Aristotelian-Thomistic sense, is a relatively enduring quality that disposes its subject in a particular way, such as acquired knowledge or virtue. In Aquinas's technical classification of qualities, habitus is distinguished from dispositio in the narrower sense by its greater stability and resistance to change. This distinction should not be confused with the broader use of disposition, which includes stable physical qualities such as rigidity and flammability.

An interesting aspect of scholastic philosophy is the identification and classification of the qualities of things.

Consider a chair: it possesses rigidity, which contributes to its ability to support a person. Once rigidity has been defined in our modelling lexicon, we already know the properties associated with that quality. Wherever we identify it in the things we model, we can draw upon that existing definition.

Thing Property or disposition Capability or interaction
Chair Rigidity and structural strength Can support a person under a suitable load.
Wooden log Flammability Can undergo combustion under suitable conditions.
Glass window Transparency Allows visible light to pass through.
Magnet Magnetic properties Can attract suitable ferromagnetic materials.
Sponge Porosity and absorbency Can absorb and retain liquid.
Knife Hardness and edge geometry Can cut suitable materials when force is applied.
Rubber band Elasticity Can deform and return approximately to its original shape.

So much of our work becomes identifying rather than defining.

For example, we might define rigidity in our modelling lexicon as a simplified, reusable description of an object's resistance to deformation under an applied force:

Rigidity Class Diagram

That conceptual definition might then be represented in code like this:

public readonly record struct Rigidity(
    float Stiffness,
    float ElasticLimit,
    float FailureThreshold);

We can then model a particular chair as possessing this quality:

var chair = world.CreateEntity();

world.AddComponent(chair, new Rigidity(
    Stiffness: 1200f,
    ElasticLimit: 0.02f,
    FailureThreshold: 250f
));

Notice that we have not defined a Chair class with a SupportPerson() method, nor have we made rigidity a property exclusive to chairs. Instead, we have identified a reusable quality and associated it with a particular entity. The same representation might be used for a table, beam, or other object possessing that quality.

A system evaluating structural loads could consider the chair's rigidity alongside its geometry and other relevant properties to determine how it responds to an applied force.

Rigidity, by itself, does not determine whether the chair can support a person; that capability depends on the composition and interaction of several properties.

This suggests a different starting point for software modelling.

Rather than asking only, "What methods should this class have?", we might first ask, "What qualities does this thing possess, and what capabilities follow from them?"

A thing will ordinarily possess several qualities, whose combination contributes to its characteristic capabilities. In our models, we can therefore represent a thing through the qualities we identify in it and the relationships between them, drawing upon definitions already established in our modelling lexicon.

These properties and dispositions are not necessarily essences in themselves; they are grounded in the nature, material constitution and organisation of the things concerned. Nor should we confuse possessing a capability with exercising it. A chair can support a suitable load even when nobody is sitting on it, just as a wooden log can be combustible without presently burning.

In summary, we can state the relationship between potency, causality and actualisation as follows:

  1. Potency or disposition: The wood is capable of burning under appropriate conditions.
  2. Efficient causality: A suitable causal interaction brings about combustion.
  3. Actualisation: The wood is now burning.

The following comparison illustrates different ways in which potency, disposition and actuality are related; it does not imply that intellectual habits and physical dispositions develop in the same way.

Mathematical knowledge Combustion
Capacity to learn mathematics Capacity of wood to burn
Acquired mathematical habit (habitus) Disposition of flammability
Exercise of mathematical knowledge (actus secundus) Actual occurrence of combustion

The analogy is useful, provided we do not treat acquired intellectual habits and physical dispositions as identical metaphysical categories.


6. The Functional Influence: Behaviour Outside the Object

ECS also reflects a broader movement away from the classical object-oriented idea that data and behaviour must always reside together. Traditional object-oriented programming often encourages:

object.doSomething()

The object's data and the operations acting upon it are conceptually bundled together.

Many functional programming styles encourage a different perspective. Data can be represented explicitly, while transformations over that data are expressed separately. Conceptually:

newState = operation(oldState)

ECS is not synonymous with functional programming, and many ECS implementations are not purely functional. Nevertheless, the architectural affinity is important:

  • Components tend toward data.
  • Systems tend toward transformations and operations.
  • Entities provide identity and association.

This gives statically typed languages an interesting middle ground.

A Flammable component can itself be completely statically typed. Its structure is known at compile time. A Position component can be equally rigorous.

What changes dynamically is not necessarily the definition of those components, but their composition.

  • Entity 2048 can acquire Flammable.
  • Entity 8923 can lose Movable.
  • Entity 7034 can acquire AlgebraKnowledge.

The building blocks remain statically defined while their assemblage changes during execution.

There is a useful distinction here between representing a disposition and determining an available capability within the model. An AlgebraKnowledge component might record knowledge that an entity has acquired, while its presence may also determine which operations the relevant systems can perform upon that entity. The component is not itself the acquired habit in the metaphysical sense; it is a computational representation through which the model recognises and acts upon that disposition.

We have therefore recovered some of the dynamic compositional power seen in Ruby without necessarily making the individual structural elements themselves dynamic.

But once again, this is not free.


7. The Price of Thin Entities

In conventional object-oriented code, this declaration tells us something substantial:

Human john;

Whatever else may be true about John, the type system tells us that the variable is declared to reference a Human.

A pure ECS architecture may instead give us:

Entity 2048

The identity itself says almost nothing.

To discover what the entity currently represents, we must inspect its components.

The entity has become ontologically thin.

This can be enormously useful in domains dominated by composition, simulation and changing state. But in domains where stable identity and invariant classification matter greatly, it may obscure information that a richer type system would make immediately explicit.

This does not mean that ECS necessarily abandons stable classifications or domain invariants. Such constraints can still be expressed and enforced through components, archetypes, entity creation policies or additional architectural mechanisms. The distinction is that the entity's identity, considered in isolation, does not ordinarily encode those classifications. What the entity represents must instead be established through its composition and the rules governing that composition.

ECS can also introduce its own complexity. Behaviour that was once discoverable on an object may now be distributed across systems. Relationships between components can require explicit invariants. Invalid component combinations remain possible unless the architecture provides mechanisms to prevent them.


8. Three Ways of Representing a Domain

We can now see the three approaches as different ways of representing a domain.

Static modelling

Its great strength is explicit nature and constraint.

Types allow us to state what something is and to assert certain propositions about it.

Its weakness appears when what belongs to a particular object contingently—acquired or changing capabilities—is forced into the static definition of its type.

This approach is well suited to domains where stable identity, explicit invariants, and well-defined business states and behaviours are important. Many enterprise domains fit this model naturally: customers, invoices, orders, accounts, and transactions often benefit from making their structure and permissible operations explicit in the type system.

However, there is more to the story. We don't have to represent the acquired disposition structurally.

A mixed approach can recover flexibility.

A statically typed Human might retain its explicit type and identity while aggregating behaviours via objects, delegates or functions at runtime. This allows particular objects to acquire capabilities without changing their underlying type, although those capabilities must then be discovered or invoked through some additional mechanism, such as interfaces, runtime type tests, or explicit lookup.

// acquire behaviour
john.Behaviours.Add(new Algebra());

// then later
var algebra = john.Behaviours.OfType<IAlgebra>().FirstOrDefault();

algebra?.ApplyEquations();

Another common approach is to use a generic, command-like protocol:

public interface IBehaviour 
{
    void Execute();    
}

Alternatively, in a game-oriented design, the common protocol might instead be:

public interface IBehaviour
{
    void Update(float deltaTime);
}

The owning object can then simply iterate over its attached behaviours:

foreach (var behaviour in john.Behaviours)
{
    behaviour.Update(deltaTime);
}

This avoids explicit capability lookup entirely.

The trade-off is that everything has been collapsed into a common behavioural protocol: the semantic meaning of the individual capability is no longer expressed by the invocation itself.

This is not inevitable, however. Late-bound mechanisms can preserve semantically meaningful invocation while resolving the underlying behaviour at runtime.

In C#, for example, the Dynamic Language Runtime can intercept a named operation and resolve it dynamically; Delphi can provide similar late-bound invocation through IDispatch.

Related variations include object-component and object-node approaches, which retain a richer object identity while composing functionality through attached components or nodes.

Another useful approach to composing additional behaviour is the Decorator pattern, in which an existing object is wrapped with additional capabilities:

Human
  ↓
MathematicsDecorator
  ↓
BoxingDecorator
  ↓
ProgrammingDecorator

These decorators can be composed at runtime, extending the object's behaviour without modifying its type. Although this does not change the underlying object's structure, it demonstrates that a static type system still offers considerable flexibility.

Roles provide another mechanism for dynamically composing behaviour around a stable underlying identity.

Dynamic modelling

Its great strength is runtime acquisition and composition.

Unlike the mixed static approach, this acquisition can be structural rather than merely delegated: the particular object itself can acquire methods and capabilities that were absent from its original type and from other instances of that type.

john.extend(Algebra)
john.apply_equations

Objects can therefore gain behaviours and dispositions without changing their underlying identity or requiring every possibility to have been anticipated in their original definition.

Its weakness is that flexibility can exceed the constraints of the domain. If almost anything can be attached to almost anything, ontologically nonsensical states may remain computationally legal.

This approach suits domains where capabilities are fluid, composition is highly contextual, or objects must evolve in ways that are difficult to anticipate in advance. Extensible applications, scripting environments, metaprogramming-heavy systems, and domains whose rules change dynamically can benefit from allowing behaviour to be composed at runtime.

Of course, dynamic languages can also employ the delegation and composition techniques described in the mixed static approach. So it's not necessarily either/or. We're examining broad categories here.

Individual languages vary; Python supports decorator syntax in class definitions as well as explicit decorator application at runtime. Both mechanisms execute at runtime.

ECS and data-oriented modelling

Its strength is the separation of identity, disposition and operation.

Strongly defined components can be composed dynamically, while external systems act upon entities possessing the data relevant to their operation.

Its weakness is almost the inverse of classical object orientation: the entity itself can become so thin that the software loses an immediately visible account of what the thing actually is.

This approach favours domains where large numbers of entities share overlapping dispositions and capabilities, and where runtime composition is important. Simulations and games are obvious examples, but the same model can be useful wherever systems operate over heterogeneous collections of things according to the properties they presently possess.

Summary

We can summarise the approaches according to where the realised capability is represented:

  • Static composition (Type):
    Human defines the capability as part of its type
  • Mixed static composition (Contained behaviour):
    John contains an Algebra behaviour
  • Dynamic composition (Runtime structure):
    John acquires algebraic methods as part of his runtime structure
  • ECS (Disposition and system):
    John possesses data representing the relevant disposition, upon which an external system can operate

Conclusion: The Software Architect as Applied Ontologist

How do we model potency in software?

The answer lies in considering which paradigm best represents the domain before us, given our constraints:

  • What kinds of things exist within it?
  • What belongs to their nature, and what is contingent?
  • Which invariants must the type system enforce?
  • What can change while a thing remains the same thing?
  • What dispositions can it acquire or lose?
  • Must those capabilities be known at compile time, or can they be composed at runtime?
  • What is merely possible, and what is presently actual?
  • Where should behaviour reside: on the object, in an acquired behaviour, or in an external system?
  • What operations follow from the properties or dispositions it possesses?
  • And which of these distinctions must the software itself preserve and enforce?

This is where Aristotle and Aquinas remain unexpectedly useful to the software architect. Their metaphysics provides a vocabulary for thinking more precisely about being, identity, nature, property, change, potency, habit and action—the very things we repeatedly attempt to represent when constructing software systems.

Programming paradigms give us different tools with which to express those distinctions.

The software architect is, whether consciously or not, an applied ontologist.