Review main Abandoned

36095[TASK] Add getter class for $GLOBALS

Andreas Kienast CR 0 V 0 Normal +85 −0 updated 01/19/15, 13:29

Commit message

This new class holds often used get{AnyGlobal}() methods which are
implemented in multiple classes. Long-term target is to declutter
other classes and use the global getters instead.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 1

Review log 8

  1. Andreas Kienast uploaded patch set 1 01/18/15, 14:24

  2. Anja Leichsenring commented on patch set 1 CR -1 01/18/15, 14:36

    Sorry, no static utility to handle GLOBALS. They need to be explicit in every class that uses them.
  3. Philipp Gampe commented on patch set 1 CR -1 01/18/15, 15:40

    How about creating a trait GlobalGetter instead? This would not effect unit tests, but would allow us to keep the implementation at one place. In essence, traits are just a language way to implement copy&paste code.
  4. Oliver Klee commented on patch set 1 01/18/15, 15:40

    +1 for this
  5. Markus Klein commented on patch set 1 CR -2 01/19/15, 01:28

    The idea of the getters is to have explicit dependencies and to make those mockable. Introducing a static function again kills this benefit. Traits would maybe be an option.
  6. Christian Kuhn commented on patch set 1 CR -2 01/19/15, 13:27

    Andreas, this approach will not make it. At the moment, we want to have the access to globals directly in the class that uses it, together with a local helper method. This way we at least can see very clean the dependency of a class to globals within the class directly. This is more about dependency injection and it also was not decided yet if we should use traits for that.
  7. Andreas Kienast commented on patch set 1 01/19/15, 13:29

    Ok, no problem. I will abandon it
  8. Andreas Kienast abandoned the change 01/19/15, 13:29