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
before | |
Exception: java.lang.NullPointerException: null | |
core.clj:10 compojur-learning.core/logging[fn] | |
Var.java:401 clojure.lang.Var.invoke |
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
(ns compojur-learning.core | |
(:use compojure.core)) | |
(defroutes handler | |
(GET "/" [] (println "middle") {:status 200})) | |
(defn logging [chain] (fn [req] ( | |
(println "before") | |
(chain req) | |
(println "after")))) |
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
(ns compojur-learning.core | |
(:use compojure.core)) | |
(defroutes handler | |
(GET "/" [] (println "middle") {:status 200})) | |
(def app (-> handler)) |
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
public class NeedVistorPattern { | |
public static void main(String[] args){ | |
SpaceShip ship = new BigSpaceShip(); | |
SpaceShipLauncher launcher = new SpaceShipLauncher(); | |
launcher.launch(ship); | |
} | |
private static class SpaceShipLauncher{ |
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
SpaceShip ship = new BigSpaceShip(); | |
LauncherSystem launcher = new LauncherSystem(); | |
launcher.launch(ship); | |
class LauncherSystem{ | |
public void launch(SpaceShip ship){ | |
Launcher launcher = new Launcher(); | |
launcher.launch(ship); | |
} |
NewerOlder