Ferreteria/v0.6/sys/Registry
< Ferreteria | v0.6
Jump to navigation
Jump to search
|
Registries different types and how they work
|
There are two primary types of "registriy", class and object. Both of these are basically just arrays in which stored items follow a specific rule-set.
Class Registry
- Purpose: You have a set of classes (clade-family) for handling a situation, but the exact class to be used depends on circumstances (and may be extended by applications) -- so you need a list of alias-strings (class-slugs) where each corresponds to a particular context. Given a class-slug, the Registry looks up the corresponding class to use.
To be determined: do we use the multi-layer approach with these (if we use them at all), or is each class-registry just a separate object/instance?
structure
Class registries are relatively simple: each entry has a string-value which is the name of an existing PHP class.
use-cases
As of 2025-10-15: I'm not sure if this concept is currently in use. There's a variant, Classes, where the context is invoked through a function. I'm not sure if this is in use either, though that at least is easier to check (#TODO).
Clades:
Object Registry
#TODO
Clades: