Page MenuHomePhabricator

Separate object creation and object initialization
Open, LowestPublic

Description

Migrated from: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/276

It is an OOP best practice to have simple constructors which only do trivial things, and have a separate initializaton function for everything else. That way, it is easy to change where objects are created, so it is easier to do proper dependency injection; also, tests can change or mock the behavior of the init function without having to resort to modification of the prototype.

Event Timeline

MingleTerminator raised the priority of this task from to Medium.Dec 8 2014, 4:47 PM
MingleTerminator added a project: Multimedia.

Mass-removing the Multimedia tag from MediaViewer tasks, as this is now being worked on by the Reading department, not Editing's Multimedia team.

Jdlrobson lowered the priority of this task from Medium to Lowest.Dec 21 2015, 4:55 PM
Jdlrobson subscribed.