June 27, 2014 EuroClojure 2014 Krakow, Poland. Components. Just Enough
|
|
- Solomon Copeland
- 6 years ago
- Views:
Transcription
1 June 27, 2014 EuroClojure 2014 Krakow, Poland Components Just Enough
2 Presentation Business Logic DB
3 SMS Presentation Thread Pool Business Logic Queues Public API Private API Cache DB DB Monitoring Scheduler DB
4 SMS Presentation Thread Pool Public API Private API Queues Cache DB DB Monitoring Scheduler DB
5 SMS Presentation Thread Pool Queues Static Config Public API Private API Cache DB DB Monitoring Scheduler DB
6 SMS Presentation Thread Pool Queues External Resources Public API Private API Cache DB DB Monitoring Scheduler DB
7 SMS Presentation Thread Pool Queues Process State Public API Private API Cache DB DB Monitoring Scheduler DB
8 Structure Built-In
9 Structure Built-In public class Foo { private URL url; private Socket connection; public Foo(URL url) {...} public void connect() {...} } public void shutdown() {...}
10 Structure Built-In public class Foo { private URL url; Static config private Socket connection; public Foo(URL url) {...} Runtime state Constructor public void connect() {...} Lifecycle } public void shutdown() {...}
11 Not a Lot of Structure
12 Not a Lot of Structure (ns my-app.database) (def url " ") (def connection (atom nil)) (defn connect [] (swap connection )) (defn shutdown [] (swap connection ))
13 Not a Lot of Structure (ns my-app.database) Not instantiable (def url " ") Singletons (def connection (atom nil)) Global mutable (defn connect [] (swap connection )) (defn shutdown [] (swap connection )) variables Global effects
14 Bootstrapping (defn start-all [] (database/connect) (create-queues) (start-thread-pool) (start-web-server))
15 Bootstrapping (defn start-all [] (database/connect) (create-queues) (start-thread-pool) (start-web-server)) All modifying global state Manual ordering
16 Bootstrapping (defn start-all [] (database/connect) (create-queues) (start-thread-pool) (start-web-server)) All modifying global state Manual ordering Hidden dependencies Hard to test
17 Just Enough Structure
18 Component
19 Component Immutable data structure (map or record) Public API Managed lifecycle Relationships to other components
20 Component It's an object Immutable data structure (map or record) Public API Managed lifecycle Relationships to other components
21 Component It's an object Immutable data structure (map or record) Public API Focus on behavior Managed lifecycle Relationships to other components
22 State Wrapper Component (defrecord DB [host conn] )
23 State Wrapper Component Encapsulates state (defrecord DB [host conn] )
24 State Wrapper Component Encapsulates state (defrecord DB [host conn] ) Opaque to most consumers
25 Public API (defrecord DB [host conn] ) (defn query [db & ] (.doquery (:conn db) )) (defn insert [db & ] (.dostatement (:conn db) ))
26 Public API (defrecord DB [host conn] ) (defn query [db & ] (.doquery (:conn db) )) Take component as argument (defn insert [db & ] (.dostatement (:conn db) ))
27 Public API (defrecord DB [host conn] ) (defn query [db & ] (.doquery (:conn db) )) May have side effects (defn insert [db & ] (.dostatement (:conn db) ))
28 Public API (defrecord DB [host conn] ) (defn query [db & ] (.doquery (:conn db) )) (defn insert [db & ] (.dostatement (:conn db) )) May use internal state
29 Lifecycle: Constructor (defrecord DB [host conn]...) (defn db [host] (map->db {:host host}))
30 Lifecycle: Constructor (defrecord DB [host conn]...) (defn db [host] (map->db {:host host})) Creates initial state
31 Lifecycle: Constructor (defrecord DB [host conn]...) (defn db [host] (map->db {:host host})) Creates initial state No side effects
32 Lifecycle: Transitions (ns com.stuartsierra.component) (defprotocol Lifecycle (start [component]) (stop [component])) Default implementation returns component
33 Lifecycle: Transitions (defrecord DB [host conn] component/lifecycle (start [this] (assoc this :conn (Driver/connect host))) (stop [this] (.stop conn) this))
34 Lifecycle: Transitions (defrecord DB [host conn] component/lifecycle (start [this] (assoc this :conn (Driver/connect host))) (stop [this] (.stop conn) this)) Lifecycle protocol
35 Lifecycle: Transitions (defrecord DB [host conn] component/lifecycle (start [this] (assoc this :conn (Driver/connect host))) (stop [this] (.stop conn) this)) May have side effects
36 Lifecycle: Transitions (defrecord DB [host conn] component/lifecycle (start [this] (assoc this :conn (Driver/connect host))) (stop [this] (.stop conn) this)) Always return updated component
37 Service Provider Component (defrecord [endpoint api-key] ) (defn send [ address body] )
38 Service Provider Component (defrecord [endpoint api-key] ) Encapsulates state (defn send [ address body] )
39 Service Provider Component (defrecord [endpoint api-key] ) Encapsulates state Public API provides services (defn send [ address body] )
40 Domain Model? public class Customer { } private String name; private Address address; public void notify() { }
41 Domain Model? public class Customer { } private String name; private Address address; public void notify() { } Just structured data
42 Domain Model? public class Customer { } private String name; private Address address; public void notify() { } Just structured data Mingled with behavior
43 Let Data Be Data
44 Let Data Be Data Clojure maps, records, vectors, Immutable values No behavior
45 Domain Model Component (defrecord Customers [db ]) (defn notify [customers name message] (let [{:keys [db ]} customers address (query db name)] (send address message)))
46 Domain Model Component (defrecord Customers [db ]) Represents aggregate operations (defn notify [customers name message] (let [{:keys [db ]} customers address (query db name)] (send address message)))
47 Domain Model Component (defrecord Customers [db ]) Encapsulates related dependencies (defn notify [customers name message] (let [{:keys [db ]} customers address (query db name)] (send address message)))
48 Domain Model Component (defrecord Customers [db ]) Public API takes component as argument (defn notify [customers name message] (let [{:keys [db ]} customers address (query db name)] (send address message)))
49 Domain Model Component (defrecord Customers [db ]) Gets dependencies out of component (defn notify [customers name message] (let [{:keys [db ]} customers address (query db name)] (send address message)))
50 Domain Model Component (defrecord Customers [db ]) (defn notify [customers name message] (let [{:keys [db ]} customers address (query db name)] (send address message))) Uses public API of other components
51 Domain Model Component (defrecord Customers [db ]) (defn notify [customers name message] (let [{:keys [db ]} customers address (query db name)] (send address message))) Uses public API of other components Treats other components as opaque
52 Constructor with Dependencies (defn customers [] (component/using (map->customers {}) [:db : ]))
53 Constructor with Dependencies (defn customers [] (component/using (map->customers {}) [:db : ])) Declare dependencies by name (Adds metadata)
54 Combining Components
55 System Map (defn system [ ] (component/system-map :customers (customers) :db (db ) : (-> ) ))
56 System Map System constructor (defn system [ ] (component/system-map :customers (customers) :db (db ) : (-> ) ))
57 System Map (defn system [ ] (component/system-map :customers (customers) :db (db ) : (-> ) )) Associates names with components
58 System Map (defn system [ ] (component/system-map :customers (customers) :db (db ) : (-> ) )) Associates names with components Manages lifecycle Provides dependencies
59 System SystemMap :customers :db : Customers DB
60 Starting a System (component/start the-system) SystemMap :customers :db : Customers DB
61 Starting a System Reads dependency metadata SystemMap :customers :db : Customers DB [:db : ]
62 Starting a System Sorts in dependency order SystemMap :customers :db : DB Customers [:db : ]
63 Starting a System Starts each component SystemMap :customers :db : DB Customers
64 Starting a System Starts each component SystemMap :customers :db : DB Customers component/start
65 Starting a System Associates dependencies SystemMap :customers :db : DB Customers assoc :db assoc :
66 Starting a System Starts after dependencies SystemMap :customers :db : DB Customers :db : component/start
67 Starting a System Associates updated components SystemMap :customers :db : back into system DB Customers :db :
68 Stopping a System Same but in reverse order SystemMap :customers :db : DB Customers :db :
69 Stopping a System Same but in reverse order SystemMap :customers :db : DB Customers :db :
70 Before Start #SystemMap{ :customers #Customers{:db nil : nil} :db #DB{ } : # { }}
71 Before Start #SystemMap{ :customers Dependencies unset #Customers{:db nil : nil} :db #DB{ } : # { }}
72 After Start #SystemMap{ :customers #Customers{:db #DB{ } : # { }} :db #DB{ } : # { }}
73 After Start Assoc'd dependencies #SystemMap{ :customers #Customers{:db #DB{ } : # { }} :db #DB{ } : # { }}
74 After Start Assoc'd dependencies #SystemMap{ :customers #Customers{:db #DB{ } : # { }} :db #DB{ } Same values : # { }}
75 After Start Assoc'd dependencies #SystemMap{ :customers #Customers{:db #DB{ } : # { }} :db #DB{ } Same values : # { }} As returned by 'start'
76 Injecting Alternatives (defn test-system [ ] (assoc (system ) : (stub- ) :db (test-db)))
77 Injecting Alternatives (defn test-system [ ] (assoc (system ) : (stub- ) :db (test-db))) Assoc alternate components into system map
78 Injecting Alternatives (defn test-system [ ] (assoc (system ) : (stub- ) :db (test-db))) Assoc alternate components into system map Before start
79 Stub Service for Testing (defprotocol Send (send [ -service address body])) (defrecord Stub [] Send (send [_ address body] ;; record or save input )) (defn stub- [] (->Stub ))
80 Stub Service for Testing (defprotocol Send (send [ -service address body])) (defrecord Stub [] Send (send [_ address body] ;; record or save input )) (defn stub- [] (->Stub )) Function into protocol
81 Stub Service for Testing (defprotocol Send (send [ -service address body])) (defrecord Stub [] Send (send [_ address body] ;; record or save input )) (defn stub- [] (->Stub )) Function into protocol Stub implementation Constructor
82 DB for Testing (defrecord TestDB [host conn] component/lifecycle (start [this] (let [conn (Driver/connect host)] (load-seed-data conn) (assoc this :conn conn))) (stop [this] (drop-database conn) (.stop conn) this))
83 DB for Testing (defrecord TestDB [host conn] component/lifecycle (start [this] (let [conn (Driver/connect host)] (load-seed-data conn) (assoc this :conn conn))) (stop [this] (drop-database conn) (.stop conn) this)) Doesn't mock DB
84 DB for Testing (defrecord TestDB [host conn] component/lifecycle Doesn't mock DB (start [this] (let [conn (Driver/connect host)] (load-seed-data conn) (assoc this :conn conn))) (stop [this] (drop-database conn) (.stop conn) this)) Creates/destroys for each use
85 Testing Business Logic (deftest t-notify-customer (let [system (component/start (test-system)) {:keys [customers]} system] (try (notify customers "bob" "Hi, Bob") ;; make some assertions (finally (component/stop system)))))
86 Testing Business Logic Isolated system (deftest t-notify-customer (let [system (component/start (test-system)) {:keys [customers]} system] (try (notify customers "bob" "Hi, Bob") ;; make some assertions (finally (component/stop system)))))
87 Var Substitution & Asynchrony (deftest t-notify-customer (with-redefs [send ] (binding [*db* ] (notify ) (is ))))
88 Var Substitution & Asynchrony (deftest t-notify-customer (with-redefs [send ] (binding [*db* ] (notify ) (is )))) Delimited in time
89 Var Substitution & Asynchrony (deftest t-notify-customer (with-redefs [send ] (binding [*db* ] (notify ) (is )))) Delimited in time Potential race conditions
90 Var Substitution & Asynchrony (deftest t-notify-customer (with-redefs [send ] (binding [*db* ] (notify ) (is )))) Delimited in time Potential race conditions Tightly coupled to implementation
91 Var Substitution & Asynchrony (deftest t-notify-customer (with-redefs [send ] (binding [*db* ] (notify ) (is )))) Delimited in time Potential race conditions Tightly coupled to implementation Wrong level of granularity
92 Entry Points
93 Entry Point: Main (ns com.example.app (:require [com.stuartsierra.component :as component])) (defn -main [ ] (component/start (system )))
94 Entry Point: Global (def sys (atom nil)) (defn init [] (reset sys (system))) (defn start [] (reset sys (defn stop [] (reset sys
95 Entry Point: Global (def sys (atom nil)) (defn init [] (reset sys (system))) (defn start [] (reset sys (defn stop [] (reset sys Exactly one mutable global for system
96 Entry Point: Global (def sys (atom nil)) (defn init [] (reset sys (system))) (defn start [] (reset sys (defn stop [] (reset sys Exactly one mutable global for system Functions on values
97 Entry Point: Global (def sys (atom nil)) (defn init [] (reset sys (system))) (defn start [] (reset sys (defn stop [] (reset sys Exactly one mutable global for system Functions on values Transition from one state to the next
98 Entry Point: Global (def sys (atom nil)) (defn init [] (reset sys (system))) (defn start [] (reset sys Not swap because (defn stop [] of side-effects (reset sys
99 Web App: Static Routes (defroutes routes (GET "/foo" [req] get-foo) (POST "/bar" [req] do-bar)) (def server (start-server routes))
100 Web App: Static Routes (defroutes routes (GET "/foo" [req] get-foo) (POST "/bar" [req] do-bar)) Static (def server (start-server routes))
101 Web App: Static Routes (defroutes routes (GET "/foo" [req] get-foo) (POST "/bar" [req] do-bar)) Static (def server (start-server routes)) How to get components in here?
102 Web App: Static Routes (defroutes routes (GET "/foo" [req] get-foo) (POST "/bar" [req] do-bar)) Static (def server (start-server routes)) How to get components in here? Don't just deref system everywhere
103 Entry Point: Web Request (defn system-middleware [ring-handler] (fn [request] (ring-handler (assoc request ::web-app
104 Entry Point: Web Request (defn system-middleware [ring-handler] (fn [request] (ring-handler (assoc request ::web-app Get component from system at beginning of each request
105 Entry Point: Compiling Routes (defn make-routes [web-app] (routes (GET "/foo" [request] (get-foo web-app request)) (POST "/bar" [request] (do-bar web-app request))))
106 Entry Point: Compiling Routes Construct routes in a function (defn make-routes [web-app] (routes (GET "/foo" [request] (get-foo web-app request)) (POST "/bar" [request] (do-bar web-app request))))
107 Entry Point: Compiling Routes Construct routes in a function Close over (defn make-routes [web-app] (routes (GET "/foo" [request] (get-foo web-app request)) (POST "/bar" [request] (do-bar web-app request)))) component
108 Entry Point: Compiling Routes Construct routes in a function Close over (defn make-routes [web-app] (routes (GET "/foo" [request] (get-foo web-app request)) (POST "/bar" [request] (do-bar web-app request)))) Pass to handlers component
109 Entry Point: Compiling Routes (defrecord WebApp [customers server] component/lifecycle (start [this] (assoc this :server (start-server (make-routes this)))) (stop [this] (stop-server server) this))
110 Entry Point: Compiling Routes (defrecord WebApp [customers server] component/lifecycle Create routes (start [this] in 'start' (assoc this :server (start-server (make-routes this)))) (stop [this] (stop-server server) this))
111 Entry Point: Compiling Routes (defrecord WebApp [customers server] component/lifecycle Create routes (start [this] in 'start' (assoc this :server (start-server (make-routes this)))) (stop [this] Capture (stop-server server) this)) component
112 Extensions
113 Renaming Dependencies (defn test-system [] (system-map :test/database (test-db) :test/ (stub- ) :customers (component/using (customers) {:db :test/database : test/ })))
114 Renaming Dependencies (defn test-system [] (system-map :test/database (test-db) :test/ (stub- ) :customers (component/using (customers) {:db :test/database : test/ }))) Component s dependency keys
115 Renaming Dependencies (defn test-system [] (system-map :test/database (test-db) :test/ (stub- ) :customers (component/using (customers) {:db :test/database : test/ }))) Component s dependency keys System keys
116 Merging Systems ;; System A {:a/web-app :a/server :db : } ;; System B {:b/web-app :b/server :db : }
117 Merging Systems ;; System A {:a/web-app :a/server :db : } ;; System B {:b/web-app :b/server :db : } (merge system-a system-b)
118 Merging Systems ;; System A {:a/web-app :a/server :db : } ;; System B {:b/web-app :b/server :db : } Namespace-qualified keys prevent clashes (merge system-a system-b)
119 Merging Systems ;; System A {:a/web-app :a/server :db : } ;; System B {:b/web-app :b/server :db : } (merge system-a system-b) Common keys reused Great for testing
120 core.async (defrecord Processor [input-ch output-ch] component/lifecycle (start [this] (assoc this :go (go-loop [] (when-some [val (< input-ch)] )))) (stop [this] (close input-ch) this)))
121 core.async (defrecord Processor [input-ch output-ch] component/lifecycle (start [this] (assoc this dependencies :go (go-loop [] (when-some [val (< input-ch)] )))) (stop [this] (close input-ch) this))) Channels as
122 core.async (defrecord Processor [input-ch output-ch] component/lifecycle (start [this] (assoc this dependencies :go (go-loop [] (when-some [val (< input-ch)] )))) (stop [this] (close input-ch) this))) Channels as Create event loop in start
123 core.async (defn system [] :events (chan 100) :log (chan 100) :processor (component/using (->Processor) {:input-ch :events :output-ch :log}) )
124 core.async Create channels (defn system [] :events (chan 100) in system :log (chan 100) :processor (component/using (->Processor) {:input-ch :events :output-ch :log}) )
125 core.async Create channels (defn system [] :events (chan 100) in system :log (chan 100) :processor (component/using (->Processor) {:input-ch :events :output-ch :log}) ) Connect to component
126 core.async Create channels (defn system [] :events (chan 100) in system :log (chan 100) :processor (component/using (->Processor) {:input-ch :events :output-ch :log}) ) Connect to component Insert mult / pipe / etc. for indirection
127 Summary
128 Advantages Explicit dependencies and clear boundaries Isolation, decoupling Easier to test, refactor Automatic ordering of start/stop Easy to swap in alternate implementations Everything at most one map lookup away
129 Disadvantages Requires whole-app buy-in System map is too big to inspect visually Cannot start/stop just part of a system Boilerplate Records, constructors, Lifecycles, dependencies Destructuring component fields in functions
130 Possible Future Additional lifecycle protocols init acquires resources but does not start release closes resources and drops dependencies
131 Possible Future Handle mutable containers for systems Allow individual components to start, stop, or change at runtime Deref container and get current component with latest dependencies Catch errors, mark component as failed
132 @stuartsierra stuartsierra.com github.com/stuartsierra/component
Clojure Lisp for the Real clojure.com
Clojure Lisp for the Real World @stuartsierra clojure.com Stuart Sierra Relevance, Inc. Clojure/core Clojure contributor Values Values 3 Values 3 + 2 = 5 Values let x = 3 Values let x = 3 let x = 5 Values
More informationClojure Lisp for the Real #clojure
Clojure Lisp for the Real World @stuartsierra #clojure 1 Bullet Points Values Code is data Generic data access Concurrency 2 Stuart Sierra Relevance, Inc. Clojure/core Clojure contributor 3 Values 4 Values
More informationIntroduction Basics Concurrency Conclusion. Clojure. Marcel Klinzing. December 13, M. Klinzing Clojure 1/18
Clojure Marcel Klinzing December 13, 2012 M. Klinzing Clojure 1/18 Overview/History Functional programming language Lisp dialect Compiles to Java Bytecode Implemented in Java Created by Rich Hickey Version
More informationSymbols. abstractions, implementing, 270 through indirection, 77 with macros, 183 abstract syntax tree (AST), 149
Index Symbols + (addition operator), 36 37 @, 155, 197 >!! (blocking put), 235 238
More informationMacro #clojureconj
Macro Club @stuartsierra #clojureconj 500 sq ft I ( ) If it seems simple, you're probably doing it wrong. You can pry EMACS from my cold, dead fingers. The First Rule of Macro Club You do not
More informationLazytest Better Living Through Protocols. Stuart Sierra. Clojure NYC April 15, 2010
Lazytest Better Living Through Protocols Stuart Sierra Clojure NYC April 15, 2010 @stuartsierra #clojure clojure.core: tests as metadata (defn add ([x y] (+ x y)) {:test (fn [] (assert (= 7 (add 3 4))))})
More informationClojureScript. as a compilation target to JS. Michiel Vijay FP AMS October 16th 2014
ClojureScript as a compilation target to JS Michiel Borkent @borkdude Vijay Kiran @vijaykiran FP AMS October 16th 2014 This work is licensed under a Creative Commons Attribution 4.0 International License.
More informationPage 1
Java 1. Core java a. Core Java Programming Introduction of Java Introduction to Java; features of Java Comparison with C and C++ Download and install JDK/JRE (Environment variables set up) The JDK Directory
More informationClojure is. A dynamic, LISP-based. programming language. running on the JVM
(first '(Clojure.)) Clojure is A dynamic, LISP-based programming language running on the JVM Origin 2007, Rich Hickey.. 1958, John McCarthy Features Functional Homoiconic Immutability (persistent data
More informationInside core.async Channels. Rich Hickey
Inside core.async s Rich Hickey Warning! Implementation details Subject to change The Problems Single channel implementation For use from both dedicated threads and go threads simultaneously, on same channel
More informationClojure for OOP folks Stefan innoq
Clojure for OOP folks Stefan Tilkov @stilkov innoq 1 Motivation 2 Syntax Idioms 3 OOP Thinking model domains with classes & interfaces encapsulate data in objects prefer specific over generic solutions
More informationclojure & cfml sitting in a tree sean corfield world singles
clojure & cfml sitting in a tree sean corfield world singles 1 how to go faster (with (parentheses)) sean corfield world singles 2 world singles 3 world singles founded in 2001 internet dating platform
More informationApplications MW Technologies Fundamentals. Evolution. Applications MW Technologies Fundamentals. Evolution. Building Blocks. Summary.
Summary Mariano Cilia cilia@informatik.tu-darmstadt.de 1 2 Communication Mechanisms Synchronous Asynchronous 3 4 RPC - Abstraction Remote Procedure (RPC) s System used interface interface definition logic
More informationGraph: composable production systems in Clojure. Jason Wolfe Strange Loop 12
Grah: comosable roduction systems in Clojure Jason Wolfe (@w01fe) Strange Loo 12 Motivation Interesting software has: many comonents comlex web of deendencies Develoers want: simle, factored code easy
More informationIntroduction to yada. Malcolm
Introduction to yada Malcolm Sparks @malcolmsparks 304 Not Modified RangeRequests Expires uthorization Weak vs Strong 405 Method Not Allowed Referrer AcceptLanguage Quality Values IfMatch Allow Continue
More informationThis tutorial is designed for all those software professionals who are keen on learning the basics of Clojure and how to put it into practice.
About the Tutorial Clojure is a high level, dynamic functional programming language. It is designed, based on the LISP programming language, and has compilers that makes it possible to be run on both Java
More informationObject-Oriented Design
Object-Oriented Design Lecture 14: Design Workflow Department of Computer Engineering Sharif University of Technology 1 UP iterations and workflow Workflows Requirements Analysis Phases Inception Elaboration
More informationPersistent Data Structures and Managed References
Persistent Data Structures and Managed References Clojure s approach to Identity and State Rich Hickey Agenda Functions and processes Identity, State, and Values Persistent Data Structures Clojure s Managed
More informationIdentity, State and Values
Identity, State and Values Clojure s approach to concurrency Rich Hickey Agenda Functions and processes Identity, State, and Values Persistent Data Structures Clojure s Managed References Q&A Functions
More informationStuart
Clojure Time Stuart Halloway stu@clojure.com @stuarthalloway Copyright 2007-2010 Relevance, Inc. This presentation is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United
More informationQUIZ. What is wrong with this code that uses default arguments?
QUIZ What is wrong with this code that uses default arguments? Solution The value of the default argument should be placed in either declaration or definition, not both! QUIZ What is wrong with this code
More informationBig Modular Java with Guice
Big Modular Java with Guice Jesse Wilson Dhanji Prasanna May 28, 2009 Post your questions for this talk on Google Moderator: code.google.com/events/io/questions Click on the Tech Talks Q&A link. 2 How
More informationLearning from Bad Examples. CSCI 5828: Foundations of Software Engineering Lecture 25 11/18/2014
Learning from Bad Examples CSCI 5828: Foundations of Software Engineering Lecture 25 11/18/2014 1 Goals Demonstrate techniques to design for shared mutability Build on an example where multiple threads
More informationBUILDING DECLARATIVE GUIS WITH CLOJURE, JAVAFX AND FN-FX DR. NILS BLUM-OESTE
BUILDING DECLARATIVE GUIS WITH CLOJURE, JAVAFX AND FN-FX DR. NILS BLUM-OESTE 08.02.2017 INTRODUCTION AND WHY? Reasons to build a desktop app with JavaFX WHY DO I NEED A SOLUTION FOR DESKTOP GUIS? Working
More informationWith great power comes great responsibility
Developer Guide / dev_guide / unit-testing JavaScript is a dynamically typed language which comes with great power of expression, but it also come with almost no-help from the compiler. For this reason
More information15CS45 : OBJECT ORIENTED CONCEPTS
15CS45 : OBJECT ORIENTED CONCEPTS QUESTION BANK: What do you know about Java? What are the supported platforms by Java Programming Language? List any five features of Java? Why is Java Architectural Neutral?
More informationJava EE Architecture, Part Two. Java EE architecture, part two 1
Java EE Architecture, Part Two Java EE architecture, part two 1 Content Requirements on the Business layer Framework Independent Patterns Transactions Frameworks for the Business layer Java EE architecture,
More informationAssigned Date: August 27, 2014 Due Date: September 7, 2015, 11:59 PM
15440: Distributed Systems Fall 2015 Problem Solving Assignment 1 A Java Programming Preparation for Project 1 Assigned Date: August 27, 2014 Due Date: September 7, 2015, 11:59 PM 1. Warm Up with Some
More informationProduced by. Design Patterns. MSc in Computer Science. Eamonn de Leastar
Design Patterns MSc in Computer Science Produced by Eamonn de Leastar (edeleastar@wit.ie)! Department of Computing, Maths & Physics Waterford Institute of Technology http://www.wit.ie http://elearning.wit.ie
More informationBuilding Flexible Systems
Building Flexible Systems with Clojure and Datomic Stuart Sierra Cognitect We don t want to paint ourselves into a corner Clojure Flexible Systems Fact-based Context-free Non-exclusive Observable Fact
More informationThread Safety. Review. Today o Confinement o Threadsafe datatypes Required reading. Concurrency Wrapper Collections
Thread Safety Today o Confinement o Threadsafe datatypes Required reading Concurrency Wrapper Collections Optional reading The material in this lecture and the next lecture is inspired by an excellent
More informationSocket attaches to a Ratchet. 2) Bridge Decouple an abstraction from its implementation so that the two can vary independently.
Gang of Four Software Design Patterns with examples STRUCTURAL 1) Adapter Convert the interface of a class into another interface clients expect. It lets the classes work together that couldn't otherwise
More informationLife in a Post-Functional World
Life in a Post-Functional World Definitions Functional Programming Definitions Functional Programming Programming with functions! Definitions Functional Programming Programming with functions! Functions
More informationcom.walmartlabs/lacinia-pedestal Documentation
com.walmartlabs/lacinia-pedestal Documentation Release 0.10.1 Walmartlabs Sep 14, 2018 Contents 1 Overview 3 2 Request Format 5 2.1 GET................................................... 5 2.2 POST (application/json).........................................
More informationFunctional Programming and the Web
June 13, 2011 About Me Undergraduate: University of Illinois at Champaign-Urbana PhD: Penn State University Retrofitting Programs for Complete Security Mediation Static analysis, type-based compiler Racker:
More informationMock Objects and Distributed Testing
Mock Objects and Distributed Testing Making a Mockery of your Software Brian Gilstrap Once, said the Mock Turtle at last, with a deep sigh, I was a real Turtle. (Alice In Wonderland, Lewis Carroll) The
More informationMichiel DomCode, May 26th 2015
ClojureScript ReactJS Michiel Borkent @borkdude DomCode, May 26th 2015 Michiel Borkent (@borkdude) Clojure(Script) developer at Clojure since 2009 Former lecturer, taught Clojure Agenda Part 1: ClojureScript
More informationExam Questions 1Z0-895
Exam Questions 1Z0-895 Java Platform, Enterprise Edition 6 Enterprise JavaBeans Developer Certified Expert Exam https://www.2passeasy.com/dumps/1z0-895/ QUESTION NO: 1 A developer needs to deliver a large-scale
More information.NET-6Weeks Project Based Training
.NET-6Weeks Project Based Training Core Topics 1. C# 2. MS.Net 3. ASP.NET 4. 1 Project MS.NET MS.NET Framework The.NET Framework - an Overview Architecture of.net Framework Types of Applications which
More informationProgramming in Scala Second Edition
Programming in Scala Second Edition Martin Odersky, Lex Spoon, Bill Venners artima ARTIMA PRESS WALNUT CREEK, CALIFORNIA Contents Contents List of Figures List of Tables List of Listings Foreword Foreword
More informationMacros, and protocols, and metaprogramming - Oh My!
Macros, and protocols, and metaprogramming - Oh My! (aka "What is Elixir and why should you care?") jim mccoy, Facebook Infosec Tools mccoy@fb.com (jim.mccoy@gmail.com) Who? Currently build and maintain
More informationKotlin/Native concurrency model. nikolay
Kotlin/Native concurrency model nikolay igotti@jetbrains What do we want from concurrency? Do many things concurrently Easily offload tasks Get notified once task a task is done Share state safely Mutate
More informationA- Core Java Audience Prerequisites Approach Objectives 1. Introduction
OGIES 6/7 A- Core Java The Core Java segment deals with the basics of Java. It is designed keeping in mind the basics of Java Programming Language that will help new students to understand the Java language,
More informationCPL 2016, week 10. Clojure functional core. Oleg Batrashev. April 11, Institute of Computer Science, Tartu, Estonia
CPL 2016, week 10 Clojure functional core Oleg Batrashev Institute of Computer Science, Tartu, Estonia April 11, 2016 Overview Today Clojure language core Next weeks Immutable data structures Clojure simple
More informationReference types in Clojure. April 2, 2014
Reference types in Clojure April 2, 2014 Clojure atoms, vars, refs, agents Software transactional memory 2 / 15 From The Joy of Clojure book Time The relative moments when events occur State A snapshot
More informationStackVsHeap SPL/2010 SPL/20
StackVsHeap Objectives Memory management central shared resource in multiprocessing RTE memory models that are used in Java and C++ services for Java/C++ programmer from RTE (JVM / OS). Perspectives of
More informationIntroduction to Programming Using Java (98-388)
Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;
More informationClojure. A (not-so-pure) functional approach to concurrency. Paolo Baldan Linguaggi per il Global Computing AA 2016/2017
Clojure A (not-so-pure) functional approach to concurrency Paolo Baldan Linguaggi per il Global Computing AA 2016/2017 In the words of the inventor Functional programming (rooted in Lisp, from 60s old
More informationAdvanced React JS + Redux Development
Advanced React JS + Redux Development Course code: IJ - 27 Course domain: Software Engineering Number of modules: 1 Duration of the course: 40 astr. hours / 54 study 1 hours Sofia, 2016 Copyright 2003-2016
More informationFall Problem Set 1
15440 - Fall 2017 Problem Set 1 Out: August 24, 2017 Due: September 11, 2017 1 Warm Up [40 Points] Warm up with some critical concepts in Java Object Oriented and Multithreading Programming: Choose the
More informationProgramming Safe Agents in Blueprint. Alex Muscar University of Craiova
Programming Safe Agents in Blueprint Alex Muscar University of Craiova Programmers are craftsmen, and, as such, they are only as productive as theirs tools allow them to be Introduction Agent Oriented
More informationCS193k, Stanford Handout #12. Threads 4 / RMI
CS193k, Stanford Handout #12 Spring, 99-00 Nick Parlante Threads 4 / RMI Semaphore1 Semaphore1 from last time uses the count in a precise way to know exactly how many threads are waiting. In this way,
More informationFor this week, I recommend studying Chapter 2 of "Beginning Java EE 7".
For this week, I recommend studying Chapter 2 of "Beginning Java EE 7". http://find.lib.uts.edu.au/?r=opac_b2874770 261 We have been using a few container services and annotations but they have not been
More informationCS 2340 Objects and Design - Scala
CS 2340 Objects and Design - Scala Objects and Operators Christopher Simpkins chris.simpkins@gatech.edu Chris Simpkins (Georgia Tech) CS 2340 Objects and Design - Scala Objects and Operators 1 / 13 Classes
More informationClojure Concurrency Constructs. CSCI 5828: Foundations of Software Engineering Lecture 12 10/02/2014
Clojure Concurrency Constructs CSCI 5828: Foundations of Software Engineering Lecture 12 10/02/2014 1 Goals Cover the material presented in Chapters 3 & 4 of our concurrency textbook! Books examples from
More informationA Transactional Model and Platform for Designing and Implementing Reactive Systems
A Transactional Model and Platform for Designing and Implementing Reactive Systems Justin R. Wilson A dissertation presented to the Graduate School of Arts and Sciences of Washington University in partial
More informationAn Explicit-Continuation Metacircular Evaluator
Computer Science (1)21b (Spring Term, 2018) Structure and Interpretation of Computer Programs An Explicit-Continuation Metacircular Evaluator The vanilla metacircular evaluator gives a lot of information
More informationANGULAR 2.X,4.X + TYPESRCIPT by Sindhu
ANGULAR 2.X,4.X + TYPESRCIPT by Sindhu GETTING STARTED WITH TYPESCRIPT Installing TypeScript Compiling the code Building a simple demo. UNDERSTANDING CLASSES Building a class Adding properties Demo of
More informationFavoring Isolated Mutability The Actor Model of Concurrency. CSCI 5828: Foundations of Software Engineering Lecture 24 04/11/2012
Favoring Isolated Mutability The Actor Model of Concurrency CSCI 5828: Foundations of Software Engineering Lecture 24 04/11/2012 1 Goals Review the material in Chapter 8 of the Concurrency textbook that
More informationTop Down Design vs. Modularization
6.170 Quiz Review Topics: 1. Decoupling 2. 3. AF & RI 4. Iteration Abstraction & Iterators 5. OMs and Invariants 6. Equality, Copying, Views 7. 8. Design Patterns 9. Subtyping 10. Case Studies Decomposition
More informationWhat if Type Systems were more like Linters?
Typed Clojure An optional type system for Clojure What if Type Systems were more like Linters? Ambrose Bonnaire-Sergeant Me A Practical Optional Type System for Clojure (2012) Typed Clojure Indiegogo Campaign
More informationOptimising large dynamic code bases.
Optimising large dynamic code bases. Who am I? Duncan MacGregor Lead Software Engineer on the Magik on Java project at General Electric in Cambridge Aardvark179 on twitter 2 What is Magik? Dynamic, weakly
More informationA Separation of Concerns Clean Architecture on Android
A Separation of Concerns Clean Architecture on Android Kamal Kamal Mohamed Android Developer, //TODO Find Better Title @ Outware Mobile Ryan Hodgman Official Despiser of Utils Classes @ Outware Mobile
More informationINHERITANCE: EXTENDING CLASSES
INHERITANCE: EXTENDING CLASSES INTRODUCTION TO CODE REUSE In Object Oriented Programming, code reuse is a central feature. In fact, we can reuse the code written in a class in another class by either of
More informationModular Java Applications with Spring, dm Server and OSGi
Modular Java Applications with Spring, dm Server and OSGi Copyright 2005-2008 SpringSource. Copying, publishing or distributing without express written permission is prohibit Topics in this session Introduction
More informationTraining topic: OCPJP (Oracle certified professional Java programmer) or SCJP (Sun certified Java programmer) Content and Objectives
Training topic: OCPJP (Oracle certified professional Java programmer) or SCJP (Sun certified Java programmer) Content and Objectives 1 Table of content TABLE OF CONTENT... 2 1. ABOUT OCPJP SCJP... 4 2.
More informationModellistica Medica. Maria Grazia Pia, INFN Genova. Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico
Modellistica Medica Maria Grazia Pia INFN Genova Scuola di Specializzazione in Fisica Sanitaria Genova Anno Accademico 2002-2003 Lezione 9 OO modeling Design Patterns Structural Patterns Behavioural Patterns
More informationLecture 8: Summary of Haskell course + Type Level Programming
Lecture 8: Summary of Haskell course + Type Level Programming Søren Haagerup Department of Mathematics and Computer Science University of Southern Denmark, Odense October 31, 2017 Principles from Haskell
More informationFrustrated by all the hype?
Fundamentals of Software Architecture Looking beyond the hype Markus Völter (voelter@acm.org) Introduction Frustrated by all the hype? If so this presentation is for you. Otherwise you should leave People
More informationCS558 Programming Languages
CS558 Programming Languages Winter 2018 Lecture 7b Andrew Tolmach Portland State University 1994-2018 Dynamic Type Checking Static type checking offers the great advantage of catching errors early And
More informationCompositional Design Principles
Chapter 16 Compositional Design Principles Learning Objectives In this chapter, I will more formally introduce the three principles that form the 3-1- 2 process. The learning focus is understanding how
More informationCOURSE DETAILS: CORE AND ADVANCE JAVA Core Java
COURSE DETAILS: CORE AND ADVANCE JAVA Core Java 1. Object Oriented Concept Object Oriented Programming & its Concepts Classes and Objects Aggregation and Composition Static and Dynamic Binding Abstract
More informationJAVA MOCK TEST JAVA MOCK TEST II
http://www.tutorialspoint.com JAVA MOCK TEST Copyright tutorialspoint.com This section presents you various set of Mock Tests related to Java Framework. You can download these sample mock tests at your
More informationChapter 6. Object- Oriented Programming Part II
Chapter 6 Object- Oriented Programming Part II 6: Preview issues surrounding the object creational process the Abstract Factory design pattern private and protected inheritance multiple inheritance comparison
More informationBehind the scenes - Continuous log analytics
Behind the scenes - Continuous log analytics Here at Loway, we take data very seriously. QueueMetrics Live, our hosted call-center analytics platform for Asterisk PBXs, is constantly monitored and probed
More informationDOT NET COURSE BROCHURE
Page 1 1Pointer Technology Chacko Towers,Anna nagar Main Road, Anna Nager(Annai Insititute 2nd Floor) Pondicherry-05 Mobile :+91-9600444787,9487662326 Website : http://www.1pointer.com/ Email : info@1pointer.com/onepointertechnology@gmail.com
More informationClojure. The Revenge of Data. by Vjeran Marcinko Kapsch CarrierCom
Clojure The Revenge of Data by Vjeran Marcinko Kapsch CarrierCom Data Processing is what we do Most programs receive, transform, search, and send data Data is raw, immutable information In its essence,
More informationDagger 2 Android. Defeat the Dahaka" Garima
Dagger 2 Android Defeat the Dahaka" Garima Jain @ragdroid Garima Jain @ragdroid Garima Jain @ragdroid Garima Jain @ragdroid Garima Jain @ragdroid Garima Jain @ragdroid Garima Jain @ragdroid @droidconde
More informationRuby: Objects and Dynamic Types
Ruby: Objects and Dynamic Types Computer Science and Engineering College of Engineering The Ohio State University Lecture 5 Primitive vs Reference Types Recall Java type dichotomy: Primitive: int, float,
More informationCSE 70 Final Exam Fall 2009
Signature cs70f Name Student ID CSE 70 Final Exam Fall 2009 Page 1 (10 points) Page 2 (16 points) Page 3 (22 points) Page 4 (13 points) Page 5 (15 points) Page 6 (20 points) Page 7 (9 points) Page 8 (15
More informationCOPYRIGHTED MATERIAL. Table of Contents. Foreword... xv. About This Book... xvii. About The Authors... xxiii. Guide To The Reader...
Table of Contents Foreword..................... xv About This Book... xvii About The Authors............... xxiii Guide To The Reader.............. xxvii Part I Some Concepts.................. 1 1 On Patterns
More informationPrinciples of Programming Languages. Objective-C. Joris Kluivers
Principles of Programming Languages Objective-C Joris Kluivers joris.kluivers@gmail.com History... 3 NeXT... 3 Language Syntax... 4 Defining a new class... 4 Object identifiers... 5 Sending messages...
More informationC++ Threading. Tim Bailey
C++ Threading Introduction Very basic introduction to threads I do not discuss a thread API Easy to learn Use, eg., Boost.threads Standard thread API will be available soon The thread API is too low-level
More informationMagento Technical Guidelines
Magento Technical Guidelines Eugene Shakhsuvarov, Software Engineer @ Magento 2018 Magento, Inc. Page 1 Magento 2 Technical Guidelines Document which describes the desired technical state of Magento 2
More informationProgram to an Interface (a.k.a. - P2I) Not an Implementation
Program to an Interface (a.k.a. - P2I) Not an Implementation Early in the WeatherStation constructor: Barometer bar = new Barometer() ; Why is this problematic: WeatherStation depends on a specific implementation
More informationJava for Programmers Course (equivalent to SL 275) 36 Contact Hours
Java for Programmers Course (equivalent to SL 275) 36 Contact Hours Course Overview This course teaches programmers the skills necessary to create Java programming system applications and satisfies the
More informationAbsolute C++ Walter Savitch
Absolute C++ sixth edition Walter Savitch Global edition This page intentionally left blank Absolute C++, Global Edition Cover Title Page Copyright Page Preface Acknowledgments Brief Contents Contents
More informationRefactoring Without Ropes
Refactoring Without Ropes Roger Orr OR/2 Limited The term 'refactoring' has become popular in recent years; but how do we do it safely in actual practice? Refactoring... Improving the design of existing
More informationApplied Unified Ownership. Capabilities for Sharing Across Threads
Applied Unified Ownership or Capabilities for Sharing Across Threads Elias Castegren Tobias Wrigstad DRF transfer parallel programming AppliedUnified Ownership memory management placement in pools (previous
More informationProgram to an Interface, Not an Implementation
Program to an Interface, Not an Implementation Early in the WeatherStation constructor: Barometer bar = new Barometer() ; Why is this problematic: WeatherStation depends on a specific implementation of
More informationObject Oriented Paradigm
Object Oriented Paradigm Ming-Hwa Wang, Ph.D. Department of Computer Engineering Santa Clara University Object Oriented Paradigm/Programming (OOP) similar to Lego, which kids build new toys from assembling
More informationNational Aeronautics and Space and Administration Space Administration. cfe Release 6.6
National Aeronautics and Space and Administration Space Administration cfe Release 6.6 1 1 A Summary of cfe 6.6 All qualification testing and documentation is now complete and the release has been tagged
More informationCOMPUTER SCIENCE TRIPOS
CST1.2018.4.1 COMPUTER SCIENCE TRIPOS Part IB Monday 4 June 2018 1.30 to 4.30 COMPUTER SCIENCE Paper 4 Answer five questions: up to four questions from Section A, and at least one question from Section
More informationDesign Patterns in Python (Part 2)
Design Patterns in Python (Part 2) by Jeff Rush Jeff Rush 1 of 13 Design Patterns in Python What is a Pattern? a proven solution to a common problem in a specific context describes a
More informationComp-304 : Object-Oriented Design What does it mean to be Object Oriented?
Comp-304 : Object-Oriented Design What does it mean to be Object Oriented? What does it mean to be OO? What are the characteristics of Object Oriented programs (later: OO design)? What does Object Oriented
More informationINF 212 ANALYSIS OF PROG. LANGS FUNCTION COMPOSITION. Instructors: Crista Lopes Copyright Instructors.
INF 212 ANALYSIS OF PROG. LANGS FUNCTION COMPOSITION Instructors: Crista Lopes Copyright Instructors. Topics Recursion Higher-order functions Continuation-Passing Style Monads (take 1) Identity Monad Maybe
More informationCPSC/ECE 3220 Fall 2017 Exam Give the definition (note: not the roles) for an operating system as stated in the textbook. (2 pts.
CPSC/ECE 3220 Fall 2017 Exam 1 Name: 1. Give the definition (note: not the roles) for an operating system as stated in the textbook. (2 pts.) Referee / Illusionist / Glue. Circle only one of R, I, or G.
More informationCST242 Concurrency Page 1
CST242 Concurrency Page 1 1 2 3 4 5 6 7 9 Concurrency CST242 Concurrent Processing (Page 1) Only computers with multiple processors can truly execute multiple instructions concurrently On single-processor
More informationChapter 4 Remote Procedure Calls and Distributed Transactions
Prof. Dr.-Ing. Stefan Deßloch AG Heterogene Informationssysteme Geb. 36, Raum 329 Tel. 0631/205 3275 dessloch@informatik.uni-kl.de Chapter 4 Remote Procedure Calls and Distributed Transactions Outline
More informationSpring Interview Questions
Spring Interview Questions By Srinivas Short description: Spring Interview Questions for the Developers. @2016 Attune World Wide All right reserved. www.attuneww.com Contents Contents 1. Preface 1.1. About
More information