Created
March 17, 2017 12:42
-
-
Save eiriktsarpalis/a8bf785191bc8d7e0a7daf587243de7c to your computer and use it in GitHub Desktop.
Spot the antipattern
This file contains 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 Client = | |
let connectionString = Environment.GetEnvironmentVariable("CONN") | |
let session = new Session(connectionString) | |
let doA (a : A) = session.Send a | |
let doB (b : B) = session.Send b | |
type Client(connectionString : string) = | |
let session = new Session(connectionString) | |
member __.DoA(a : A) = session.Send a | |
member __.DoB(b : B) = session.Send b |
vasily-kirichenko
commented
Mar 17, 2017
let doWithSession connectionString doIt =
use session = new Session(connectionString)
doIt (session :> ISessionForConsumer)
type SessionHandler(connectionString) =
member x.ManageSession doIt =
doWithSession connectionString doIt
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment