Ferreteria/v0.5/global depot

From Woozle Writes Code
Jump to navigation Jump to search

About

  • 2022-02-28 I think I've actually pretty much phased this out in favor of class-specific registries, although Stockers remain a thing. The following documentation needs updating, and the page should be named something like "runtime registries".

The global depot subsystem manages singleton objects and values for global reference by Ferreteria applications. These are only kept available for the duration of the session, and not retained in between sessions.

  • the Depot is a static class which allows access to the most basic and general functions of the subsystem. This may end up being just the Root() function, which gives access to the root Section.
  • Section classes provide more detailed (but not app-specific) functionality which can be applied to elements of any other Section.
  • Stocker classes provide app-specific functions (maybe this will end up being merged with Section classes)

Purpose

Apps and subsystems need to be able to:

  • record and access information about the user's session, such as the account ID and current login state
    • 2022-02-20 I currently have it set up this way, but I think I'm going to change that. Where a class has a "current ID" or "current record", that should be accessible via a class function (static? dynamic?) rather than wodging it into the Depot. The Depot should only be used where there's no more specific class to go to for the information.
  • provide access to singleton objects, whose class may be malleable, by reference to a slug instead of a class name
    • typically: many application classes have a logic-only variant and a user-interactive descendant