Record Class Scope

java.lang.Object
java.lang.Record
org.microbean.scope.Scope
Record Components:
id - a non-null Attributes identifying this Scope
normal - whether this Scope is normal
All Implemented Interfaces:
Constable

public record Scope(Attributes id, boolean normal) extends Record implements Constable
A representation of the defining characteristics of a scope, a logical entity that manages the lifecycle of objects.

A Scope is either a normal scope or a pseudo-scope. Implementations of normal scopes permit their objects to have circular dependencies, whereas pseudo-scopes do not. Pragmatically, objects managed by normal scopes are usually instances of a particular kind of proxy, namely a client proxy. Objects managed by pseudo-scopes may or may not be proxied, but are not client proxies.

A Scope is notionally governed by another scope which manages its lifecycle. A Scope that reports that it is governed by itself is known as the primordial scope. All scopes are ultimately governed by the primordial scope.

In any program using Scopes, behavior is undefined if there exist two Scopes with equal identifiers but any other differing attributes. Any collection of Scopes, in other words, must be a set.

Behavior is also undefined if any two scopes declare each other, by any means, as their respective governing scopes.

Author:
Laird Nelson