Strategyパターンを用いた実装について 現在Javaを勉強しており、 Strategyパターンを用いた以下の実装を考えています。 public class UseStrategy { private Strategy strategy; public void doSomthing(int num) { switch (num) { case 0: strategy = new AlphaStrategy(); break; case 1: strategy = new BetaStrategy(); break; case 2: strategy = new GammaStrategy(); break; } // 変数strategyを用いて処理を続行していく // ... } private interface Strategy { public abstract void m
![Strategyパターンを用いた実装について](https://cdn-ak-scissors.b.st-hatena.com/image/square/2217b5f8fd432f1f8e24e3387bf58ef8f86ddb50/height=288;version=1;width=512/https%3A%2F%2Foshiete.xgoo.jp%2Fimages%2Fsp%2Fqa_recommend%2F2101_4.jpg)