Class

BaseManager

(abstract) Managers.BaseManager()

Constructor

# abstract new BaseManager()

Base Manager Class

Manager Classes in this context should do the bridge between the controllers and the services exposing only the necessary api to the controllers while encapsulating all business logic.

Base Manager Class

Manager Classes in this context should do the bridge between the controllers and the services exposing only the necessary api to the controllers while encapsulating all business logic.

All Manager Classes should be singletons.

This complete separation of concerts is very beneficial for 2 reasons:

  • Allows for testing since there's no browser dependent code (i think) since the DSUStorage can be 'mocked'
  • Allows for different controllers access different business logic when necessary (while benefiting from the singleton behaviour)

This Base Manager Class is designed to integrate with the pdm-trust-loader and a init.file configuration of

     define $ID$ fromvar -$Identity-
     define $ENV$ fromvar -$Environment-

     with cmd createdsu seed traceability specificstring
         define $SEED$ fromcmd getidentifier true
         createfile info $ID$
     endwith
     createfile environment.json $ENV$
     mount $SEED$ /id

     with var $SEED$
         define $READ$ fromcmd derive true
     endwith

     define $SECRETS$ fromcmd objtoarray $ID$

     with cmd createdsu const traceability $SECRETS$
         mount $READ$ /id
         define $CONST$ fromcmd getidentifier true
     endwith

     mount $CONST$ /participant

     with cmd createdsu seed traceability fordb
         define $DB$ fromcmd getidentifier true
     endwith

     mount $DB$ /db

As well as the SSApp Architecture here

it also integrates with the DSUStorage to provide direct access to the Base DSU by default.

All other Managers in this architecture can inherit from this to get access to the getIdentity && getEnvironment API from the credentials set in the pdm-loader

View Source managers/BaseManager.js, line 7