Last active
September 28, 2018 01:47
-
-
Save zapkub/f65d1d46fbe9e184cd9f48f7fdcbe396 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OOP ? | |
class TheProblemSolver { | |
solve(problem: Problem){ } | |
} | |
const problemSolver = new TheProblemSolver() | |
problemSolver.solve(p) | |
// OR just pure functional if it pure | |
function solveProblem(problem: Problem) { } | |
solveProblem(p) | |
// OR if it pure? use static property ! stick to the class | |
class TheProblemSolver { | |
public static solve(problem: Problem){ } | |
} | |
TheProblemSolver.solve(p) | |
// OR more complicate paradigm | |
const ioc = new Container() | |
ioc.bind(TheProblemSolver).toSelf() | |
ioc.get(TheProblemSolver).solve(p) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment