Home
DevCentral
Search
Configure Global Search
Log In
Transactions
D3857
Change Details
Change Details
Old
New
Diff
Static methods to lookup, load or resolve ID for a user are moved into the UserRepository class. An instance of the UserRepository class is added to the context. Authentication methods and workspace code are the two places of the code using those methods, they are adapted to be able to call them from the context or pass database. [ Next steps ] From dependency injection point of view, this change is "part 1": it replaces global variables by the context use, but $context is still a service locator. From separation of concerns point of view, plan is to move every method with a call to the database to UserRepository.
12345678901234567890123456789012345678901234567890123456789012345678901234567890 Move static methods for user ID lookup, loading, and resolution into UserRepository class. Add an instance of the UserRepository class to the context. Authentication methods and workspace-related code are updated to call these methods via the context or pass the database directly. [ Next steps ] From dependency injection point of view, this change is "part 1": it replaces global variables with context-based usage, but `$context` still acts a service locator. From separation of concern standpoint, the plan is to move all database-related methods into the `UserRepository` class.
Static methods to lookup
12345678901234567890123456789012345678901234567890123456789012345678901234567890 Move static methods for user ID lookup, loading
,
load or
and
resol
ve ID for a user
ution
are moved
into
the
UserRepository class. A
dd a
n instance of the UserRepository class
is added
to the context. Authentication methods and workspace
code are the two places of the code using those methods, they
-related code
are
adapted to be able
updated
to call
them from the
these methods via the
context or pass
the
databas
e
e directly
. [ Next steps ] From dependency injection point of view, this change is "part 1": it replaces global variables
by the
with
context
use, but $context is still
-based usage,
but `$context` still acts
a service locator. From separation of concern
s point of view
standpoint
,
the
plan is to mo
ve every method
ve
with a call to the database to
all database-related methods into the `
UserRepository
` class
.
Continue