omeka-s-modules / DspaceConnector

Connect to / import from a Dspace repo into Omeka S
GNU General Public License v3.0
1 stars 3 forks source link

Cleanup helpers #27

Closed patrickmj closed 8 years ago

patrickmj commented 8 years ago

For example the logger helper gets set as a property. Dunno if it's better to just do a direct call like

$this->logger()->err('Error etc');

or keep it as

$this->logger = $this->logger();

in the constructor and call on that property when desired.

zerocrates commented 8 years ago

I'd say the direct call is better. In the normal flow for something like the logger, you'll never use it (as it's only for errors). If you just have "direct" calls, that means we never have to actually create the plugin and inject the logger (or might not even have to create the logger itself, if nothing's ever logged in that request).

The performance difference is absurdly minor so it really doesn't make much of a difference but that's the general intent with the controller plugins.