- node.js v4以降
- IAMの管理者権限ロール設定
- serverless
- serverlessはNode.jsで動くCLIツールなのでローカルにNode.jsのランタイムが必要
// 関数型ソリューション | |
class Cafe { | |
def buyCoffee(cc: CreditCard): (Coffee, Charge) = { | |
val cup = new Coffee() | |
(cup, cup.price) // charge作成を切り離す | |
} | |
} | |
/** | |
* CreditCardとAmountを持つ. |
class Cafe { | |
def buyCoffee(cc: CreditCard): Coffee = { | |
val cup = new Coffee() | |
cc.charge(cup.price) // 副作用 | |
cup | |
} | |
} |