ç§ã¯ããã«ãå®è£ ãåæ©çã§ããã質åãæèµ·ããããã®åºç€ãšããŠã®ã¿æ©èœããããšã«æ³šæããŠãã ããã ãããã«ããããã®èšäºã§èå³æ·±ãèãããªã³ã¯ãããã€ãèŠã€ããŠããã ããã°å¹žãã§ãã
3ã€ã®ã¯ã©ã¹ã®ã¿ãèšè¿°ãããšãã«ã©ãã ãèå³æ·±ãç¬éãçãããã確èªãããã®å Žåãã¢ãŒããã¯ãã決å®ããã¹ãããéçºè ããã®åé¡ãèªåã§è§£æ±ºã§ããããèªåããŸãã
ãããžã§ã¯ãã®äž»ãªã¢ã€ãã¢
ããã§ãããæããæªæ¥ãæ¥ãŠãèªåæ瞊è»ãéœåžãšæã掻çºã«èµ°ããšæ³åããŠãã ããã 質åãçºçããŸãïŒãã®ãããªç¶æ³ã§å人çãªè»ãå¿ èŠã§ããïŒ
å¥ã®ã¢ãããŒããæäŸããŸãã èŠãŠãããªãã¯ç§ã®ãµã€ãã«è¡ããç»é²ãããã©ãŒã ã«èšå ¥ããŠãã ããã ã¢ã³ã±ãŒãã¯æ¬¡ã®ããã«ãªããŸããæææ¥ããéææ¥ã®8æ15åïŒãã€ã³ãAïŒã«æ¯æ¥å®¶ãåºãŠãã¡ã«ã»ãã¹ã«å ¥ããä»äºã«åãæãããŸãïŒãã€ã³ãBïŒã 次ã«ãå€ã®18:00ã«ãªãã£ã¹ãåºãŠïŒãã€ã³ãBïŒãã¢ãŠãã£ã«åº§ã£ãŠå®¶ã«çããŸãïŒãã€ã³ãAïŒã ããã§ããã€ã³ãããªãã«ããããšãã§ããŸããä»äºãæ©ãçµãããããã8å以å ã«åŸ ã€æºåãã§ããŠããŸãã
ãŸããéœåã®è¯ãæéã«è»ã«é»è©±ããããããšãã§ããŸããå ¥å Žæéã¯5å以å ã§ãã ãã®ãããªå Žåã®å¯äžã®æ³šæç¹ã¯ãé±ã«5æé以å ã«äœ¿çšããè»ã§ãã ããã¯ãèšç»ãäžååãªå Žåããããšãã°ãåºèãžã®æ è¡ã®å Žåã§ãã
ãã¹ãŠã®åã³ã®ããã«ã圌ãã¯ããªãã«150 cuãå°ããŸã æãããã ããã§ããã
åœç¶ããã®ãµãŒãã¹ã«ã¯å€ãã®ããžãã¯ããããŸãããªããªãã èæ ®ãã¹ãããšããããããããŸãã ããšãã°ã競äºåããªããã°ãªããŸããã 人ã ã«å®äŸ¡ãªãªãã·ã§ã³ãæäŸããå¿ èŠããããŸãã ãã®ããã«ãå ±åæ è¡ãæäŸã§ããŸãã ã¯ã©ã€ã¢ã³ãã®é£äººãåãæ¹åã«é²ãã§ããããšãããããŸããã5ååŸã§ãã 圌ãã«äžç·ã«ä¹è»ãæäŸã§ããŸããïŒ
ç§ãã¡ã®ãµãŒãã¹ã¯ãå€ãã®èå³æ·±ãæ å ±ãååŸã§ããå€ãã®ããŒã¿ãæäŸããŸãã
- 誰ããã©ãã§ããã€ã誰ãšè¡ãã®ãã
- 誰ããã©ãã§ãã©ã®ãããã®æéãè²»ããã
- ã©ã®è»çš®ãæ éããã
- 誰ãã©ã®è»ã奜ãã
- ... ..
ãã®æ å ±ã«åºã¥ããŠãæçšãªçµè«ãå°ãåºãããšãã§ããŸãã ããšãã°ã ã客æ§ãã©ãã«ããã€è¡ãããç¥ã£ãŠããã®ã§ãæžæ»ãäºæž¬ããããã«èœã¡ãªãããã«ã«ãŒãã調æŽã§ããŸãã
ãããå¯èœã«ããããã«ãæ å ±ã®åéãšåæã®å¯èœæ§ãæäŸããå¿ èŠããããŸãã
äžè¬çã«ãã¢ãã®ã€ã³ã¿ãŒãããã®äžçã®èŠçŽ ãåããããžãã¹åãã®ãèªç¥ãœãªã¥ãŒã·ã§ã³ããšããæµè¡èªãšåŒã°ãã倧èŠæš¡ã§è€éãªãããžã§ã¯ãã«ã€ããŠè©±ããŸãã
éçºæ¹æ³è«ãšèŠä»¶åæ
åœç¶ããŸããããžã§ã¯ãã®ãã¹ãŠã®èŠä»¶ãåæããé©çšããæ¹æ³ïŒãŠã©ãŒã¿ãŒãã©ãŒã«ãã«ãŒããã¹ã¯ã©ã ãªã©ïŒã決å®ããå¿ èŠããããŸãã ãã ãããã®å Žåããããã®æé ã¯ãã¹ãŠã¹ãããããŸãã ãã®èšäºã§æèµ·ãããã»ãšãã©ãã¹ãŠã®è³ªåã¯ãéžæãããæ¹æ³ã«é¢ä¿ãªãããããã®å Žåã«ãçºçããŸãã
èšèªããã¬ãŒã ã¯ãŒã¯ãã¢ãŒããã¯ãã£
æåã¯Javaéçºè ã§ãããããå®è£ ã¯Javaã§è¡ãããŸãã ç§ã責ããªãã§ãã ããã
ãšããã§ãããã°ã©ãã³ã°èšèªã®éžæã¯ã¢ãŒããã¯ãã®ä»äºã§ããããããšãããã以äžãã§ããïŒ
ããã°ã©ãã³ã°èšèªã¯äºæ¬¡çã§ãããäžè¬çã«ã¯ããŒã ã ããéèŠã§ãããšæããªã人ã®ããã«ãç§ã¯å°ããªæèå®éšãè¡ãããšãææ¡ããŸãã ãã®ãããªãããžã§ã¯ãã絶察ã«ããªãèšèªãèããŠãã ããã ããã¯æããã«ééã£ã決å®ã ãšæããŸãã ããã§ã建ç¯å®¶ããã®èšèªã§ãããžã§ã¯ããäœæããããšã決å®ãããšæ³åããŠãã ããã ãããŠãæã£ãŠããªããæããšãã圌ã¯ããªãã«èšãã§ãããïŒããã¯äºæ¬¡çãªè³ªåã§ããäž»ãªãã®ã¯ããŒã ã§ãïŒ
åé ã§è¿°ã¹ãããã«ããã€ã¯ããµãŒãã¹ã¢ãŒããã¯ãã£ã«åºã¥ããŠè¡ããŸãã ã¢ããªã¹ããå§ããæ¹ãæ£ç¢ºã ãšèª°ããèšãã ãããã圌ã«åæããã ãããããã€ã¯ããµãŒãã¹ããããã«å§ããã
ãããŠãã©ã®ãã¬ãŒã ã¯ãŒã¯ãæ¡çšããŸããïŒ å°ãã°ãŒã°ã«ã§æ€çŽ¢ãããšãéžæè¢ãããŸããªãããšãæããã«ãªããŸããSpringFrameworkã§è¡ããŸãã ãã®çç±ã¯ç°¡åã§ããSpringCloudã«ã¯å¿ èŠãªãã®ããã¹ãŠæã£ãŠããŸãã
ãŸããããããçš®é¡ã®APIã²ãŒããŠã§ã€ãæ§æãµãŒãã¹ãã¡ãã»ãŒãžãããŒã«ãŒãDockerãã¯ãŒã¯ãããŒãã«ãŒã«ãšã³ãžã³ããã®ä»å€ãã®ããããªåèªãçšæããŸãã
ãã€ã¯ããµãŒãã¹èšèšã«ã¯ãäž»ã«2ã€ã®ã¢ãããŒãããããŸãã
ãã¡ã€ã³é§åèšèšãšã¯ããã¡ã€ã³ãªããžã§ã¯ããå®çŸ©ãã顧客ãå¿ èŠãšãããã¹ãŠã®å¿ èŠãªã¢ã¯ã·ã§ã³ãå®è£ ããããšãæå³ããŸãã ããšãã°ãããè¬å±ã·ã¹ãã ã®é¡§å®¢ã¯ãã·ã¹ãã ã«æ°ããè¬ãè¿œå ããå€ãè¬ãåé€ããå¿ èŠããããããã§ã«å°å ¥ãããè¬ã®ç·šéã¯çŠæ¢ããå¿ èŠããããšèšããŸãã å¿ èŠãªãã¹ãŠã®ãã£ãŒã«ããåãããå»åŠãã¯ã©ã¹ãäœæããæå®ãããæ©èœãå®è£ ããŸãã ãããã£ãŠã MedicineServiceããããŸãã ã€ãŸã ãã®ã¢ãããŒãã§ã¯ãåºçºç¹ã¯ãã¡ã€ã³ãªããžã§ã¯ãã§ãã
æ©èœçé§åãšã¯ãå¿ èŠãªæ©èœãåºçºç¹ãšãªãããšãæå³ããã©ã®ãã¡ã€ã³ãªããžã§ã¯ããåŒãä»ããå¿ èŠããããã¯ããã§ã«äºæ¬¡çãªåé¡ã§ãã
å人çã«ã¯ãåžžã«ãã¡ã€ã³ãªããžã§ã¯ãããå§ããå¿ èŠãªæ©èœããã®æ¹æ³ã§å®è£ ã§ãããã©ããã確èªããŸãã ããã§ãªãå Žåãç§ã¯æ¢ããŠããŸããããããå¥ã®ãã¡ã€ã³ãªããžã§ã¯ãããµãŒãã¹ã«è¿œå ããå¿ èŠããããŸããïŒ çè«çã«ã¯ãç§ããããããªããã°ãªããªããªã£ããããæ©èœçãã¢ãããŒãã«ç®ãåããæãæ¥ãŸããã
1ã€ã®ãã¡ã€ã³ãªããžã§ã¯ããæã€å€ãã®ãµãŒãã¹ã¯ãããŸãããããã«æ©èœãéå§ã§ããŸãããç§ã«ãšã£ãŠã¯ç°¡åã§ãã
- ãã¡ã€ã³é§åèšèš
- æ©èœé§å
ãã¡ã€ã³é§åèšèšãšã¯ããã¡ã€ã³ãªããžã§ã¯ããå®çŸ©ãã顧客ãå¿ èŠãšãããã¹ãŠã®å¿ èŠãªã¢ã¯ã·ã§ã³ãå®è£ ããããšãæå³ããŸãã ããšãã°ãããè¬å±ã·ã¹ãã ã®é¡§å®¢ã¯ãã·ã¹ãã ã«æ°ããè¬ãè¿œå ããå€ãè¬ãåé€ããå¿ èŠããããããã§ã«å°å ¥ãããè¬ã®ç·šéã¯çŠæ¢ããå¿ èŠããããšèšããŸãã å¿ èŠãªãã¹ãŠã®ãã£ãŒã«ããåãããå»åŠãã¯ã©ã¹ãäœæããæå®ãããæ©èœãå®è£ ããŸãã ãããã£ãŠã MedicineServiceããããŸãã ã€ãŸã ãã®ã¢ãããŒãã§ã¯ãåºçºç¹ã¯ãã¡ã€ã³ãªããžã§ã¯ãã§ãã
æ©èœçé§åãšã¯ãå¿ èŠãªæ©èœãåºçºç¹ãšãªãããšãæå³ããã©ã®ãã¡ã€ã³ãªããžã§ã¯ããåŒãä»ããå¿ èŠããããã¯ããã§ã«äºæ¬¡çãªåé¡ã§ãã
å人çã«ã¯ãåžžã«ãã¡ã€ã³ãªããžã§ã¯ãããå§ããå¿ èŠãªæ©èœããã®æ¹æ³ã§å®è£ ã§ãããã©ããã確èªããŸãã ããã§ãªãå Žåãç§ã¯æ¢ããŠããŸããããããå¥ã®ãã¡ã€ã³ãªããžã§ã¯ãããµãŒãã¹ã«è¿œå ããå¿ èŠããããŸããïŒ çè«çã«ã¯ãç§ããããããªããã°ãªããªããªã£ããããæ©èœçãã¢ãããŒãã«ç®ãåããæãæ¥ãŸããã
1ã€ã®ãã¡ã€ã³ãªããžã§ã¯ããæã€å€ãã®ãµãŒãã¹ã¯ãããŸãããããã«æ©èœãéå§ã§ããŸãããç§ã«ãšã£ãŠã¯ç°¡åã§ãã
å¿ èŠãªãµãŒãã¹ã決ããŸãããã ãããè¡ãã«ã¯ãå¿ ãå¿ èŠãªãã¡ã€ã³ãªããžã§ã¯ãã確èªããŠããããããã®ãµãŒãã¹ãããã·ã¥ãããµãŒãã¹ã調ã¹ãŸãã
ãã©ã³ã¹ããŒãããå§ããŸãããã ããšãã°ã Carã®å Žå ã ãã è»ã¯åäœããŸãããã 説æããŸãã ããšãã°ãçªç¶ã人ãè»ã§é§ ã«è¡ããé»è»ã«ä¹ãæããè¡ã«è¡ããæåŸã®2ããã¡ãŒãã«èªè»¢è»ã«ä¹ãã®ã䟿å©ã«ãªããŸããïŒ çµå±ã®ãšãããç§ãã¡ããã®ãã人ã«ãã®èªè»¢è»ã®ãéãè«æ±ãããã®ã§ããïŒ èª°ããã¢ããã€ãŒã«ã§ãã®æåŸã®ãã€ã«ãé転ãããå Žåã¯ã©ããªããŸããïŒ ç¹ã«ãéãæã£ãŠãã人ãæãããªãã§ãã ããã 圌ã«äžèŒªè»ã貞ããŸãããïŒ ãããã£ãŠãå°æ¥çã«ã¯ãããŸããŸãªããŒã¯ã«ãèšè¿°ããå€ãã®ã¯ã©ã¹ãå¿ èŠã«ãªãå¯èœæ§ããããŸãã
åºçºç¹ãšããŠãããã€ãã®æœè±¡ã¯ã©ã¹Vehicle
public abstract class Vehicle { âŠ. protected String model; protected int wheelNumber; protected Date manufactureYear; protected EngineType engineType; protected Producer producer; }
ããã£ãããã«ãç°ãªãVehicleããããŸãã®ã§ãããã€ãäœããŸãããã
public class Car extends Vehicle { public Car() { wheelNumber = 4; } }
ãããŠããäžã€ã¯è²§ãããéåéžæã®ããã§ãïŒ
public class Bicycle extends Vehicle { public Bicycle() { wheelNumber = 2; } }
ããã ä»ãç§ãã¡å šå¡ããããè¡ã人ãå¿ èŠã§ããç§ãã¡ã®ã¯ã©ã€ã¢ã³ãã圌ã¯ç§ãã¡ã®åå ¥æºã§ãã ãã®ãšã³ãã£ãã£ãCustomerãšåŒã³ãŸãããã
public class Customer { private String firstName; private String lastName; private Date birthDay; }
ãŸããã¯ã©ã€ã¢ã³ããšã®å¥çŽãå¿ èŠã§ããããã¯ã圌ãç§ãã¡ããåãåãè»äž¡ãšããã®ããã«åãåãéé¡ã瀺ããŸãã
public class Contract { private long customerId; private long vehicleId; }
ãã®ãããæäžäœã«Vehicleãæã€CustomerãšContractãšãã1ã€ã®ã¯ã©ã¹éå±€ããããŸãã VehicleService ã ContractServiceããã³CustomerServiceããããããäœæããããšãææ¡ããŸãã
ããã€ã¯ããµãŒãã¹ããšããèšèã§ããã€ã¯ãããšã¯ã©ãããæå³ã§ããïŒ
以åã質åã«èŠãããããŠããŸããããããã€ã¯ããµãŒãã¹ããšããèšèã§ããã€ã¯ãããšã¯ã©ãããæå³ã§ããïŒ çè«çã«ã¯ãããã¯ãå°ããããšããæå³ã§ãã ããããsmallã¯ã©ãããæå³ã§ããïŒ
å€ãã®å Žåããã€ã¯ããµãŒãã¹ã¯1人ã®äººéã®é ã«åãŸãå¿ èŠãããããŸãã¯3人ã®ããŒã ãšãããå®çŸã§ãããã¹ãŠã®ãã®ã«åãŸãå¿ èŠããããšããæèŠããããŸãã ããã¯ç¢ºãã«çã«ããªã£ãŠããŸãããå¥ã®éžæè¢ãšããŠãç§ã¯ãã®åé¡ã«ã€ããŠå°ãç°ãªãèŠç¹ãæäŸããŸãã
å®è£ ãããšãããŸãã¯äœããã®æ¹æ³ã§ãã€ã¯ããµãŒãã¹ãäœæããããšãèããŠããå Žåã¯ãèªåã«åããããŸãããããã®ãµãŒãã¹ã«éåžžã«ééããŠããå ŽåããããæšãŠãŠçµ¶å¯ŸãŒãããæ°ãããã®ãæžãäœè£ã¯ãããŸããïŒ
çãããã¯ããã®å Žåãããã¯ãã€ã¯ããµãŒãã¹ã§ãã ããã§ãªãå Žåã¯ããããã ãããŠãéèŠãªããšã¯ãé²è¡äžã«ãã®è³ªåãå®æçã«èªåããããšã§ãã çªç¶ããããããšçããå Žåã¯ããã®ã¢ã³ã¹ã¿ãŒã®ãªãã¡ã¯ã¿ãªã³ã°/åå²/åèãéå§ããŠãã ããã éåžžããã®æç¹ãŸã§ã«ãã¹ãŠã®ããªããŒã¯ãã§ã«<..æ€é²ãããŠããŸã..>
å€ãã®å Žåããã€ã¯ããµãŒãã¹ã¯1人ã®äººéã®é ã«åãŸãå¿ èŠãããããŸãã¯3人ã®ããŒã ãšãããå®çŸã§ãããã¹ãŠã®ãã®ã«åãŸãå¿ èŠããããšããæèŠããããŸãã ããã¯ç¢ºãã«çã«ããªã£ãŠããŸãããå¥ã®éžæè¢ãšããŠãç§ã¯ãã®åé¡ã«ã€ããŠå°ãç°ãªãèŠç¹ãæäŸããŸãã
å®è£ ãããšãããŸãã¯äœããã®æ¹æ³ã§ãã€ã¯ããµãŒãã¹ãäœæããããšãèããŠããå Žåã¯ãèªåã«åããããŸãããããã®ãµãŒãã¹ã«éåžžã«ééããŠããå ŽåããããæšãŠãŠçµ¶å¯ŸãŒãããæ°ãããã®ãæžãäœè£ã¯ãããŸããïŒ
çãããã¯ããã®å Žåãããã¯ãã€ã¯ããµãŒãã¹ã§ãã ããã§ãªãå Žåã¯ããããã ãããŠãéèŠãªããšã¯ãé²è¡äžã«ãã®è³ªåãå®æçã«èªåããããšã§ãã çªç¶ããããããšçããå Žåã¯ããã®ã¢ã³ã¹ã¿ãŒã®ãªãã¡ã¯ã¿ãªã³ã°/åå²/åèãéå§ããŠãã ããã éåžžããã®æç¹ãŸã§ã«ãã¹ãŠã®ããªããŒã¯ãã§ã«<..æ€é²ãããŠããŸã..>
ããã§ãµãŒãã¹ã®åºæ¬çãªå®è£ ãèŠãããšãã§ããŸãã
次ã«ããã¹ãŠãdockerã«å ¥ããŸãããã ã¡ãªã¿ã«ãç§ã¯æè¿Dockerã®4æ³ã®èªçæ¥ã®éã«ããŒãã¢ããã§ããã«ããŸããã é¢çœããªã³ã¯ãããã«ç§ãã¡ã«æ瀺ãããŸãããããã¯éåžžã«æªããªãå Žæã§ãç§ã¯èŠãããšããå§ãããŸã
ãµãŒãã¹ãdockerã«é 眮ããã«ã¯ãmavenïŒpom.xml docker-maven-pluginãåç §ïŒãšdockerfileã®ãã©ã°ã€ã³ãå¿ èŠã§ãã
docker-compose.ymlã¯ãããžã§ã¯ãã®ã«ãŒãã«ãããããdocker-composeãä»ããŠãã¹ãŠã®ãµãŒãã¹ãèµ·åããŸãã
.envãã¡ã€ã«ãšãã®å 容ã«ã泚æããŠãã ããã ãã®ãã¡ã€ã«ã®è©³çŽ°ã«ã€ããŠã¯ã ããã¥ã¡ã³ããåç §ããŠãã ãã ã ãã®ãã¡ã€ã«ããªããšãWindows 7ãã·ã³ã§MySQLãåæåã§ããŸããã§ããã
ç§ã¯äœãããŸãããïŒ
é·æããå§ããŸãããïŒ
- ãã®ããšã¯æ©èœããŸãã
ããã§ãããã¯æ®å¿µãªããšã«çµäºããŸãã
çæïŒ
æ®å¿µãªããããããã®å€ãããããŸãã®ã§ãç§ãã¡ã¯ããã€ãã®éšåã®ã¿ãéžæçã«æ€èšããŸãã
æ¬ ç¹ã®åæãéå§ããåã«ãå°ããªããããéåžžã«éèŠãªãã€ã³ãã«èšåããããšæããŸãããã€ã¯ããµãŒãã¹ã¢ãŒããã¯ãã£ã§ã¯ãæåã«åãµãŒãã¹ã®å°ãªããšã2ã€ã®ã€ã³ã¹ã¿ã³ã¹ãã·ã¹ãã ã§åäœããè² è·ãå ±æããããšãåæãšããŠããŸãã ãã®ã«ãŒã«ãå®ãããŠããªãå Žåãç§ã®æèŠã§ã¯ããã€ã¯ããµãŒãã¹ã¢ãŒããã¯ãã£ã®è©±ãããã«ãããããšãã§ããŸãã ã¯ããç§ã¯ç¥ã£ãŠããŸããããã¯è°è«ã®äœå°ããããŸãããç§ã®æèŠã¯ããã ãã§ãã
æ®å¿µãªãããåé·æ§ã¯ãµãŒãã¹ã®100ïŒ ã®å¯çšæ§ãä¿èšŒãããã®ã§ã¯ãªããããã·ã¹ãã ã®ããã©ãŒãã³ã¹ãç¶æããããã®å¥ã®åççãªæ¹æ³ãããå Žåã¯ãããã䜿çšããå¿ èŠããããŸãã
æ°ããã¿ã€ãã®ãã©ã³ã¹ããŒããã·ã¹ãã ã«è¿œå ãã
ã¯ã©ã¹å³ã¯ã¢ãŒããã¯ãã£ã§ã¯ãããŸãã
ã¯ã©ã¹ãã€ã¢ã°ã©ã ã¯ã¢ãŒããã¯ãã£ã§ã¯ãªããšãã声æãããè³ã«ããŸãã ããã¯ãããã次ã®ããã«èª¬æãããŸããã¢ãžã¥ãŒã«å
ã®äœãã©ã®ããã«èå³ãæããªãã£ãã®ããã¢ãžã¥ãŒã«ãäœãããã©ã®ããã«äºãã«éä¿¡ããããéèŠã§ãã ååãšããŠããããã¯ããã°ã©ããŒãšããŠåããããšããªã人ã§ãããã©ããããããããã«ã¢ãŒããã¯ãã«ãªããŸããã ããã«äœãšèšããŸããïŒ ãã¶ã圌ãã¯æ¬åœã«æ£ããããç§ã®çµéšã¯ããã§ãªãããšã瀺åããŠããã ãããŠä»ãç§ãã¡ã¯ãŸãã«ãã®ãããªå Žåãæ€èšããŸãã
ã§ãããããŸãæåã«ãæ¡çšããè»äž¡ãé転ãããšãã決å®ã«å¯Ÿããæ£ããã¢ãããŒãã¯ãããŸããïŒ è³ªåã説æããŸãã ããšãã°ãã¹ã¯ãŒã¿ãŒã®ã¬ã³ã¿ã«ãã客æ§ã«æäŸããããšèããŠããŸãã
ããã§ã VehicleServiceã¯æ¬¡ã®ããã«ãªããŸãã
ã·ã¹ãã ã«æ°ããã¹ã¯ãŒã¿ãŒãšã³ãã£ãã£ãè¿œå ããå¿ èŠããããŸãã ãã¹ãŠã¯ç¶æ¿ã«åºã¥ããŠãããããæçµçµæã¯æ¬¡ã®ããã«ãªããŸãã
VehicleServiceã§æ°ããScooterã¯ã©ã¹ãäœæã ã protest ãã³ã³ãã€ã«ãããã³ãããã€ããŸãã ãããŠãæ°åçš®é¡ã®ä¹ãç©ãããå Žåã¯ã©ãã§ããããïŒ æ°ããã¯ã©ã¹ãäœæãããã³ã«ããã¹ããã³ã³ãã€ã«ãªã©ãè¡ããŸããïŒ ä»ã®æ¹æ³ã¯ãããŸããïŒ
ããšãã°ãããããããšãã§ããŸãã VehicleTypeã¯ã©ã¹ãäœæããŸãããã
public class VehicleType { private String name; private List<VehicleProperty> properties; âŠ. }
ã芧ã®ãšããã VehicleTypeã«ã¯VehiclePropertyããããŸã ã
public class VehicleProperty<T> { private String name; private T value; private String description; âŠ.. }
Vehicleã¯ã©ã¹ãäœããŸãããïŒ
public class Vehicle { private VehicleType vehicleType ; private List<VehicleProperty> customProperties; âŠ... }
ããã§ãã·ã¹ãã ã«ã¹ã¯ãŒã¿ãŒãè¿œå ããå Žåã ãŸãVehicleType â ScooterâãäœæããŸãã
VehicleProperty wheelNumberProperty = new VehicleProperty<Integer>("wheelNumber", 2, "number of wheels"); âŠâŠ. VehicleType scooterType = new VehicleType("Scooter"); scooterType.addProperty( wheelNumberProperty); âŠâŠ..
ãããŠãã¹ã¯ãŒã¿ãŒã®ã€ã³ã¹ã¿ã³ã¹ãäœæããå¿ èŠãããå ŽåïŒ
Vehicle scooter1 = new Vehicle(scooterType); âŠ..
ãããã£ãŠã VehicleServiceã§æ°ããã¯ã©ã¹ãäœæããã«ãã§ããã ãå€ãã®æ°ããã¿ã€ããã·ã¹ãã ã«è¿œå ã§ããŸãã
ã¯ã©ã¹å³ã«é¢ããæåŸã®åæ çãªäœè«ãä»ã§ãèŠããŠããŸããïŒè³ªåã¯ãããã建ç¯ã®äž»é¡ã§ãããã©ããã§ãã 以äžã¯ããµãŒãã¹ã®å®è£ ã«å¯Ÿãã2ã€ã®æ ¹æ¬çã«ç°ãªãã¢ãããŒãã説æãã2ã€ã®ã¯ã©ã¹å³ã§ãã ãããã¯ã¢ãŒããã¯ãã£ãœãªã¥ãŒã·ã§ã³ã®äžéšã§ããïŒ ç§ã®æèŠã§ã¯ãéåžžã«ã ãã®å Žåãå®è£ æ¹æ³ã¯ã¯ã©ã¹ã¬ãã«ã§ãåºç¯å²ã«åœ±é¿ãåãŒãããããžã§ã¯ãã®å°æ¥ã®ç掻ãå°çã«å€ããå¯èœæ§ããããŸãã
é ãããããžãã¹ã±ãŒã¹
äžè¬ã«ããµãŒãã¹å
ã®äœããå€æŽããåé¡ã«ã¯ç¹å¥ãªæ³šæãå¿
èŠã§ãã äŸã§èª¬æããŸãã
ãã®ãããªå ŽåããããŸããã éäŒã§ã¯ãã¯ã©ã€ã¢ã³ãã«å°æ¥ã®ã¢ãŒããã¯ãã£ã玹ä»ããŸãã 質åã«çããŸããã ãã¹ãŠãããŸãããããã§ã誰ãããã¹ãŠã奜ãã§ã誰ãã幞ãã§ãã ãããŠããã§ãã¡ã€ã³ã®ã¯ã©ã€ã¢ã³ãITã¹ãã·ã£ãªã¹ãããã®ãããªç°¡åãªè³ªåãããŸãããABCããã¡ã€ã³ãªããžã§ã¯ãã«ã©ã®ãããæ©ãæ°ãããã£ãŒã«ããè¿œå ã§ããŸããïŒ ç°¡åãªè³ªåã§ããã ç§ã¯ã¡ããã©çããŸããïŒãã£ãŒã«ããè¿œå ããŸã-2åãæ°åããæ°æéã®ãã¹ããæžããŠããããã¹ãŠã®ãã¹ããå®è¡ããŸãïŒæ°æéãããããšããããŸãïŒã äžè¬ã«ãç§ã¯ç¹å®ã®å³ã«ååãä»ããããšã¯ã§ããŸããã§ããããå°ãªããšããããè¡ããããŸã§ã誰ãã§ããªããšæããŸãã ç§ã¯æ£è§£ããããã«æããŸãããçããééã£ãŠãããšããæèŠã¯ç§ãå»ããŸããã§ããã ãããŠããæ¥ãç§ã¯èªåãã©ã®ããã«çããªããã°ãªããªãããæããŸããã
ãããŸã§ã®ãšãããç§ã®çãã¯æ¬¡ã®ãšããã§ãããããã¯ã©ã®ãããã®é »åºŠã§èµ·ãããŸããïŒããããäŸå€çãªç¶æ³ã§ããå ŽåãååãšããŠãããžãã¹ã®èŠ³ç¹ãããã®æéã ãã§ååã§ããã°ããã£ãŒã«ããè¿œå ããæéã¯é¢ä¿ãããŸããã ãããé »ç¹ã«çºçããå Žåã¯ã次ã®è³ªåãããå¿ èŠããããŸããããã¯ããžãã¹ã±ãŒã¹ã§ããïŒ ãããããªãããã®æ©èœãæåã«ã·ã¹ãã ã«å ¥ããå¿ èŠããããçãã¯20-30åã§ãïŒãã¡ããåã§ãããããã¯ããã§ããïŒãã±ãŒã¹ãé£ããå Žåã¯ãã£ãšæéãããããŸãã
ãã1ã€ã®çåãçããŸãããã®ããžãã¹ã±ãŒã¹ãä»ã©ã®ããã«æµ®äžããã®ã§ããããã
ããã«éèŠãªè³ªåã§ãããç§ãã¡ãèŠéããä»ã®åæ§ã®ããžãã¹ã±ãŒã¹ã¯ãããŸããïŒ
ãã®ãããªå ŽåããããŸããã éäŒã§ã¯ãã¯ã©ã€ã¢ã³ãã«å°æ¥ã®ã¢ãŒããã¯ãã£ã玹ä»ããŸãã 質åã«çããŸããã ãã¹ãŠãããŸãããããã§ã誰ãããã¹ãŠã奜ãã§ã誰ãã幞ãã§ãã ãããŠããã§ãã¡ã€ã³ã®ã¯ã©ã€ã¢ã³ãITã¹ãã·ã£ãªã¹ãããã®ãããªç°¡åãªè³ªåãããŸãããABCããã¡ã€ã³ãªããžã§ã¯ãã«ã©ã®ãããæ©ãæ°ãããã£ãŒã«ããè¿œå ã§ããŸããïŒ ç°¡åãªè³ªåã§ããã ç§ã¯ã¡ããã©çããŸããïŒãã£ãŒã«ããè¿œå ããŸã-2åãæ°åããæ°æéã®ãã¹ããæžããŠããããã¹ãŠã®ãã¹ããå®è¡ããŸãïŒæ°æéãããããšããããŸãïŒã äžè¬ã«ãç§ã¯ç¹å®ã®å³ã«ååãä»ããããšã¯ã§ããŸããã§ããããå°ãªããšããããè¡ããããŸã§ã誰ãã§ããªããšæããŸãã ç§ã¯æ£è§£ããããã«æããŸãããçããééã£ãŠãããšããæèŠã¯ç§ãå»ããŸããã§ããã ãããŠããæ¥ãç§ã¯èªåãã©ã®ããã«çããªããã°ãªããªãããæããŸããã
ãããŸã§ã®ãšãããç§ã®çãã¯æ¬¡ã®ãšããã§ãããããã¯ã©ã®ãããã®é »åºŠã§èµ·ãããŸããïŒããããäŸå€çãªç¶æ³ã§ããå ŽåãååãšããŠãããžãã¹ã®èŠ³ç¹ãããã®æéã ãã§ååã§ããã°ããã£ãŒã«ããè¿œå ããæéã¯é¢ä¿ãããŸããã ãããé »ç¹ã«çºçããå Žåã¯ã次ã®è³ªåãããå¿ èŠããããŸããããã¯ããžãã¹ã±ãŒã¹ã§ããïŒ ãããããªãããã®æ©èœãæåã«ã·ã¹ãã ã«å ¥ããå¿ èŠããããçãã¯20-30åã§ãïŒãã¡ããåã§ãããããã¯ããã§ããïŒãã±ãŒã¹ãé£ããå Žåã¯ãã£ãšæéãããããŸãã
ãã1ã€ã®çåãçããŸãããã®ããžãã¹ã±ãŒã¹ãä»ã©ã®ããã«æµ®äžããã®ã§ããããã
ããã«éèŠãªè³ªåã§ãããç§ãã¡ãèŠéããä»ã®åæ§ã®ããžãã¹ã±ãŒã¹ã¯ãããŸããïŒ
次ã®ç¬éã VehicleServiceãã¯ã©ãã·ã¥ããå Žåãã·ã¹ãã ã§èªè»¢è»ã®æ°ããã€ã³ã¹ã¿ã³ã¹ãäœæããããšã¯ã§ããŸããïŒããšãã°ãèªè»¢è»ã®æ°ããããããè³Œå ¥ããŠã·ã¹ãã ã«è¿œå ãããå ŽåïŒããŸãã¯ãèªè»¢è»ãã¬ã³ã¿ã«ããããšãã§ããŸããã ã€ãŸã ã¯ã©ã€ã¢ã³ãããªãã£ã¹ã®åŸæ¥å¡ãäœãã§ããŸããã ãªãã£ã¹ã§åé¡ãçºçããå Žåã§ããã客æ§ã泚æããŠãéãããããããšãã§ããã°ãã¯ããã«è¯ãã§ãããã ãããã©ã®ããã«è¡ãããšãã§ããŸããïŒ VehicleServiceã顧客çšãšåŸæ¥å¡çšã®2ã€ã«åå²ããå¿ èŠãããããã§ãã
ãµãŒãã¹ãèšèšããããã®ãã¡ã€ã³ããã³æ©èœçã¢ãããŒãã«ã€ããŠè©±ããŠããããšãæãåºããŠãã ããã 顧客ãšåŸæ¥å¡ã«å¯ŸãããµãŒãã¹ã®å¯çšæ§ã«é¢ããåé¡ã¯ããã¡ã€ã³ã¢ãããŒããéå§ããåé¡ã«ã¶ã€ãããæ©èœçã¢ãããŒãã«ç§»è¡ãããšãã®åªããäŸã§ãã 2ã€ã®ãµãŒãã¹ãå¿ èŠã§ãããã¡ã€ã³ãªããžã§ã¯ãã¯åºæ¬çã«åãã§ãããæ©èœã¯ç°ãªããŸãã
ããäžåºŠã VehicleServiceãã¯ã©ãã·ã¥ãããšããŸãã ããã¯ãè»ãèªè»¢è»ãã¬ã³ã¿ã«ã§ããªãããšãæå³ããŸãã è»ã®ãµãŒãã¹ãå©çšã§ããªãå Žåãããã¯æªãããšã§ã¯ãããŸããããã®åŸãèªè»¢è»ã®ãµãŒãã¹ã¯ããã«æ©èœããŸãã ãããã©ã®ããã«è¡ãããšãã§ããŸããïŒ VehicleServiceãè€æ°ã®ãµãŒãã¹ã«åå²ããŸããåã¿ã€ãã®è»äž¡ã«1ã€ã§ããïŒ
å®éãèããããåé¡ã®æåŸã®2ã€ã®äŸã¯å®å šã«æ£ããããã§ã¯ãããŸããã ãããã¯åé·æ§ãããªãã¡ ãµãŒãã¹ã®ããã€ãã®ã€ã³ã¹ã¿ã³ã¹ãæ©èœããã¯ãã§ãã ãã ããåé ã§è¿°ã¹ãããã«ãåé·æ§ããªããš100ïŒ ã®å¯çšæ§ã¯åŸãããŸããã ãã®ãããä»ã®åççãªä»£æ¿æ¹æ³ã§ãµãŒãã¹ã®å¯çšæ§ã®åé¡ã解決ããå¿ èŠããããŸãã
ç§ãã¡ã®è·¯äžã§äŒæ¥ãèµ·ãããç§ãã¡ããè»ãåããããšæã£ãŠããããããã®é¡§å®¢ãç§ãã¡ã®ãšããã«é§ãã€ããŠããŸããã ãµãŒãã¹ã¯å¯ŸåŠããŸããããããã¯åé¡ã§ã¯ãããŸãããå¥ã®ã€ã³ã¹ã¿ã³ã¹ãèµ·åãããšããã¹ãŠãåã³æ£åžžã«ãªããŸãã ããããä»ã§ã¯è»çšã ãã§ãªãèªè»¢è»çšã®ãµãŒãã¹ã®ã³ããŒã2ã€ãããŸãã æªãã§ããïŒ åãããŸãããã確ãã«è¯ããããŸããã ãããšäžç·ã«æ®ããããšãã§ããå¯èœæ§ãéåžžã«é«ãã®ã§ãèŠãªããã°ãªããŸããã
ãããã®åé¡ãèæ ®ããåŸããµãŒãã¹ã®å®è£ ã«å¥ã®ãªãã·ã§ã³ãæäŸã§ããŸãã 茞éã®çš®é¡ããšã«åå¥ã®ãµãŒãã¹ãæäŸããŸãã ãããããã®ãããªçåãçããŸãã
ããªããã¯ã©ã€ã¢ã³ãã§ããµã€ãã«è¡ããå¯èœãªãã¹ãŠã®ã¿ã€ãã®ãã©ã³ã¹ããŒãã®ãªã¹ããèŠãããšä»®å®ããŸãã ããªãã¯æ¬¡ã®ãããªãã®ãèŠããã§ãïŒ
- è»
- èªè»¢è»
- ã¹ã³ãŒã¿ãŒ
- ãã©ã¯ã¿
- ... ...
ãã®ãªã¹ãã¯ã©ãããæ¥ãã®ã§ããïŒ ããããã VehicleTypesServiceãµãŒãã¹ãå¿ èŠã«ãªããŸãããã®ãµãŒãã¹ã¯ãã·ã¹ãã ã«ã©ã®ã¿ã€ãã®è»äž¡ãååšããããç¥ã£ãŠããŸãã 圌ã¯ã©ããããã®æ å ±ãå ¥æããŸããïŒ æåã«é ã«æµ®ãã¶ã®ã¯ããã³ã§ããŒã¿ããŒã¹ã«æžã蟌ãããšã§ãã ãµãŒãã¹ã«å¥ã®ã¿ã€ãã®ãã©ã³ã¹ããŒããæäŸããå Žåããã®ãµãŒãã¹ãäœæãã VehicleTypesServiceã«ç§»åããŠããŒã¿ããŒã¹ã«ãã1è¡è¿œå ããããšãå¿ããªãã§ãã ããã
ããããå¥ã®æ¹æ³ã§ãå¯èœã§ãã èµ·åæã«ãåãµãŒãã¹ã¯VehicleTypesServiceãããã¯ããŠããã®ååšãéç¥ããå¿ èŠããããŸãã ãã®ãœãªã¥ãŒã·ã§ã³ã¯èŠæ ããè¯ãããã«èŠããŸãããè¿œå ããå¿ èŠããªãå Žåã®å¯ŸåŠæ¹æ³ã®è³ªåã«ã¯çãããè»äž¡ã®ã¿ã€ããåé€ããŸãã ããšãã°ã6ãæåŸã誰ãã¢ããã€ãŒã«ã䜿çšããŠããªãããšã«æ°ä»ããŸãããã¢ããã€ãŒã«ãã·ã¹ãã ããåé€ãããã®ã§ãã ãããã©ããã£ãŠããã®ïŒ
ãããŠãããäžã€èå³æ·±ã質åããããŸãã ã芧ã®ãšããã Vehicleã«ã¯EngineTypeãã£ãŒã«ãããããŸãã
public abstract class Vehicle { âŠ... protected EngineType engineType;
ç§ã®åæ©çãªå®è£ ã§ã¯ãEngineTypeã«ã¯åæåããããŸãã
- ã¬ã¹
- ãã£ãŒãŒã«
- ãšã¬ã¯ãã
ãããŠä»ã質åãã®ãã®ïŒãã€ããªããçºé»æãåããè»ãã©ã®ããã«äœæããã®ã§ããããïŒ
EngineTypeã®ä»£ããã«ã EngineTypeã®ãªã¹ããäœæããŠã¿ãŸããã ïŒãããŠããã·ã³ã®99ïŒ ãçªç¶1ã€ã®èŠçŽ ãæã€ãªã¹ããæã€ããšã«ãªããŸãïŒïŒ
public abstract class Vehicle { âŠ... protected List<EngineType> engineTypes;
ãŸãã¯ãåæåã«Gibridã®ãããªæ°ããåãè¿œå ããŸããïŒ
ãã®å Žåã誰ã決å®ãäžããããã«å¿ããŠè²¬ä»»ãè² ããŸããïŒ
ããã§å»ºç¯ã«ã€ããŠè©±ããŠãããšèšã£ãŠãããã§ãããããã¯ããŸãã«ãå°ããªã質åã§ããïŒ
EngineTypeãã£ãŒã«ãã®äŸã䜿çšããŠããã1ã€ã®è³ªåãããããšæããŸããè»ã«æèŒãããŠãããšã³ãžã³ãæ¬åœã«ç¥ãå¿ èŠãããã®ã§ããããã å®éãã客æ§ããã£ãŒãŒã«çæãŸãã¯ã¬ãœãªã³ãã¿ã³ã¯ã«æ³šãå¯èœæ§ãéåžžã«é«ãããšã¯ãã客æ§ã«ãšã£ãŠçµ¶å¯Ÿã«éèŠã§ã¯ãããŸããã ããããããšãã°ãèªè»¢è»ãæã¡æ©ãèœåïŒã€ãŸãã倧ããªãã©ã³ã¯ãããããç¹å¥ãªèªè»¢è»ããŠã³ãããããïŒã¯éåžžã«éèŠã§ãã
å®éããšã³ãžã³ã®çš®é¡ã¯ãã¡ããéèŠã§ãããã¯ã©ã€ã¢ã³ãã«ãšã£ãŠã§ã¯ãªããç§ãã¡ã«ãšã£ãŠããã®ãµãŒãã¹ãæäŸããäŒç€Ÿã«ãšã£ãŠã¯éèŠã§ãã ãã®çç±ã®1ã€ã¯ãçµ±èšïŒããšãã°ãçæè²»ãå¿ èŠãªä¿®çã«é¢ããïŒã§ãã ãšã³ãžã³ã®çš®é¡ããšã«å€§ããç°ãªããŸãã ããã¯å¥ã®è³ªåãæããŸãïŒãã¡ã€ã³ãªããžã§ã¯ãïŒãŸãã¯ãã®è¡šçŸïŒã¯ãããã¯ãšã³ããšããã³ããšã³ãã§ç°ãªãå¿ èŠããããŸããïŒ
ãã®çš®ã®è³ªåã«çããæ¹æ³ã¯ïŒ ç§ã¯1ã€ã®æ¹æ³ããç¥ããŸãããããžãã¹ã®äººã ãšãã£ãšé »ç¹ã«è©±ãåããäœãã©ãã§èŠããããå°ããã¹ãã§ããããïŒ æ®å¿µãªããã圌ãèªèº«ã¯ãã°ãã°ãããã®è³ªåã«å¯Ÿããçããç¥ããŸããã
è€éãªã¯ãšãª
èŒããããã«ãªã³ã®è¡ããªã¬ã³ãžã¹ããªãŒãã«äœãã§ããå¥çŽã®ãããã¹ãŠã®é¡§å®¢ã«äŒããããšããŸãã ã€ãŸã ãã®ãã¬ãŒãã®ãããªãã®ãèŠããïŒ
å§ãå | å¥çŽçªå· | å¥çŽã«çœ²åããæ¥ä» | è» |
---|---|---|---|
ãããã³ããŽã¡ã·ã£ | 12345 | 2017幎1æ1æ¥ | ã¢ãŠãã£Q4 |
...... | ...... | ...... | ...... |
ã芧ã®ãšãããããŒãã«ã«ã¯3ã€ã®ãã€ã¯ããµãŒãã¹ããã®ããŒã¿ãå«ãŸããŠããŸãïŒ CustomerService ã VehicleServiceããã³ContractService ã ããããã©ã®ããã«çµã¿ç«ãŠãŸããïŒ ã¢ããªã¹ã®å ŽåãããŒã¿ããŒã¹ãžã®1ã€ã®ãªã¯ãšã¹ãã§åé¡ã¯è§£æ±ºãããŸããã3ã€ã®ããŒã¹ãããå Žåã¯ã©ãããã°ããã§ããããïŒ
ãã®å°ããªåé¡ã解決ããããã®ããŸããŸãªãªãã·ã§ã³ãããã次åã¯ãããã«ã€ããŠèª¬æããŸãã
ããããšããã£ããïŒ
ãããŠä»æ³šç®ã®ç¬éã ãã€ãããã®è³ªåãããå¿
èŠããããŸãããïŒ åçïŒãã¡ãããã³ãŒããæžãåã«ã ãããŠã建ç¯å®¶ã¯ãããã®è³ªåã«çããªããã°ãªããŸããã
ææ決å®ããã»ã¹ãšããã°ã©ãããŒã ãžã®å ±åæ¹æ³ã¯ã©ãã§ãã
ãããŠä»ããããã¯ã«é¢ããå°ããªãæèã®æµããããããŸãã決å®ãäžãããããããã°ã©ããŒã®ããŒã ã«äŒããããã»ã¹ã¯ã©ã®ããã«è¡ãããŸããïŒ ç§ã¯2ã€ã®çè«çãªå¯èœæ§ãç¥ã£ãŠããŸããããã以å€ã¯ãã¹ãŠãããŸããŸãªæ¯çã§ã®ãããã®ããã¯ã¹ã§ãã
å人çã«ã¯ã2çªç®ã®ãªãã·ã§ã³ã«è¿ã¥ããŠããŸãïŒç¹°ãè¿ããŸãããè¿ã¥ããŸããããå®å šã«ã¯æºè¶³ããŠããŸããïŒã ããã«ã¯ããããæ°åã®çç±ããããŸããããã®ãã¡ã®ããã€ããèããŠã¿ãŸãããã
ç§ã¯è²¬ä»»ãè² ããããããŸããã ããããæ¬åœã«ã ç§ã¯ãåççãªäººãšåãããã«ãããããã®ãéãããããããäœããããããã«å¯Ÿãã責任ãè² ããŸããã ããããæ®å¿µãªãã客芳çãªçŸå®ã¯ããããäžå¯èœã§ããããšã瀺ããŠããŸãã ãŸãããŸãã¯å°ãªããšãç§ã¯ãŸã æ£ããæ¹æ³ãèŠã€ããŠããŸããã
ãããããå¥ã®è²¬ä»»ãšåãã¡åããããã«ã¯å¥ã®çç±ãããããããéèŠã§ãã ããã°ã©ããŒãè°è«ã«åå ããïŒãããã£ãŠéæ¥çã«æ±ºå®ãäžãïŒå Žåãããã°ã©ããŒã¯ç°ãªãã¬ãã«ã®æ³šæãæã£ãŠãããå®è£ ããŸãã ãžã£ã ãçªç¶åºãŠããå Žåã圌ã¯ããã圌ã®ããã§ãããããã®å»ºç¯å®¶ã®ãã«ããŽããçºæããããç§ã¯ãããç¡é§ã«ãããããšãç解ããŸãã
ãã1ã€ã®çç±ã¯ãã·ã¹ãã ãšãã®ç°å¢ã«é¢ããäžå®å šãªç¥èã«ãããŸãã ã¢ãŒããã¯ãã£ã®ãã¬ãŒã³ããŒã·ã§ã³åŸã«ããä»ã®èª°ãã®èª²éã·ã¹ãã ããããŒã¿ãååŸããå¿ èŠããããšããäºå®ã«ã©ã®ããã«é©åããã®ã§ããããïŒããšãã質åãåãåããšæ³åããŠã¿ãŠãã ããã ãããŠã建ç¯å®¶ãé€ããŠèª°ãããããç¥ã£ãŠããŸãã ã¯ãããããèµ·ãããŸãã
ãã®æ±ºå®ãè¡ãããçç±ã説æããããšãéèŠã§ãããä»ã®æ±ºå®ã¯è¡ãããå©ç¹ã説æããæ¬ ç¹ã«ã€ããŠèšåããããšãéèŠã§ãã ãã®å Žåã人ã ã¯äœãèµ·ãã£ãŠããããç解ããã¯ããã«å¿è匷ããªããŸãã
確ãã«ããã®ãããªãæ°äž»äž»çŸ©ãã¯ãå€ãã®äººã ã«ãã£ãŠæ±ºå®ãäžããããšããç¬èªã®å¢çç·ãæã£ãŠããããšã«æ³šæãã¹ãã§ãã ããã«ããã®ãããªãæ°äž»çãªã決å®ãåžžã«å¯èœã§ãããšã¯éããŸããã ããšãã°ãè°è«ããããœãªã¥ãŒã·ã§ã³ã®ãããããæªãããšã誰ããç解ãã誰ãè¯ãããšãç¥ããªãå Žåã æçµçã«ã決å®ãééã£ãŠããããšãçªç¶å€æããå Žåãã¢ãŒããã¯ãããããæ åœããŸãã èšãèš³ã圌ãã¯èšããç§ã¯çã«å°ãããããã¯éåçãªæ±ºå®ã ã£ããæ®å¿µãªããããã¯åäœããŸããã ã¢ãŒããã¯ãã¯ããã®æ±ºå®æ¹æ³ã«é¢ä¿ãªãããã¹ãŠã®æ±ºå®ã«å¯ŸããŠå人çãªè²¬ä»»ãè² ããŸãã
æåŸã«ãããã«2ã€ã®èãã
ãŸããããªãã®ã¢ãŒããã¯ãã£ãè¯ããšæããªããããã¯ããªãããŸã 誰ã«ãèŠããŠããªãããšãæå³ããŸãã ãšããã§ãããã¯ã³ãŒãã«ãåœãŠã¯ãŸããŸãã
第äºã«ãç§ã¯ã¢ãŒããã¯ããä»ã®èª°ãã®é¡ããå®çŸããããšã®æå³ãç解ããããã«ãã¢ãŒããã¯ããå®çšçãªããã°ã©ãã³ã°çµéšãæã€ã¹ãã§ãããšããæèŠã®ã«ããŽãªãŒæ¯æè ã§ãã ããã«è¯ãããšã«ãã¢ãŒããã¯ãããããžã§ã¯ãã®å®è£ ã«çŽæ¥é¢äžããŠããå Žåãã€ãŸã ã³ãŒããäœæããããå°ãªããšããã®ã³ãŒãèªäœã¯ä¿®æ£äžã§ãã ã¢ãŒããã¯ãã¯ãã³ãŒããã¢ãŒããã¯ãã£äžã®æ±ºå®ãšäžèŽããŠããããšãå®æçã«ç¢ºèªããå¿ èŠããããŸãã
ç§ããã®ç¬éãå°ç¡ãã«ããŠãã¹ããªã³ãã¬ãã¥ãŒã§ã®ã¿ãããã°ã©ããŒãèšãããããã«ããªãããšãå¶ç¶èŠã€ããŸããã 質åã«å¯ŸããŠïŒè±èªã§é»ã§æžãããŠããããã€ãã³ãããéä¿¡ããŸãããªãhttpãªã¯ãšã¹ããéä¿¡ããã®ã§ããïŒ çããåãåã£ãïŒãŸããç§ã¯ãããè¯ããšæããŸããã åœç¶ããã¹ãŠãå¶åŸ¡ããããšã¯äžå¯èœã§ããããŒã ãä¿¡é Œããå¿ èŠããããŸãã ãããããã€ã人ãèšãããã«ãä¿¡é Œã¯è¯å¥œã§ãããã³ã³ãããŒã«ã¯åªããŠããŸãã
- åç¶ãæ¥ãŠãæŽç·Žãããèšèã§é¢šå³ä»ããããå³ã®åœ¢ã§ããããçš®é¡ã®å°»å°Ÿãæã€ãã¬ãŒã³ããŒã·ã§ã³ãèŠããŸãã å€ãã®å Žåã圌ã¯åœŒã®èåŸã«å€ãã®çµéšãããããšãæããã«ããèªåããã£ãŠããããšããã¹ãŠç解ããŠããŸããã決å®ã¯å®å šãã€åæ¶äžèœã«è¡ãããããã§ãã é ãã®åããã€ã¶ãããèããŠã圌ã¯ããã«èªåãåžžã«æ°ããã¢ã€ãã¢ã«éãããŠãããšæèšããŸãå®éãããã®å»ºç¯å®¶ã¯æ¬æ Œçãªç¬è£è ã§ãã
- åç¶ãæ¥ãŠã圌ã¯ãã¢ãŒãã£ã¹ããã§ããããã®ãããªãçµµããèŠããšèšããŸãã åæã«ã圌ã¯ãæããããšã¯ãªããšçŽæ¥èšããŸããããããŒã«ãã®äººã ããããã£ãŠã圌ãã®é倧ãªå©çã®ããã«ãçµµã®ããžã§ã³ãtheãããå¯èœã§ããã°ã代æ¿æ¡ãæäŸããŸãã ãã®å Žåã建ç¯å®¶ã¯èªåã®è²¬ä»»ã軜æžããããšããŸãã
å人çã«ã¯ã2çªç®ã®ãªãã·ã§ã³ã«è¿ã¥ããŠããŸãïŒç¹°ãè¿ããŸãããè¿ã¥ããŸããããå®å šã«ã¯æºè¶³ããŠããŸããïŒã ããã«ã¯ããããæ°åã®çç±ããããŸããããã®ãã¡ã®ããã€ããèããŠã¿ãŸãããã
ç§ã¯è²¬ä»»ãè² ããããããŸããã ããããæ¬åœã«ã ç§ã¯ãåççãªäººãšåãããã«ãããããã®ãéãããããããäœããããããã«å¯Ÿãã責任ãè² ããŸããã ããããæ®å¿µãªãã客芳çãªçŸå®ã¯ããããäžå¯èœã§ããããšã瀺ããŠããŸãã ãŸãããŸãã¯å°ãªããšãç§ã¯ãŸã æ£ããæ¹æ³ãèŠã€ããŠããŸããã
ãããããå¥ã®è²¬ä»»ãšåãã¡åããããã«ã¯å¥ã®çç±ãããããããéèŠã§ãã ããã°ã©ããŒãè°è«ã«åå ããïŒãããã£ãŠéæ¥çã«æ±ºå®ãäžãïŒå Žåãããã°ã©ããŒã¯ç°ãªãã¬ãã«ã®æ³šæãæã£ãŠãããå®è£ ããŸãã ãžã£ã ãçªç¶åºãŠããå Žåã圌ã¯ããã圌ã®ããã§ãããããã®å»ºç¯å®¶ã®ãã«ããŽããçºæããããç§ã¯ãããç¡é§ã«ãããããšãç解ããŸãã
ãã1ã€ã®çç±ã¯ãã·ã¹ãã ãšãã®ç°å¢ã«é¢ããäžå®å šãªç¥èã«ãããŸãã ã¢ãŒããã¯ãã£ã®ãã¬ãŒã³ããŒã·ã§ã³åŸã«ããä»ã®èª°ãã®èª²éã·ã¹ãã ããããŒã¿ãååŸããå¿ èŠããããšããäºå®ã«ã©ã®ããã«é©åããã®ã§ããããïŒããšãã質åãåãåããšæ³åããŠã¿ãŠãã ããã ãããŠã建ç¯å®¶ãé€ããŠèª°ãããããç¥ã£ãŠããŸãã ã¯ãããããèµ·ãããŸãã
ãã®æ±ºå®ãè¡ãããçç±ã説æããããšãéèŠã§ãããä»ã®æ±ºå®ã¯è¡ãããå©ç¹ã説æããæ¬ ç¹ã«ã€ããŠèšåããããšãéèŠã§ãã ãã®å Žåã人ã ã¯äœãèµ·ãã£ãŠããããç解ããã¯ããã«å¿è匷ããªããŸãã
確ãã«ããã®ãããªãæ°äž»äž»çŸ©ãã¯ãå€ãã®äººã ã«ãã£ãŠæ±ºå®ãäžããããšããç¬èªã®å¢çç·ãæã£ãŠããããšã«æ³šæãã¹ãã§ãã ããã«ããã®ãããªãæ°äž»çãªã決å®ãåžžã«å¯èœã§ãããšã¯éããŸããã ããšãã°ãè°è«ããããœãªã¥ãŒã·ã§ã³ã®ãããããæªãããšã誰ããç解ãã誰ãè¯ãããšãç¥ããªãå Žåã æçµçã«ã決å®ãééã£ãŠããããšãçªç¶å€æããå Žåãã¢ãŒããã¯ãããããæ åœããŸãã èšãèš³ã圌ãã¯èšããç§ã¯çã«å°ãããããã¯éåçãªæ±ºå®ã ã£ããæ®å¿µãªããããã¯åäœããŸããã ã¢ãŒããã¯ãã¯ããã®æ±ºå®æ¹æ³ã«é¢ä¿ãªãããã¹ãŠã®æ±ºå®ã«å¯ŸããŠå人çãªè²¬ä»»ãè² ããŸãã
æåŸã«ãããã«2ã€ã®èãã
ãŸããããªãã®ã¢ãŒããã¯ãã£ãè¯ããšæããªããããã¯ããªãããŸã 誰ã«ãèŠããŠããªãããšãæå³ããŸãã ãšããã§ãããã¯ã³ãŒãã«ãåœãŠã¯ãŸããŸãã
第äºã«ãç§ã¯ã¢ãŒããã¯ããä»ã®èª°ãã®é¡ããå®çŸããããšã®æå³ãç解ããããã«ãã¢ãŒããã¯ããå®çšçãªããã°ã©ãã³ã°çµéšãæã€ã¹ãã§ãããšããæèŠã®ã«ããŽãªãŒæ¯æè ã§ãã ããã«è¯ãããšã«ãã¢ãŒããã¯ãããããžã§ã¯ãã®å®è£ ã«çŽæ¥é¢äžããŠããå Žåãã€ãŸã ã³ãŒããäœæããããå°ãªããšããã®ã³ãŒãèªäœã¯ä¿®æ£äžã§ãã ã¢ãŒããã¯ãã¯ãã³ãŒããã¢ãŒããã¯ãã£äžã®æ±ºå®ãšäžèŽããŠããããšãå®æçã«ç¢ºèªããå¿ èŠããããŸãã
ç§ããã®ç¬éãå°ç¡ãã«ããŠãã¹ããªã³ãã¬ãã¥ãŒã§ã®ã¿ãããã°ã©ããŒãèšãããããã«ããªãããšãå¶ç¶èŠã€ããŸããã 質åã«å¯ŸããŠïŒè±èªã§é»ã§æžãããŠããããã€ãã³ãããéä¿¡ããŸãããªãhttpãªã¯ãšã¹ããéä¿¡ããã®ã§ããïŒ çããåãåã£ãïŒãŸããç§ã¯ãããè¯ããšæããŸããã åœç¶ããã¹ãŠãå¶åŸ¡ããããšã¯äžå¯èœã§ããããŒã ãä¿¡é Œããå¿ èŠããããŸãã ãããããã€ã人ãèšãããã«ãä¿¡é Œã¯è¯å¥œã§ãããã³ã³ãããŒã«ã¯åªããŠããŸãã
å€æŽå±¥æŽ
ããæ¥ãã¹ããŒããªèª°ããã顧客ãå¥çŽãçµäºããããå¥çŽãæŽæ°ããã«ç«¶åä»ç€Ÿã«è¡ãçç±ãç¥ãããã§ããããïŒ ããããè»ã奜ãã§ã¯ãªãã£ã/é ããã®ã§ããããïŒ ãããšããååãšäžç·ã«ä»¥åã«æ è¡ããç·æ§ãã競åä»ç€Ÿã«åãæ¿ããŠä»²éãåŒãä»ããã®ãããããŸããã
ãã®ãããªè³ªåã«çããã«ã¯ãã·ã¹ãã ã§äœãèµ·ãã£ãã®ããç¥ãå¿ èŠããããŸãã å€æŽå±¥æŽãå¿ èŠã§ãã
ãããè¡ãæ¹æ³ã«ã€ããŠã¯ã次ã®èšäºã§èª¬æããŸãã
ã€ã³ãã©ã¹ãã©ã¯ãã£ã®åé¡
ãã€ã¯ããµãŒãã¹ã¢ãŒããã¯ãã£ã¯ãã¢ããªã±ãŒã·ã§ã³å šäœã®ã€ã³ãã©ã¹ãã©ã¯ãã£ã«éåžžã«å ·äœçãªèŠä»¶ã課ããŠããŸããã€ãŸãã
- åäžã®ãšã³ããªãã€ã³ããå¥åGateway API
- ãµãŒãã¹ã®æ€çŽ¢ãå¥åãµãŒãã¹ãã£ã¹ã«ããªãŒ
- æ§æã®1ã€ã®ãã€ã³ããå¥åæ§æãµãŒãã¹
- ãã°ã®åéãšåæã®äžå¿ç¹
- ç£èŠ
- ... ...
次ã®ããŒãã§ãããã®è³ªåãšä»ã®è³ªåã