Project

General

Profile

Actions

Feature #91600

closed

Unify the handling of Singletons by applying the *Aware design pattern

Added by Tizian Schmidlin over 4 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Frontend
Start date:
2020-06-06
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

I've stumbled across some low hanging fruits and chances while working on indexed_search and one of them was to have an easy way to add the support for the TimeTracker at some places, rather than having to rely on a parent object to use it. A simple way to do so would be to set up a TimeTrackerAwareTrait which would allow developers to quickly add support for such a functionality, in the same vain as TYPO3 already does it for the Logger.

I think that there are some other places where this could make sense, namely for all singleton classes that are used in a general context, some examples would be:
  • TimeTracker
  • FlashMessageService
  • ConfigurationManager (<= not sure about this one)
  • CacheService
  • ...

The list goes on and could probably be extended by some more but you get the gist.

As I need it now, I'll provide the TimeTrackerAwareTrait myself.

Actions #1

Updated by Benni Mack about 4 years ago

  • Status changed from New to Needs Feedback

Doesn't it make more sense to transform the time tracker in some kind of PSR-3 logger?

Actions #2

Updated by Benni Mack almost 4 years ago

  • Target version changed from 11.0 to Candidate for Major Version
Actions #3

Updated by Christian Kuhn almost 2 years ago

  • Status changed from Needs Feedback to Closed

Hey.

I hope it's ok to close here: I'm not a fan of the TimeTracker in the first places and I tend to drop usages here and there since quite a while. We may want to get rid of it entirely and introduce something more solid that is not wired into the code itself, even though if I don't know how do do that currently.

Actions

Also available in: Atom PDF