Slide 34
Slide 34 text
34
// Adding New Functionality?
class Stream {
func new(KinesisClient kinesisClient, SqsClient sqsClient,
string streamName, string streamType
);
func write(Message message): void {
if (this.streamType === "kinesis") this.kinesisClient.(…)
elif (this.streamType === "sqs") this.sqsClient.(…)
else throw new Exception("…");
}
}
SRP
OCP