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
original post @ https://www.linkedin.com/feed/update/urn:li:activity:6881954451964461056?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A6881954451964461056%2C6882013851898933249%29&replyUrn=urn%3Ali%3Acomment%3A%28activity%3A6881954451964461056%2C6882320295986917376%29 | |
I think there is a lot to unpack here, and it is probably a very long blog post with very descriptive meaning to terms | |
around system/software design. For more in-depth information, see CQRS Documents by Gregg Young. Also, look | |
at Event Modeling from Adam Dymitruk. Both are exceptional. | |
However, I will try to be concise. CQRS means separating your writes from your reads. In other words, when some | |
actor (user, external system, what have you) issues a command (write side) to the system, it is only changing its state. | |
The system's internal state is critical here, and the system shouldn't leak the internal structure out (encapsulation and | |
information hiding). The Command side does not mean the system doesn't return a typical representation of t |
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 Sub DeleteRowTest() | |
Dim i As Long | |
Dim LastRow As Long | |
Dim Cols As Variant | |
Dim LookFor As String | |
Dim rng As Range | |
With Application | |
.ScreenUpdating = False |
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 clojure-programming.concurrency.futures | |
(:import (java.util Date))) | |
;; Futures | |
;; Simple concept. Take some code and evaluate it in another thread. Thats it. | |
;; Futures return immediately, which allows the current thread of execution | |
;; to continue on doing its own thing. The results of the future can be | |
;; obtained by dereferencing the future. Note that if you try and dereference | |
;; the future prior to it being complete, it will block |
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 functions.apply) | |
;; We can use apply with print because print takes the (& more) | |
;; parameter. So we can pass any number of args to messenger | |
;; and then apply will explode the sequence generated by (& who) in | |
;; the argument list into the print method | |
(defn messenger "Fooling with apply function" [greeting & who] | |
(println who) | |
(apply print greeting who)) |
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
class Foo | |
def initialize | |
@logger ||= APP::LOGGER | |
@agent = Agent.new(name, action, args) | |
end | |
end | |
describe Foo do | |
it "should initialize an integration logger" do | |
foo = Foo.new |
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
;; In Clojure 1.6 we can now also auto resolve keyword forms in the :keys directive | |
;; I think you lose some context with auto-resolve, but its the shortest code | |
(let [{:keys [name date-of-birth orders | |
::street ::city ::state ::postal-code] | |
:as patient} data] | |
(println name \- date-of-birth) | |
(println street ", " city ", " state " " postal-code) | |
(println orders) | |
(println "------- Full Patient Deatils -----") | |
(println patient)) |
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
;; In Clojure 1.6 we can now prefix the name of a key if its the same | |
;; A litte more context with the prefix, but still very clean | |
(let [{:keys [name date-of-birth orders | |
shipping-address/street shipping-address/city | |
shipping-address/state shipping-address/postal-code] | |
:as patient} data] | |
(println name \- date-of-birth) | |
(println street ", " city ", " state " " postal-code) | |
(println orders) | |
(println "------- Full Patient Deatils -----") |
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
;; Destructor a map with another map -> patient has a shipping address | |
;; We use the :keys directive to to assign the shipping address info inside of data | |
;; Notice we also use the :keys directive to also get the name and date of birth | |
(let [{:keys [name date-of-birth orders] | |
{:keys [street city state postal-code]} :shipping-address | |
:as patient} data] | |
(println name \- date-of-birth) | |
(println street ", " city ", " state " " postal-code) | |
(println orders) | |
(println "------- Full Patient Deatils -----") |
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
(def data | |
{:name "Adam Trepanier" | |
:date-of-birth "1981-04-30" | |
:gender "male" | |
:patient-key "test-adam" | |
:status "active" | |
:phone "555-555-5555" | |
:shipping-address {:street "123 Foo Bar Way" | |
:city "Somwhere" | |
:state "CA" |
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
-module(math_functions). | |
-export([test/0, even/1, odd/1, filter/2, split/1, split2/1]). | |
test() -> | |
true = even(10), | |
false = even(11), | |
true = odd(11), | |
false = odd(10), | |
tests_passed. |
NewerOlder