Review main Abandoned

52460[WIP][RESEARCH] Centralize rootline

Elmar Hinz CR 0 V 0 Easy +1 −1 updated 05/12/17, 14:10

Commit message

TemplateService and TypoScriptFrontendController have their own PUBLIC
instances of a rootLine while RootlineUtility has a cache of it and
PageRepository provides a getter method. RootlineUtility is more than just an
Utility. It keeps a fullblown cache of the rootlines.

This redundancy seems error prone and is difficult to understand,
at the most due to the public write access.

Consider a better architecture
------------------------------

* PageRepository doesn't bother with the rootline any more.

* RootlineUtility becomes the master of the rootline e.g. as
  RootlineService or RootlineReopository.

* It incorporates the rootline functionality of PageRepository.

* Maybe subclassing of the RootlineService to address special needs as
  RootlineFramework.

* It's data model is a Rootline class object.

* The Rootline class can be serialized for caching.

* The Rootline class has inbuilt calculations for getData().

* Other classes don't manage an own rootline but become clients of the
  RootlineService.

Approach
--------

1. Check out if public write access could be restricted.
2. Localize where matters break.
3. Find unittest that cover the critical points to understand the
   relations.

Unitests of interest
--------------------

* ContentObjectRendererTest::getDataWithTypeFullrootline()

Results
-------

* TypoScriptFrontendController::checkTranslatedShortcut() is writing to
the public rootline of TemplateService.

* This is done in inverse order.

* An issue with rootline caching seems to be, that the rootline has
  different results, depending on the scope of visibilty the client is
  interested in.

* TypoScriptFrontendController::rootline: full rootline.

* TemplateService::rootline: relative rootline form template root page.

* TypoScriptFrontendController::rootline could be directly delegated to
  the RootlineService.

* TemplateService::rootline: Is just the end of the full rootline and
  can be calculated dynamically from it.

* Consider a rootline object that has inbuilt calculations, i.g. for the
  getData behaviour.

* There should be one rootline object per page context in the
terminology of the RootlineUtility.

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.

Files 1