Ferreteria/v0.5/global depot

From Woozle Writes Code
< Ferreteria‎ | v0.5
Revision as of 13:46, 20 February 2022 by htyp>Woozle (Created page with "==About== The '''global depot''' is a static class which manages singleton objects and values for global reference by Ferreteria applications. These are only kept available fo...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

About

The global depot is a static class which 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.

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