Skip to content
v2.275.0

Dependable Class ​

Trait for IDependable.

Traits are interfaces that are privately implemented by objects. Instead of showing up in the public interface of a class, they need to be queried explicitly. This is used to implement certain framework features that are not intended to be used by Construct consumers, and so should be hidden from accidental use.

Example ​

ts
// Usage
const roots = Dependable.of(construct).dependencyRoots;

// Definition
Dependable.implement(construct, {
      dependencyRoots: [construct],
});

Initializer ​

ts
new Dependable()
python
Dependable()
java
new Dependable()
csharp
new Dependable()
go
NewDependable()

Properties ​

dependencyRootsIConstruct[]dependency_rootstyping.List[IConstruct]dependencyRootsList<IConstruct>DependencyRootsIConstruct[]DependencyRoots*[]IConstruct#
The set of constructs that form the root of this dependable.

All resources under all returned constructs are included in the ordering dependency.

Methods ​

get(instance: IDependable): Dependable // chainable@staticmethod def get(instance: IDependable) -> Dependablepublic static Dependable get(IDependable instance)public static Dependable Get(IDependable instance)func Get(Instance IDependable) Dependablestaticdeprecated#
use `of`
implement(instance: IDependable, trait: Dependable): void@staticmethod def implement(instance: IDependable, trait: Dependable) -> Nonepublic static void implement(IDependable instance, Dependable trait)public static void Implement(IDependable instance, Dependable trait)func Implement(Instance IDependable, Trait Dependable)static#
Turn any object into an IDependable.
of(instance: IDependable): Dependable // chainable@staticmethod def of(instance: IDependable) -> Dependablepublic static Dependable of(IDependable instance)public static Dependable Of(IDependable instance)func Of(Instance IDependable) Dependablestatic#
Return the matching Dependable for the given class instance.