Review main Abandoned

42258[WIP][TASK] Outsource unit tested stdWrap processings

Elmar Hinz CR 0 V 0 Expert +1176 −91 updated 05/28/16, 05:34

Commit message

Outsource all stdWrap processings, each one as a class. Give them a
commen interface.

Goals:

 * Start to separate content object rendering and stdWrap functionality.
 * Introduce an interface for processors of stdWrap.
 * Create a directory to store the stdWrap processor classes.
 * Show how to keep the memory footprint low by using singletons.
 * Apply as far as covered by unit tests to facilitate reviews.

Examples:
 * AddPageCacheTagsStdWrapProcessor
 * IfNullStdWrapProcessor
 * IfEmptyStdWRapProcessor
 * StrftimeStdWrapProcessor
 * StrtotimeStdWrapProcessor
 ...

Motivation:

ContentObjectRenderer has over 8000 lines lines of code. The principle
of separation of concerns needs to be applied to gain flexibility and
facilitate maintenance.

Interface Signature:

The signature of the process method follows the signatures of process
methods within ContentObjectStdWrapHookInterface with smaller
adjustments.

Alternatively it could follow the signature of the
DataProcessorInterface, wich seems to be the younger one. As the stdWrap
processors are not data orientated but string orientated I think the
older one is the better template.

GoF: Flyweight design pattern

Each processer is not more than an outsourced method of
ContentObjectRenderer. There is no internal state. Instead it works on
the state of the parent renderer. The latter is handeled in as a
parameter. The absence of a state enables the use of the singleton
interface to keep the footprint small.

Technical implications:

It is necessary to make the state of the parent renderer accessible by
getters, as well as utility functions used by the processing methods.

Review

  • Code review CR 0

    Imported before Forger kept the single votes, the next import adds them.

  • Verified V 0

    Imported before Forger kept the single votes, the next import adds them.

Issues 2

Files 24

Show 4 more files