GoFã®23ã®ãã¶ã¤ã³ãã¿ã¼ã³ãï¼Javaã§æ´»ç¨ããããã®ä¸è¦§è¡¨ãï¼ãã¿ã¼ã³ãã¨ã®è¦ç´ã³ã¡ã³ãä»ãï¼
GoFãã¶ã¤ã³ãã¿ã¼ã³ã®ä¸è¦§è¡¨ã¨ï¼æ´»ç¨ã®ããã®ã³ã¡ã³ãï¼ããã³å ¥éè ãç¬å¦ããããã®ãªã³ã¯éï¼ãµã³ãã«ã³ã¼ãä»ãï¼ã
å ¥éè ã®ç¬å¦ãæ¯æ´ããããã«ï¼ãã®ãã¼ã¸ã®URLãæ示ãã¦çèªããï¼åãã¿ã¼ã³ãçæéã§å¹çããå¦ãã§ãããã
ãã¶ã¤ã³ãã¿ã¼ã³ã¯ããã°ã©ãã®å¸¸èã ã Java使ããã©ããã¯åããªãã
ã«ãé¢ãããï¼å ¥éæ¸ãè²·ã£ãã¾ã¾ï¼éä¸ã§æ«æãã人ãå¤ãã
æ«æã®åå ã¯ï¼ãã¿ã¼ã³ã®æ°ã23ããã£ã¦ï¼å¤ãããã ããã
å ¨ãã¿ã¼ã³ããããªãè¦ãã¦ãããããã«ã¯ï¼åãã¿ã¼ã³ãã¨ã«
- ãè¦ããã«ããããç®çã®ãã¿ã¼ã³ãªãã ãã
- ã10æåã§è¡¨ç¾ããã¨ï¼ãã¿ã¼ã³ã®æå³ã¯ãããªãã ãã
ã¨ããè¦ç¹ã»æ¬è³ªãï¼çãã³ã¡ã³ãã§ä¼ããã°å©ãã«ãªãã ããã
ãããã£ãå¦ç¿ãéãã¦ï¼Javaè¨èªã®ãè¨è¨ææ³ããä½µãã¦æãåã£ã¦ãããã¯ãã
å ¨ãã¿ã¼ã³ã®ä¸è¦§è¡¨ï¼è¦ç´ã³ã¡ã³ãä»ãï¼
å ¨ãã¿ã¼ã³ã«ã¤ãã¦ï¼10æå以å ã§ã®è¦ç´ã³ã¡ã³ããä»è¨ããä¸è¦§è¡¨ã
ã | ç¯å² | ||
---|---|---|---|
ã¯ã©ã¹ | ãªãã¸ã§ã¯ã | ||
ç® ç |
ç æ |
ã»Factory Methodï¼ ãåçã«ãµãã¯ã©ã¹é¸æ |
ã»Abstract Factoryï¼ å·¥å ´ã®å·¥å ´ ã»Builderï¼ åæåæé ãç´°åå ã»Prototypeï¼ ã³ãã¼ã渡ã ã»Singletonï¼ ï¼ã¤ã³ã¹ã¿ã³ã¹ãä¿è¨¼ |
æ§ é |
ã»ã¯ã©ã¹åãAdapterï¼ ãç¶æ¿ã§ã©ããã¼ |
ã»ãªãã¸ã§ã¯ãåãAdapterï¼ ãå§è²ã§ã©ããã¼ ã»Bridgeï¼ æ¡å¼µã¨å®è£ ã®é層åé¢ ã»Compositeï¼ å帰ããªã¼æ§é ã»Decoratorï¼ å§è²ã§æå³çãã㯠ã»Facadeï¼ è¤æ°ã¯ã©ã¹å©ç¨æé æ¸ ã»Flyweightï¼ ãã£ãã·ã¥ä»ã®å·¥å ´ ã»Proxyï¼ ãã£ãããã㯠|
|
æ¯ ã è ã |
ã»Interpreterï¼ ç¬èªè¨èªã®å®è¡ ã»Template Methodï¼ ãåãå¦çæçãå ·ä½å |
ã»Chain of Responsibilityï¼ ãå©ãè¹ãããã¯ã¼ã¯ ã»Commandï¼ ã¿ã¹ã¯ãã¥ã¼ã¨ã¹ã¿ã㯠ã»Iteratorï¼ ä¸¦ãã ç©ãé çªã«å¦ç ã»Mediatorï¼ ã¹ã¿ã¼ç¶ã®ç¸äºä½ç¨ ã»Mementoï¼ ç¶æ ã®ã²ãã¿ã¨ã»ãã¿ ã»Observerï¼ ã¤ãã³ããªã¹ã ã»Stateï¼ ç¶æ ãªãã¸ã§ã¯ã ã»Strategyï¼ ã¢ã«ã´ãªãºã åãæ¿ã ã»Visitorï¼ æ§é ã®ä¾¿å©ã¹ãã£ã |
â»ãã®è¡¨ããã³ã¡ã³ããé¤å»ãããã¼ã¸ã§ã³ãï¼æ¬ã¨ã³ããªæ«å°¾ã«ãããç¥èã®ãã¹ãã«å©ç¨ã§ããã
ãããã®ãã¿ã¼ã³ã«ã¤ãã¦ï¼ãè¦ããã«ã©ããããã¿ã¼ã³ãï¼ãã¨ããã®ãï¼é ã追ã£ã¦ãããããã解説ããã
ã¬ãã«å¥ã«åé¡ãã¦ç´¹ä»ãï¼23åå ¨é¨ãã«ãã¼ããã
- åãã¿ã¼ã³ã®ã·ã³ãã«ãªåé¡ã¨èª¬æ
- ï¼åé¡ï¼ï¼ ããã°ã©ãã³ã°ã®ã»ã³ã¹ãããã°ï¼è¨ãããªãã¦ãèªç¶ã«ä½¿ããã®ï¼
- ï¼åé¡ï¼ï¼ ãã¿ã¼ã³ã®ååèªä½ãæåã§ï¼ãã¡ãã¡ã§ä½¿ããã¦ãããã®ï¼
- ï¼åé¡ï¼ï¼ ç¬åã§æãã¤ãã®ã¯å°é£ã ãï¼ä¸åº¦ã¡ããã¨å¦ã¹ã°ï¼é©ãã»ã©ããã°ã©ãã³ã°ãéç¼ãããã®
- ï¼åé¡ï¼ï¼ ã¡ãªããããããã¥ããï¼ä½¿ããã¥ãããã®ï¼
åãã¿ã¼ã³ã®ã·ã³ãã«ãªåé¡ã¨èª¬æ
ãã¿ã¼ã³ã®èª¬æãï¼æ £ç¿ã«å£ã£ã¦ãAbstract Factoryãããå§ãã*1ã®ã¯ï¼ç¡çãããã
ãã£ã¨ããããããé çªãè²ã ãããããã§ã¯ï¼å ¥éããããé ã«æ²è¼ããã
ã¨ã³ããªã®å¾åã«ï¼ç¬å¦ç¨ã®ãªã³ã¯éãããããããè¦ãªããï¼
åãã¿ã¼ã³ã®ãæ¬è³ªãã¯ããããäºãï¼ã¨ç´å¾ããªããèªã¿é²ããã¨ããã
ï¼åé¡ï¼ï¼ããã°ã©ãã³ã°ã®ã»ã³ã¹ãããã°ï¼è¨ãããªãã¦ãèªç¶ã«ä½¿ããã®ï¼
ãã¿ã¼ã³ã¨ãã¦ãã¡ãã¡åãä¸ããå¿ è¦æ§ãèãã»ã©ã®ç©ã
éã«ããã ãï¼ãªãã¸ã§ã¯ãæåã®ããã°ã©ãã³ã°è¨èªã®å
¥éè
ã«ã¨ã£ã¦ã¯ãåç´ã®æ®µéã§å¿
é ã®ç¥èãã¨ããäºã«ãªãã
- Template Methodï¼ãåãå¦çæçãå
·ä½å
- Javaã§æ½è±¡ã¯ã©ã¹ãä½ãç®çãã®ãã®ãªã®ã§ï¼ä»ããè¨ããã¦ãï¼ã¨ãããã¿ã¼ã³ã
- ãããã£ã¦ï¼Javaè¨èªã§ã¯abstractãªã¯ã©ã¹ã¯ä½ã®ããã«ä½ããããã«ãªã£ã¦ãã®ãï¼ã¨ããç¹ããå¦ã¹ã°ï¼ä½ã®æµæããªããã®ãã¿ã¼ã³ãåãå ¥ããããã
- Builder : ãåæåæé ãç´°åå
- ãããã注æãä»ãã¦ããï¼æå¾ã«ãã«ã³ã¨ä¸çºãããããã¿ã¼ã³ã§ãããæçµçãªå¦çãã«ã¹ã¿ãã¤ãºããããã«ï¼äºåã«è¨å®ãå½ä»¤ãï¼åãã¤è¨ã渡ãäºãã§ãããã¿ã¼ã³ãã¨ãè¨ãããï¼åãã¤è¨ã渡ããã®ã§ï¼ãããã§ã³ã³ã¹ãã©ã¯ã¿å ã®åæåå¦çã«ä½ããããè©°ãè¾¼ã¾ãªãã§æ¸ãã
- å種è¨èªã®å種ã©ã¤ãã©ãªã¯ï¼ã¦ã¼ã¶ã«å¯¾ãã¦é¸æã®èªç±ãä¸ããããã«ï¼ãã®å½¢å¼ãé »ç¹ã«åã£ã¦ãããããããå±æ§ãè¨å®ããã¦ï¼æå¾ã«ç»é¢è¡¨ç¤ºã¨ãï¼ããããã
- ã¨ã¯ããï¼ãã®ãã¿ã¼ã³ã§ã¯Builderãç¹å®ã®ã¤ã³ã¿ãã§ã¼ã¹ãå®è£ ããäºã«ãªã£ã¦ããï¼Builderèªä½ã®äº¤æå¯è½æ§ãå¢ãã¦ããï¼ã¨ããç¹ããã¤ã³ãã
- Adapter : ãç¶æ¿ã§ã©ããã¼/å§è²ã§ã©ããã¼
- åãªãã©ããã¼ã¯ã©ã¹ã§ãããããã ãã ã¨ãã¿ã¼ã³ã¨è¨ãã¾ã§ããªãã®ã ãï¼ãã¤ã³ã¿ãã§ã¼ã¹ï¼ã·ã¹ãã å´ããã®è¦ãæ¹ï¼ã®å·®ãæ¿ããã¨ããè¦ç¹ã§è¦ã¦ã¿ãã¨ï¼ããããè¨åãããçç±ãå°ãã¯ç´å¾ã§ãããããããªãã
- ãã³ããæä¾ããæ¢åAPIã®åºæ¥ãæªãï¼ããããä½ãã·ã¹ãã ã¨ã®ç¸æ§ãæªãï¼ï¼å ±éã®ã¤ã³ã¿ãã§ã¼ã¹ãå®è£ ãã¦ããªãï¼ããªã®ã§ãã®ã¾ã¾ä½¿ããããªãã®ã ãï¼APIã®æ¹é ã¯ç¦æ¢ããã¦ããï¼ã¨ããããã®å ´åï¼èªåã好ããªããæ¹ã§ãããã®APIãå©ç¨ã§ããããã«ï¼ä¸æ®µãã¾ãã¦ã便å©ã¯ã©ã¹ããä½ãããã®ä¾¿å©ã¯ã©ã¹ã¯ï¼èªåãã¡ã®ã·ã¹ãã ã§ä½¿ããããå½¢å¼ã«ãªã£ã¦ããï¼ï¼å ±éã®ã¤ã³ã¿ãã§ã¼ã¹ãå®è£ ãã¦ããï¼ã
- ãªãã©ããã¼ã¯ã©ã¹ãä½ãã«ã¯ï¼å ã®ã¯ã©ã¹ãç¶æ¿ãã¦ã¯ã©ã¹åä½ã§wrapãããï¼å ã®ã¯ã©ã¹ã®ã¤ã³ã¹ã¿ã³ã¹ãã³ã³ãã¸ã·ã§ã³ã§ä¿æãã¦ãªãã¸ã§ã¯ãåä½ã§wrapãããï¼ã®ï¼ãã¿ã¼ã³ãããããªã®ã§ï¼Adapterãã¿ã¼ã³ã¯åæ²ã®ãããªãã¯ã¹ä¸ã®ï¼ãæã«ç¾ããã
- â»ä»å çãªãã¯ããã¯ã ãã»ã»ã»ï¼Adapterãã¿ã¼ã³ããã¾ã使ãã°ï¼éçºãã¼ã å ã®å¯¾äººé¢ä¿ãè¯ããªãï¼ã¨ããå¹ç¨ããããä½ã¹ãã«è ãæ» è¶è¦è¶ãªã³ã¼ããæ¸ããéï¼ãã®ã¯ã©ã¹ã®ã½ã¼ã¹ã³ã¼ãèªä½ã«æ¨ªããæãåºãã¦ä»ã®ã¡ã³ããæ¸ãå¤ãããã¨ããã¨ï¼æåã«ã³ã¼ãã£ã³ã°ããæ¹ã®ããã°ã©ãã¯ãå·ã¤ãããã¨æãããã®ã ããããé¿ããããã«ï¼ã©ããã¼ã¯ã©ã¹ãä¸æ®µãã¾ãã¦ï¼ã©ããã¼ã¯ã©ã¹å´ãå å®ããã¦é«å質ã«ããããã¨ã®ã¯ã©ã¹ã«ã¯æã触ããªãã§ï¼åä½è ã®å¦ç¿èª²é¡ã¨ãã¦ä¿çã«ãã¦ãããããããã°ï¼ã¬ãã«ã«ã®ã£ããããã£ã¦ãä½å質ãªã³ã¼ãã®å½±é¿ãæå°éã«ã¨ã©ãï¼éçºå·¥ç¨ã®å質ä¿æã¨å¹³åãªãã¼ã ã®ç¶æãå¯è½ã«ãªããAdapterã¯ï¼ä½å質ã¾ãç²æªãªã³ã¼ãããã·ã¹ãã ãå®ãããã®ãé²æ³¢å ¤ãã®ãããªå½¹å²ãããã®ã ã
- Strategyï¼ãã¢ã«ã´ãªãºã åãæ¿ã
- ã¢ã«ã´ãªãºã å®è£ ã®ããã®å°ç¨ãªãã¸ã§ã¯ããè¤æ°ä½ã£ã¦ããï¼ãã®ä¸ãã使ããã®ã ããåçã«é¸ãã§å®è¡ããã
- ããç¨åº¦è¤éãªã¢ã«ã´ãªãºã ã«ãªãã¨ï¼ãµã¤ãã®ããã°ã©ãã§ããã°ï¼ãã®é¨åãåãåºãã¦éç´ããã ãããã¾ãï¼ä»ã®ã¢ã«ã´ãªãºã ã«ç½®ãå¤ãã£ãæã«åãã¦ï¼äºææ§ãæããã¦ããã ããããªã®ã§ï¼ãã¾ãæ°è¦æ§ãæããªããã¿ã¼ã³ã«æãããããããªããã¨ã¯ããï¼ã¢ã«ã´ãªãºã ã®äº¤æå¯è½æ§ãå¢ãããã«ï¼å ±éã®åºåºï¼ã¾ãã¯å ±éã®ã¤ã³ã¿ãã§ã¼ã¹ï¼ãæããã¦ããã¨ããç¹ã¯æ³¨ç®ã
- ãç¶æ³ã«å¿ãã¦ããæ¹ãæè»ã«å¤ããããã¨ããæå³ã§ã¯ï¼Stateãã¿ã¼ã³ã¨é¡ä¼¼ããªããã¤ï¼Stateã®ã»ããå¦ç¿ä¸ã¯éè¦ã
- Decorator :ãå§è²ã§æå³çããã¯
- æä½å¯¾è±¡ã«ããããªãã¸ã§ã¯ããã³ã³ãã¸ã·ã§ã³ã§ä¿æãï¼ããã¤ã«ããããæä½ãå ããï¼Decorateããï¼ã
- ã³ã³ãã¸ã·ã§ã³ã使ã£ã¦ããã°ãã¤ã®éã«ããããªã£ã¦ããã¯ãããããDecoratorï¼ã¨æèããªãã使ãç¨ã®ãã®ã§ãªããProxyãã¿ã¼ã³ã¨é ·ä¼¼ã
- ã³ã¼ãã®è¦ããä¸ï¼Decoratorã¯Decorateeãå¼æ°ã«åããªã©ãã¦å¤å´ãããããã¤ã¾ãï¼å å´ã®Decorateeãè¡ãªãã¡ã¤ã³å¦çãï¼å¤å´ããDecoratorãä½ãããã¯ãã¦ããã®ããªï¼ã¨ããæ¨å¯ãå¯è½ãï¼ããããã¯ãï¼ããã§ç¹ã«Decoratorã¨ããååãæã¡ãããããã§ã¯ãªããï¼
- ããã¦ä¿æããå´ã¨ä¿æãããå´ãåä¸ã®ã¤ã³ã¿ãã§ã¼ã¹ãæã£ã¦ããã®ã§ï¼Decorateããã¦ãç©ã¨ããã¦ãªãç©ãåä¸è¦ã§ãããããã¯ã®ããã£ãç©ã¨ï¼ããã¯ãããªãã£ãç©ã¨ãå ±éé ã¨ãã¦åãæ±ããããã ã
- Facade :ãè¤æ°ã¯ã©ã¹å©ç¨æé æ¸
- è¤æ°ã®ã¯ã©ã¹ãå¼ã³åºãéï¼å¼ã³åºãé çªãæãåºããªãã¦ããããã«ï¼å®ç³ã¨ãã¦ï¼ã¡ã½ããå ã«éç´ãã¦ããããã®ã¡ã½ããã¯ï¼ããã°è¤æ°ã®ã¯ã©ã¹ã®å©ç¨æé æ¸ã«ãªãã
- åå©ç¨ããããAPIãDSLãä½ããã¨ããå ´åï¼èªç¶ã«çã¾ããçºæ³ãä½ã¬ã¤ã¤ã®ã³ã¼ããããããªãã¦æ¸ãããï¼ã²ã¨ã¾ã¨ã¾ãã®æé ã¨ãã¦ã¾ã¨ãã¦ããã®ã§ãããããããã°ï¼ããé«ã¬ã¤ã¤ã®ã³ã¼ãã«ç¥çµãéä¸ã§ããï¼Write less, Do moreï¼ãéã«ããèªç¶ã«ãããªããªãã¨ãããï¼ããã°ã©ãã³ã°ã®ã»ã³ã¹ãå¾®å¦ãããããªãã
- ãªãfacadeãã¿ã¼ã³ã«ã¯ï¼ããã¤ãåãçªå£ãééããããã¨ã«ããï¼å ±éå¦çãå ¨ä½ã«åãè¾¼ã¿ãããããããã¨ãã使ãæ¹ããããè¤æ°ã¯ã©ã¹ã¸ã®åå²å°ç¹ã¨ãã¦facadeã¯ã©ã¹ãè¨ç½®ãï¼ãã®åå²å°ç¹ã®ä¸ã«ãã°åºåãªã©ã®å ±éå¦çãåãè¾¼ãã°ï¼ä»ã®åå¥ã®ã¯ã©ã¹ã«ã¯æãå ããªãã¦æ¸ãã
- Mediator : ãã¹ã¿ã¼ç¶ã®ç¸äºä½ç¨
- 網ç®ç¶ã®è¤éãªç¸äºä½ç¨ã§ã¯ãªãï¼ä¸å¤®ã«ã³ã³ããã¼ã«ãéç´ãããã¹ã¿ã¼ç¶ã®çµåããä»ãã¦ï¼ãªãã¸ã§ã¯ãå士ãç¸äºä½ç¨ãããä¸å¤®ã«ããã®ã¯ï¼ç®¡çè ãªãã¸ã§ã¯ãã®ãããªãã®ã
- ããUIãè¤éã§ï¼ããããã®é¨åãæã£ã¦ãã¦ï¼åé¨åãã¨ã«å¶ç´ãã¤ãã³ããããããåå¨ãï¼ãããã®æ¡ä»¶åå²ã大å¤ã»ã»ã»ã¨ãããããªæã«ï¼ç´ 人ã¯ãã£ã¡ãã£ã¡ã«ã¤ãã³ããåãè¾¼ããããã¦å ¨ä½ã¨ãã¦ä½ããã£ã¦ããã³ã¼ããªã®ãåãããªããªãï¼ãã®ãã¡ã¡ã³ãã§ããªããªãï¼æ´åæ§ãæãªãããããã«ãªãããããã£ãæ» è¶è¦è¶ã«åæ£ããã³ã¼ãã«ä»ãåããããã®ãã©ãã»ã©å¤§å¤ãªäºãï¼çµé¨è ã¯ãã®è¦å´ãèªãäºãã§ããã
- ããã°ã©ãã³ã°ã®ã»ã³ã¹ããã人éã¯ï¼ããããå®è£ ã¯ããªãããã®UIã¯ããç¨åº¦è¤éã ãªï¼ã¨æã¥ãããï¼ãã®UIå°ç¨ã®ããã¼ã¸ã£ã¯ã©ã¹ãç«ã¦ã¦ï¼åUIé¨åã¯ãã®ããã¼ã¸ã£ã¯ã©ã¹ã«å¯¾ãã¦éä¿¡ããã ãã«ãããããã¦ï¼ããã¼ã¸ã£ã¯ã©ã¹ã¯èªåã®ãã¨ã«éç´ãããæ å ±ããã¨ã«ãã¦ï¼UIå ¨ä½ã調æ´ããå½¹å²ãæããã誰ã«ãè¨ãããªãã¦ãï¼ããããããã°ã©ãã³ã°ã»ã¹ã¿ã¤ã«ãé¸æãããã¨èªç¶ã«æãç«ã¤ãã©ããã§ï¼ããã°ã©ãã³ã°ã®ã»ã³ã¹ãåãããäºã«ãªãã
- ããããããã§ï¼Mediatorãã¿ã¼ã³ã¯ãè¤éãªUIããå®è£ ããéã«ãã使ãããã ãï¼ãã®ãã¿ã¼ã³ã¯ãä¸å¤®é権çããªçºæ³ã§ããï¼ä½ãã«ãè¤éãããUIã«ãªã£ã¦ããã¨ä¸å¤®ã§ç®¡çããããªããªã£ã¦ï¼éçããããããããå ´åã¯ï¼å¾è¿°ããChain of Responsibilityãã¿ã¼ã³ã§ï¼ä¸å¤®éç´ã§ã¯ãªãåæ£æ§é /ãããªã³ã°ã®çºæ³ã«åãæ¿ããã
ï¼åé¡ï¼ï¼ãã¿ã¼ã³ã®ååèªä½ãæåã§ï¼ãã¡ãã¡ã§ä½¿ããã¦ãããã®ï¼
å種ãã¼ã«ã»ã©ã¤ãã©ãªã使ã£ãçµé¨ããã£ããï¼æ¥åçµé¨ãå°ãç©ãã ãï¼ããããããã°ã©ãã³ã°ããã£ã¦ããã°ï¼ãããç®ã«ããååã®ãã¿ã¼ã³ã
è¦ãäºããªãã¨ãããï¼çµé¨èªä½ãå°ãªãã¨ããäºã«ãªããããããªãã
- Factory Methodï¼ãåçã«ãµãã¯ã©ã¹é¸æ
- ãµãã¯ã©ã¹ã®ä¸ããé¸æããæåãï¼åçã«å¤ãããå ´åã«ã
- Javaã®å種ãã¬ã¼ã ã¯ã¼ã¯ä¸ã§DBæä½ãã¦ããã°ï¼ãããç®ã«ããååãConnectionç³»ã®Factoryã¨ãã
- ã¯ã©ã¹åä½ã§Factoryã§ã¯ãªãã¨ãã¦ãï¼ã¡ã½ããåä½ã§Factoryã«ãªã£ã¦ããã±ã¼ã¹ãå¤ããnewãã¼ã¯ã¼ããé ãºããã¦ä½ãã®ã¤ã³ã¹ã¿ã³ã¹ãåçã«çæãã¦è¿ãã¦ãããï¼ãã®ã¡ã½ããã¯ãã¡ã¯ããªã»ã¡ã½ããã¨å¼ã°ãããã
- ã¯ã©ã¹è¨è¨ã®æ¦ç¥ãFactoryã§ããå ´åï¼ãããä½ãã®ã¯ãã¿ã§åä¸ç®æã«Genericsãå°å ¥ãããã¨ããã¨ï¼ããã¸ãæ²æ¨ãªçµæã«ãªããFactoryã¯æ§è³ªã®ç°ãªãåã¯ã©ã¹ãå¢ããæ¹éãªããã ãï¼ã¸ã§ããªã¯ã¹ã¯ãã®çéã§ããï¼ããããããã¯ã©ã¹ãåãã©ã¡ã¼ã¿ã§ï¼ã¤ã«çµ±ä¸ãããã¨ããããªã®ã§ï¼ãã®ï¼ã¤ã®æ¹éãã¶ã¤ããããã¨ï¼ã©ããã§ä¸æã«ã³ã¼ãã®çç¾ãçããããã®çç¾ã«æ°ã¥ãã®ã¯ï¼Factoryã¯ã©ã¹ã«åãã©ã¡ã¼ã¿ãå ¥ãè¾¼ããã¨ããç¬éã§ããããããï¼ã¯ã©ã¹ãåãããã¨ãã¦ããã ã£ãï¼ããã¨ãçµ±ä¸ãããã¨ãã¦ããã ã£ãï¼ãã¨ããçåã§æãæ¢ã¾ãï¼ãã°ããèããå¾ï¼Factoryã¨ã¸ã§ããªã¯ã¹ã両ç«ããããã¨ãã¦ããèªåã®æããã«æ°ã¥ãã®ã ããããªç®ã«éããªãããã«ã¯ï¼Factoryçãå§ãã¨ãããããªã¢ã¼ãã£ãºã ããã«ã«çããã¦ééçã«æ±ããã¨ããè¨è¨ãã¿ã¼ã³ã¨ï¼ãåãã©ã¡ã¼ã¿ã§æ½è±¡åãã¦ééçã«æ±ããã¨ããè¨è¨æ¦ç¥ã¨ãï¼ã»ã¼å¯¾æ¥µã«ä½ç½®ããããç¸æ§ãæªããã¨ããç¹ãè¦ãã¦ãããæ¹ãããã
- Singleton : ãï¼ã¤ã³ã¹ã¿ã³ã¹ãä¿è¨¼
- ããã°ã©ãã³ã°è¨èªã«ãã£ã¦ã¯ï¼ãããå®ç¾ããããã®ã©ã¤ãã©ãªãè¨èªã«çµã¿è¾¼ã¿æ¸ã¿ãªã±ã¼ã¹ãå¤ãããªã®ã§ç¥å度ã¯é«ãã
- ã·ã³ã°ã«ãã³ã«ã¯è½ã¨ãç©´ãçµæ§ããã®ã§ï¼ããããã£ã¦ãã人ãªãï¼ãã®ãã¿ã¼ã³ã®å©ç¨ãé¿ããã±ã¼ã¹ãå¤ãã¨æããä¾ãã°ã°ãã¼ãã«å¤æ°åé¡ã¯è¨ãããããªãããã«ä¾ãæããã¨ï¼Webã¢ããªã¯è¤æ°ã®ãªã¯ã¨ã¹ããåæã«è¤æ°ã¹ã¬ããã§åãä»ããããã ãï¼ã¹ã¬ããã¨ããæ çµã¿ãè¶ ãã¦ï¼è¤æ°ããã»ã¹ã§Webãµã¼ãã®ããã»ã¹ãèµ°ã£ã¦ããã¨ããã·ãã¥ã¨ã¼ã·ã§ã³ãä¸è¬çã§ããï¼Apache/httpdã¨ãï¼ããã®å ´åï¼ããã»ã¹éã§ã¯ã¡ã¢ãªç©ºéãç°ãªããããªãã¸ã§ã¯ãã¯å ±æãããªãã®ã§ï¼é å¼µã£ã¦ã·ã³ã°ã«ãã³ãä½ã£ãã®ã«æ¬çªç°å¢ã§ã¯å ¨ãç¡æå³ã§ãããªãã¦ãããã«ãçãããªããããã¯ï¼æ´è½ã«ãªããªãã¬ãã«ã®ãã¡ã¼ã¸ãçãè¨è¨ãã¹ã§ãããããããæï¼å¨ãã®ã¡ã³ããããã£ï¼ããã¤Singleton使ããã¨ãã¦ãã®ããâ¦ï¼ãã¨æã¥ãï¼å¿ æ»ã§æ¢ãã«å ¥ãï¼åºæ¬è¨è¨ããåèããããã«èª¬å¾ãããããã説å¾ã®éã«ï¼ã¡ã¢ãªç©ºéã¨ããµã¼ãããã»ã¹ã«é¢ããç¥èãç¸æã«æ¬ ãã¦ããã¨ï¼ãªããã¡ãªã®ã説æã«è¦å´ããç¾½ç®ã«ãªããã¨ããå ·åã«ï¼åå¯éãæãåºãã¨å¤§ç«å·ãããã¿ã¼ã³ã
- Observerï¼ãã¤ãã³ããªã¹ã
- Observerã¨ããååã§ã¯ãªãï¼Listenerã¨ããå½¢ã§ï¼ç¥ããªããã¡ã«ä½¿ãããã§ããã¯ãã
- ãã¤ãã³ããªã¹ããã¨ããå½¢ã§ï¼åçãªUIãæ¸ããäºããã人ã«ã¯é¦´æã¿ã®ããæ¦å¿µã®ã¯ããç£è¦å¯¾è±¡ã«ã¤ãã³ã観å¯è ãåãè¾¼ãã§ï¼ã¤ãã³ããèµ·ããæã«ä½ãããããJavaScript使ããªããã«ã¯å³éããã
- ãã ãJavaè¨èªã«ã¯ã¯ãã¼ã¸ã£ããªãã®ã§ï¼ã¤ãã³ããã³ãã©ã¯ââListenerã¯ã©ã¹ã¿ãããªå½¢ã§è¨è¿°ããå¿ è¦ãçããããããåé·ã ãï¼Javaè¨èªã¨ãããã©ãããã©ã¼ã ã使ã以ä¸ã¯ãããããªãã妥åç¹ã§ããã
- Proxyï¼ããã£ããããã¯
- ãããã·ã»ãµã¼ãï¼ã¾ãã¯ãªãã¼ã¹ãããã·ï¼ã¨ããç©ã®åå¨ã®ããã«ï¼ååã ãã¯ç¥ããã¦ãããã¿ã¼ã³ãä¸ç¶ããã¤ã¡ã¼ã¸ãå ±éã
- ã¡ã¤ã³ãªå¦çããããªãã¸ã§ã¯ããã³ã³ãã¸ã·ã§ã³ã§ä¿æãï¼ã¡ã¤ã³ãªå¦çã®åå¾ã«ããã¯ããã¾ããããããï¼ä¿æ対象ã¨ä¿æè ã§å ±éã®ã¤ã³ã¿ãã§ã¼ã¹ãæã£ã¦ããããã«ï¼ç¸äºã®å ¥ãæ¿ããããã¨ããç¹ã¯ï¼Decoratorãã¿ã¼ã³ã¨å ¨ãåãã
- Decoratorã¯æå³çæ示çã«ããã¯ãã¦ãããï¼Proxyã®å ´åã¯å½±ã§ï¼é ãã¦ï¼ããããã¨ããã¯ãã¦ããç¹ãç°ãªããã¯ã©ã¹ã使ãå´ã¯ï¼Decoratorãã¿ã¼ã³ã®å ´åã¯ï¼å¼ã³åºãå´ã¯æå³çã«Decorateå¦çã®ã³ã¼ããæ¸ãããããProxyã®å ´åã¯ï¼å¼ã³åºãå´ã¯ãä¿æ対象ãã¨ãä¿æè ãã®ã©ã¡ãã使ã£ã¦ããã®ãæèããªãããããã¯ï¼æ°ã¥ããªãã
- å¦çã«ããããã¨ããã¯ããï¼ã¨ããã®ã®å ·ä½ä¾ã¯ï¼ä¾ãã°ããããã«ã¤ãªãã£ã¦ããã¨æã£ã¦ããï¼å®ã¯éã£ã¦ã¦ï¼éã«æã¾ã£ã¦ãããããã·ãµã¼ãããã£ãã·ã¥ãæãã¦ãã ãã ã£ããã¨ããã¡ã¤ã³å¦çããããªãã¸ã§ã¯ãã¨å¼ã³åºãå ã®éã«ï¼ãã£ããã¨å£ãä½ãï¼ä»²ä»è ãããã¯çè´è ãç½®ãï¼äºãã§ããã®ã ã
- å¥ã®ãªãã¸ã§ã¯ãã¸ã®ä¸ç¶å°ç¹ã¨ãªã£ã¦æ¬æ¥ã®å¦çãé ãºããã¦ããã¡ã½ããã¯ï¼ãããã·ã»ã¡ã½ãããªã©ã¨å¼ã°ãããå¼ã³åºãå ã¯å¥ã®ãªãã¸ã§ã¯ããªã®ã§ï¼ããã¯åãªãã«ãã»ã«åã¨ã¯ç°ãªãã
- Iteratorï¼ã並ãã ç©ãé çªã«å¦ç
- Javaè¨èªã«ãããããçµã¿è¾¼ã¾ãã¦ããªãäºãä¸æè°ã§ï¼ããã¯Javaè¨èªã®ä»æ§ã®ãã°ãªããããªããï¼ã¨æãããã»ã©ï¼ãã£ã¦å½ããåã®ããã°ã©ãã³ã°ã»ãã¯ããã¯ãè¨èªã«ãã£ã¦ã¯æ¨æºAPIã¨ãã¦æä¾ãããã
- ãè¤æ°ã®ãã®ãé çªã«ä¸¦ãã§ãã¦ï¼åãåºããããã«ãªã£ã¦ãããã¨ããï¼éåä½ï¼ã¾ãã¯é åï¼ã¿ãããªãªãã¸ã§ã¯ããããã¨ããããã®ãé çªã«åãåºãã¦å¦çããã®ã¯ï¼ãã®ãªãã¸ã§ã¯ãèªèº«ã®è²¬ä»»ã§ããããã®ãªãã¸ã§ã¯ããå¼ã³åºãå¤é¨ãªãã¸ã§ã¯ãã®è²¬ä»»ã§ã¯ãªãã¯ãã ããã£ã¦ï¼ãèªåï¼é åã£ã½ããªãã¸ã§ã¯ãï¼ãæ±ãã¦ããè¦ç´ éã®é¢åãï¼èªåèªèº«ãè¦ã¦ããããã¹ãããããIteratorã
- ãããã£ã¦ï¼Javaã¯ç´ç²ãªãªãã¸ã§ã¯ãæåã®è¨èªã§ã¯ãªãããªãã¸ã§ã¯ãæåã§ã¯ãªãï¼ã¢ã»ã³ãã©ããã¤ã³ã¿ã¨ãã£ãä½ã¬ã¤ã¤ã®èãæ¹ã好ãCè¨èªã¦ã¼ã¶ãJavaã¦ã¼ã¶ã«å¼ã³è¾¼ãã§ï¼Javaã®ã·ã§ã¢ãæ¡å¤§ããããã«ã¯ï¼Sunã¯ãããããããªãã£ãã®ã ãforã«ã¼ãå ã§ã«ã¦ã³ã¿å¤æ°ãã¤ã³ã¯ãªã¡ã³ãããªããä¸ã¤ä¸ã¤åãåºãï¼ã¨ããï¼Cè¨èªã¦ã¼ã¶ã«ã¨ã£ã¦ãªãã¿æ·±ãæ¸å¼ãæ¡ç¨ãããããªãã£ãã®ã§ãããæ¡å¼µforã«ã¼ãã¨è¨ãã©ï¼ã¯ã©ã¹æ§é ã®è¦³ç¹ã§è¨ãã°åããã¨ãã¤ã¾ãï¼ãã¼ã±ãã£ã³ã°ä¸ã®äºæ ã«ããï¼Javaã¯ãªãã¸ã§ã¯ãæåã®è¨èªã«ãªãäºãã§ããªãã£ãããã®æ´å²çãªçµç·¯ã¯ï¼ä¸è¨ã®æ¸ç±ãªã©ã§ãææããã¦ããï¼Javaãã¡ããã¨ä½¿ã£ã¦ãã人ãªãçãæ¢ã«ããç¥ã£ã¦ããç¹ã ã
ãªã©ã¤ãªã¼ï¼ããããã¯ãã£ãã»ããã°ã©ããï¼Neal Fordèã
- ã»ã¯ã·ã§ã³14.1.2ãJavaã®æé»é¢ãp212ã213ããã¤ã³ã¿ãå¤ç¨ãããCè¨èªã¨ã®å¾æ¹äºææ§ã«é æ ®ãããããã§ï¼CãC++ããJavaã¸ã®ç§»è¡ã楽ã«ãªã£ããï¼Javaã¯ãªãã¸ã§ã¯ãæåã§ãã¤ã³ã¿ããªãã«ãé¢ããï¼
- ã»ã¯ã·ã§ã³10.2ããªãã«ã ã®ãã¿ããï¼å¿ è¦ä»¥ä¸ã®è¤éãã«ã¤ãã¦ï¼ãp172ãJavaããã³C#ã¨ããè¨èªãä½ãããç®çã«ã¤ãã¦ã
- ã»ã¯ã·ã§ã³12.4ãã¡ã¿ããã°ã©ãã³ã°ãp195ãè¨èªã«å¶éãå¤ãäºã«ãã£ã¦ï¼ããã°ã©ãã¯åã奪ãããã®ã¿ã
Javaã®ä¸ç´è ãªãï¼Javaã®é·æã ãã§ãªãï¼æ¬ ç¹ã«ã¤ãã¦ãããç¥ã£ã¦ããã¯ããªã®ã§ï¼å½¼ãã«å°ãã¦ã¿ãã¨ããã
â»éã«ä¸ãä¸ï¼ãããã£ãJavaã®æ¬ ç¹ãããããè¨ããªãã¨ãããï¼ãã®ããã°ã©ãã¯Javaãåå使ã£ã¦ããªãï¼ãããã¯ï¼Javaããç¥ããªãã®ã§Javaã§éããçºæ³æ³ããæã£ã¦ããªãï¼ã¨ãããã¨ã«ãªãã
ããã¯Javaã«éããï¼ä½ããç¿å¾ããéã«ã¯ï¼å ¨ã¦ã®äºã«å½ã¦ã¯ã¾ãã
-
- ã¡ãªã¿ã«Rubyã®ãããªç´ç²ãªãªãã¸ã§ã¯ãæåã®è¨èªã§ããã°ï¼ã¢ãã«å±¤ã®è¨è¿°ã¯ã¤ãã¬ã¼ã¿ï¼eachç³»ã®ã¡ã½ããï¼å°½ããã®ã¡ã½ãããã§ã¤ã³ã«ãªã£ãããããfindãã¦mapãã¦selectãã¦mapãã¦rejectãã¦uniqãã¦concatãã¦joinï¼ã¾ãã¯injectï¼ã¨ãï¼æ¥µãã¦çç£çãã¤ãæã£ãéãã«æ¸ãã°æã£ãéãã«åãããå®æãããæè¿ã®ããã°ã©ãã³ã°è¨èªã§ã¯ï¼åæããããã¼ã¿ã®å¦çãè¨è¿°ããéã«ã¯ããããã¹ã¿ã¤ã«ãã ãããå¯è½ã«ãªã£ã¦ãããJavaã§ã¯ããã¨åãäºãã§ããªãã®ã§ï¼è¨è¿°ãé常ã«åé·ã«ãªãããªãJavaã§å®ç¾ä¸å¯è½ãªã®ãï¼ãçªãè©°ããã¨ï¼çµå±ãã¯ãã¼ã¸ã£ï¼ã©ã ãã¾ãã¯ãããã¯ï¼ãå®ç¾©ã§ããªããããã¾ãããªã¼ãã³ã¯ã©ã¹ã§ã¯ãªããããã¨ããè¨èªä»æ§ã®é£ç¹ã«å°½ãããJDK8ããå ã®ååãã¦ã©ãããã¹ãã
- ããä»å¾ï¼JDKãã ããããªãï¼JVMãã©ãããã©ã¼ã ä¸ã§åãçç£çãªåçè¨èªï¼Groovyã¨ãJRubyçï¼ãã¦ã©ãããã¹ããä¸éã§ããè¨ãããããã«ï¼Javaã¯ãç¾ä»£ã®COBOLãã§ãã£ã¦ï¼COBOLã¨åæ§ã«ããææã«ã¯é常ã«æç¨ãã¤ã¡ã¸ã£ã¼ãªåæ¥çãã¼ã«ã§ã¯ãããã®ã®ï¼ä½äºãã¿ã¤ã ã»ãªãããä»ããªã®ã§ï¼ãå ã ãããè¦è¶ããä¸ã§ã¹ãã«ã»ãã¼ããã©ãªãªãèããªãã¨ï¼ã¨ã³ã¸ãã¢ã¨ãã¦åç³åãã¦ãã¾ãã¾ããããã¨ããè¦åã«çæããªããæè¡ååã«ãã£ããã¢ãããã¦ããã°å®å ¨ã¨ããäºã«ãªããæç¶ãåè¨èªãããªãã¸ã§ã¯ãæåã¸ã®ãã©ãã¤ã ã»ã·ãããèµ·ãã£ãæã®ããã«ï¼ç¾æç¹ã§ãæ¢ã«ãã¸ãã¹è¦æ±ã®å¤åãå éãã¦ããï¼è¦ããã«æ代ã®å¤åã®ã¹ãã¼ããã©ãã©ãéããªãï¼ï¼éçè¨èªããã®ãæ代ã®ã¹ãã¼ããã®è¦æ±ã«ãã¤ã¾ã§èãã¦æã¡ãããããããï¼è¦ãã®ã§ãããããã¾ã§ã®éã¯Javaã使ãã¾ãããã
ï¼åé¡ï¼ï¼ç¬åã§æãã¤ãã®ã¯å°é£ã ãï¼ä¸åº¦ã¡ããã¨å¦ã¹ã°ï¼é©ãã»ã©ããã°ã©ãã³ã°ãéç¼ãããã®
ãã®ã¬ãã«ã®ç¿å¾ãåããç®ã
èªåã§æãã¤ãç¯å²å ã§è¨è¨ãç¶ãã¦ããã¨ï¼ããã«ã¯å°éã§ããªãã
ãããã®ãã¿ã¼ã³ã§ã¯ï¼å¡äººã®çºæ³ã§ã¯æãããããªãã£ããããªå¯¾è±¡ç©/æ§é ããªãã¸ã§ã¯ãåããã
ãªã®ã§ï¼ãªãã¸ã§ã¯ãæåè¨è¨ã®é«ã¿ãç®æãå ´åï¼ãã®ã¹ãããã¯ãããã¦æåãªè¸ã¿å°ã«ãªãå¾ãã®ã ã
ã¡ããã©ãORãããã³ã°ï¼Objectã¨RDBä¸ã®ãªã¬ã¼ã·ã§ã³ããããã³ã°ï¼ãã®ããã«ï¼ãObject-ââãããã³ã°ãã¨ããè¦ç¹ãããã¨ï¼ç解ãæ©ãã
ããã®ãã¿ã¼ã³ã®å ´åï¼ââã®é¨åã«ã¯ä½ãå
¥ããã ããï¼ä½ããªãã¸ã§ã¯ãåããã¦ãããã ããï¼ãã¨ã
- Stateï¼ãç¶æ
ãªãã¸ã§ã¯ã
- ã·ã¹ãã éçºã®å ¨å·¥ç¨ãéãã¦ï¼ãç¶æ é·ç§»å³ãã¯é常ã«éè¦ãªå½¹å²ãæãããããã¯è©³ç´°è¨è¨ãã§ã¼ãºã®ææç©ã§ããï¼ä»æ§å¤æ´ã«ä¼´ãå¤æ´ããããããåä½è©¦é¨ãçµå試é¨ã¾ã§ï¼ãã¹ãã±ã¼ã¹ã®æ´ãåºãã®ããã«ã極ãã¦éå®ãããã·ã¹ãã éç¨ãã§ã¼ãºã§ã¯ï¼é害çºçæã«ã·ã¹ãã ãµãã¼ãå´ãããã£ã¡ã ãè¦ç´ãå³ã¨ãªããã·ã¹ãã ä¸ã§ãã®é¨åã¯ï¼èæ ®æ¼ããã°ã¨ãä¸æ´åãçºçããããç®æã ããã ã
- Stateãã¿ã¼ã³ã¯ï¼åã ã®ç¶æ ã表ãããã®å°ç¨ãªãã¸ã§ã¯ããä½ãããªã®ã§ï¼ç¶æ é·ç§»å³ãã¼ã¹ã®ãã¤ã¬ã¯ããªã³ã¼ãã£ã³ã°ãå¯è½ã«ãªããããã°ï¼Object-ç¶æ é·ç§»å³ãããã³ã°ã§ãããããããçµç·¯ãããï¼Strategyãªããã¨æ¯ã¹ãã¨ã¯ããã«ï¼ã·ã¹ãã è¨è¨ã®è¦³ç¹ãããã¦æã¾ãããã¿ã¼ã³ã
- Commandï¼ãã¿ã¹ã¯ãã¥ã¼ã¨ã¹ã¿ãã¯
- Stateã§ã¯ï¼ç¶æ ï¼ï¼ãªãã¸ã§ã¯ãã ã£ããï¼Commandã§ã¯ï¼ã¿ã¹ã¯ï¼ï¼ãªãã¸ã§ã¯ãã¨ãªããã¿ã¹ã¯ï¼ã¾ãã¯ã¤ãã³ãï¼ãï¼ï¼ã¤ã®ã¯ã©ã¹å ã«ã«ãã»ã«åããããããããã¿ã¹ã¯ãä½ç¨®é¡ãããï¼å ±éã®ã¤ã³ã¿ãã§ã¼ã¹ãå®è£ ãã¦ããã®ã§ï¼è¤æ°ã®ã¿ã¹ã¯ãå種ã®ãã®ã¨ãã¦ã¾ã¨ãã¦åãæ±ã£ã¦ç®¡çã§ãããè¦ã¯ï¼ã¿ã¹ã¯ããã¼ã¸ã£ã£ã½ããã®ãå®ç¾ã§ããï¼â»Windowsã®æåã©ããã®ãã¿ã¹ã¯ããã¼ã¸ã£ãã¨ã¯ã¤ã¡ã¼ã¸ãç°ãªããï¼Object-ã¿ã¹ã¯ã»ãããã³ã°ã
- è¤æ°ã®ã¿ã¹ã¯ãä¿ç®¡ããéã«ï¼çµãã£ãã¿ã¹ã¯ãã¹ã¿ãã¯æ§é ã§ä¿æããã°ï¼ãä½æ¥å±¥æ´ãã¨ãã¦åç §å¯è½ã«ãªããã¾ãï¼ã¹ã¿ãã¯ã®å±¥æ´å 容ã«å¯¾ãã¦pushãpopããã°ï¼ç´è¿ã¿ã¹ã¯ã®ãã¢ã³ãã¥ããããªãã¥ããå¯è½ã«ãªãã
- éã«ï¼å¦çå¾ ã¡ã®ã¿ã¹ã¯ã¯ãã¥ã¼æ§é ã§ä¿æãããåã¿ã¹ã¯ï¼Commandãªãã¸ã§ã¯ãï¼ãï¼èªåèªèº«ã®ã¿ã¹ã¯å®éã®ããã«å¿ è¦ãªãªã½ã¼ã¹ã®è¦ç©ããæ å ±ãä¿æãã¦ããã°ï¼è¤æ°ã®ã¿ã¹ã¯ã®å®è¡éç¨ã«ããã¦ãæ®ãæè¦æéãã¨ããç®åºããäºãå¯è½ã«ãªããã¤ã¾ãã¯ï¼ããã°ã¬ã¹ãã¼ã
- ããããããã§ï¼ã¤ã³ã¹ãã¼ã©ã®ããã°ã¬ã¹ãã¼ã¨ãï¼ã¢ã³ãã¥ã»ãªãã¥ã¯ï¼ãããã£ã¦å®è£ ããã¦ããã®ãï¼ã¨éç¼ãããã£ããã«ãªããæåéãï¼æä½ã»å½ä»¤ï¼ãcommandãï¼ã«å¯¾ããæ¦å¿µãå¤ããã¯ãã
- Mementoï¼ãç¶æ
ã®ã²ãã¿ã¨ã»ãã¿
- ãªãã¸ã§ã¯ãã®ç¶æ ã®ããã¯ã¢ããã¨å¾©å ãå¯è½ã«ãªãï¼ã¢ã³ãã¥ã¿ãããªãã¨ãã§ããããã«ãªããããã¯ã¢ãã対象ã®ãªãã¸ã§ã¯ãã«ã¯ï¼ãã®ãªãã¸ã§ã¯ãã®ç¶æ ãããã¯ã¢ããããããã®å°ç¨ã®Mementoãªãã¸ã§ã¯ããçæå¯è½ã«ããï¼ç¶æ ã®getterï¼ãã¾ãï¼ããã¯ã¢ãããããç¶æ ãªãã¸ã§ã¯ãããé£ããããäºã«ããï¼ç¹å®ã®ç¶æ ã«å¾©å ãããããã®ã¡ã½ãããç¨æããï¼ç¶æ ã®setterï¼ãããããäºã§ï¼ãªãã¸ã§ã¯ãã®ã«ãã»ã«åãä¿ã£ãã¾ã¾ã§ï¼ãªãã¸ã§ã¯ãã®ç¶æ ãããã¯ã¢ããã»å¾©å ã§ããããªãã¸ã§ã¯ã-ããã¯ã¢ããã»ãããã³ã°ã
- getter/setterã¨ããæ¦å¿µãï¼ãªãã¸ã§ã¯ãã®atomicãªæ´æ°ã¨ãã£ãæ¦å¿µã¯æ £ã親ããã§ããã ãããã§ãï¼ãããæ´»ç¨ãã¦ç¹å®ã®ãªãã¸ã§ã¯ãã®ãã¹ãããã·ã§ããããåå¾ï¼é©ç¨å¯è½ã«ããï¼ã¨ããçºæ³ã¯ï¼èªç¶ã«ã¯çã¾ãã¥ããã
- Bridgeï¼ãæ¡å¼µã¨å®è£
ã®é層åé¢
- ãã®ãã¿ã¼ã³ã ãï¼ã¡ãªããã®èª¬æãå°ãã ãé·ããªããBridgeã¯ä¸è¨ã®ãããªæ©ã¿ã解決ãããã¿ã¼ã³ã§ããã
- ããã£ãï¼ã¤ã®æ°ããæ©è½ã追å ãããã³ã«ï¼å ¨ç°å¢ç¨ã®ï¼å ¨æ©è½ã®ã³ã¼ããããããï¼ããå®è£ ãç´ããªããã°ãªããªãâ¦ãã
- Bridgeãã¿ã¼ã³ãé©ç¨ããã°ï¼æ©è½è¿½å ã«ããçã¾ããæ¡å¼µé層ã¨ï¼ãµãã¼ãç°å¢è¿½å ã«ããçã¾ããå®è£
é層ãï¼åé¢ãã¦å¥åã«ç®¡çã§ããããã®çµæï¼ä¸è¨ã®ããã«ç¶æ³ãå¤åããã
- ããã£ãï¼ã¤ã®æ°ããæ©è½ã追å ãããã³ã«ï¼å ¨ç°å¢ç¨ã®ã³ã¼ãã®ä¿®æ£åæã¯ï¼ããããï¼ãæãã¤ã§æ¸ããã
- Bridgeãã¿ã¼ã³ã®ã¡ãªãããï¼å³ã使ã£ã¦èª¬æãã¦ã¿ãã
- ãã®ãã¿ã¼ã³ã ãï¼ã¡ãªããã®èª¬æãå°ãã ãé·ããªããBridgeã¯ä¸è¨ã®ãããªæ©ã¿ã解決ãããã¿ã¼ã³ã§ããã
â Bridgeãã¿ã¼ã³é©ç¨åï¼ ããâããAbstractãããââç°å¢ã¿ã¤ãï¼ (Windowsç¨å®è£ ) ããâããæ©è½ver.1 âââ¼âç°å¢ã¿ã¤ãï¼ (Macç¨å®è£ ) ãæ©âããããâããããââç°å¢ã¿ã¤ãï¼ (Linuxç¨å®è£ ) ãè½âããããï½ ãä»âããAbstractãããââç°å¢ã¿ã¤ãï¼ ãæ§âããæ©è½ver.2 âââ¼âç°å¢ã¿ã¤ãï¼ ãã®âããããâããããââç°å¢ã¿ã¤ãï¼ ãé²âããããï½ ãæ©âãããã»ã»ã» ããâããããããããããæ©è½ãã¼ã¸ã§ã³ã¢ããã®ãã³ã« ããâããããããããããå®è£ ã®åãéè¤ã延ã ã¨ç¶ã â Bridgeãã¿ã¼ã³é©ç¨å¾ï¼ ããâãããããããããã ããâããæ©è½ver.1 ââââ å ¨verã®æ©è½å®ç¾ç¨ã® ãã¿âããããâããããããAPIéã®ã¤ã³ã¿ãã§ã¼ã¹ ããâããããï½ããããããããããâ ãåºâããããï½ããããããããããã» ããâããæ©è½ver.2 ãããããã»ã»ã»ã»ã»ã»ã» ããâããããâãããããããã»ããã»ããã» ããâããããï½ãããããããç°ããç°ããç° ãâ»âããããï½ãããããããå¢ããå¢ããå¢ ãæ©âãããã»ã»ã»ããããããï¼ããï¼ããï¼ ãè½âããããããããããããããããããã ããâããããããããããããâââââââ ããâãããããããããããããã¨ã³åºãã ãããããããããããâ»ï¼ãµãã¼ãç°å¢å¥ã®ï¼å®è£
-
- ã¯ã©ã¹å³ã®å ¨ä½åãï¼æ¨¹å½¢å³ã®ãããªè¤éãã失ãï¼ãÎ ãåï¼ã®ãªã·ã£æåã®ãã¤ï¼ã«ãªã£ãã®ããããããã®ä¸è¾ºããæ©æ¸¡ãããè¡ãªã£ã¦ããé¨åã§ããï¼ãã®ããã«Bridgeï¼æ©ï¼ã¨ããååãã¤ãã
- ãæ©è½ä»æ§æ¸ã®é²æ©ãã¨ï¼ããµãã¼ãç°å¢ã®ç¨®é¡ï¼ã¿ã¤ãï¼ã®å¤ããã¨ããï¼ã¤ã®è»¸ãè¦æããã¨ããã¼ã«ãªããBridgeãã¿ã¼ã³ã使ãã°ï¼ãããï¼ã¤ã®è»¸ããã¿ãåºãããã¨ãã¨ã³åºãããã«å解ãã¦æ´çã§ããã®ã ã
- ãªã®ã§çµè«ã¨ãã¦ï¼Bridgeãã¿ã¼ã³ã®è¦ç´ãã¬ã¼ãºãæ¡å¼µã¨å®è£ ã®é層ãåé¢ãããã¯ï¼ãæéçµéã«ä¼´ã£ã¦æ©è½ãæ¡å¼µããã¦ãããã¼ã¸ã§ã³ã¢ããã®éç¨ã¨ï¼å®è£ ã¿ã¤ãã®ããªã¨ã¼ã·ã§ã³ãè±å¯ã«åºããåæãã®å å®å ·åãï¼å¥åã«åãã¦ï¼æ´çãã¦ç®¡çã§ãããã¨ãããµãã«ãããã表ç¾ã§ãããï¼ãããè¨ãããã£ãã®ã§ï¼ããããAAã§å³ãæãããï¼
- â»ã¨ã¯ããï¼ãã®ãã¿ã¼ã³ãå¿ è¦ã«ãªãçç±ã¯ï¼ãã åã«ãJavaè¨èªã¯ã³ã¼ãã®å ±æããã¥ãããã©ãããã©ã¼ã ã ãããã¨ãè¨ãããModuleã®mixinæ©æ§ã¿ãããªãã®ãç¡ãã¨ãããã¨ããJavaãåæãªãï¼ããããã±ã¼ã¹ã«ã¯Bridgeã§å¯¾å¦å¯è½ã ããã¨ç¥ããã¨èªä½ã¯è¯ããã¨ãªã®ã ãï¼ã§ãJavaããç¥ããªãã¨Bridgeã®çºæ³ã«åºå·ãã¦ãã¾ããããããªããããã¯ããã§ã¾ããã
- Compositeï¼ãå帰ããªã¼æ§é
- ãã£ã¬ã¯ããªæ§é ãçµç¹ã®äººå¡æ§æãªã©ï¼å帰çãªæ§é ãå®è£ ããããã«å¿ é ã®ãã¿ã¼ã³ãã¯ã©ã¹å³ä¸ã§ã¯ï¼åã親ã«ãªãï¼è¦ªãåã«ãªãâ¦ã¨ãã循ç°çãªè¦ãããæã¤ã
- ãã£ã¬ã¯ããªæ§é ã®ãµã³ãã«ã³ã¼ãã§è¨ãã¨ï¼ãã¡ã¤ã«ã¨ãã©ã«ããåä¸è¦/æ½è±¡åãã¦ï¼ä¸¡è ã«å ±éã®æ§è³ªï¼ã¤ã³ã¿ãã§ã¼ã¹ã¾ãã¯åºåºã¯ã©ã¹ï¼ãæãããã¨ããããã¤ã³ãããã®è¦æ¹ã¯ï¼èªç¶ã«ã¯çã¾ãã¥ããããªãã¸ã§ã¯ã-å帰æ§é ã»ãããã³ã°ã
- ã¢ã«ã´ãªãºã ãã¡ãã£ã¨åå¼·ãã人ãªãï¼å帰å¼ã³åºãã使ã£ã¦ãéä¹ã®è¨ç®ããããã¯å®è£ ã§ãããã¤ã¾ãå¦çã®å®è¡é ã¨ãã観ç¹ã§ã®å帰ã¯ç¥ã£ã¦ãããããããããç¥ã£ã¦ã¦ãï¼ãã¼ã¿æ§é ããã¾ãå帰çã«å®è£ ãï¼æ¡å¼µæ§ã¨ã·ã³ãã«ãã両ç«ãããæ¹æ³ã¨ãªãã¨ï¼èªåã§æãã¤ãã®ã¯é£ããããªã®ã§ï¼Compositeãã¿ã¼ã³ã¯æèçã«å¦ã¶ã ãã®ä¾¡å¤ãããæ å ±ã
- Interpreterï¼ãç¬èªè¨èªã®å®è¡
- æ§æ解æã®çµæãï¼ãªãã¸ã§ã¯ãã«ãããã³ã°ãï¼å®è¡ãããã®ã§ãããORãããã³ã°ãªãã¬ï¼Object-BNFãããã³ã°ã¨ã§ãè¨ãã¹ããã¿ã¼ã³ãã¯ã©ã¹æ§é ãå帰çãªã®ã¯Compositeã¨é¡ä¼¼ã
- ã¨ã«ããä¸åå®è£ ãã¦ã¿ãªãã¨ï¼å¹ç¨ãããããªããèªåã®æã§ï¼ä½ãä½ã£ã¦ã¿ããã¨ãããããªãã¨ï¼æ¥ã«ã½ã¼ã¹ä¸ã«ç¾ããæã«ãããã¯Interpreterã ãã¨æ°ä»ãäºãããã§ããï¼èª¿æ»ããäºãåºæ¥ãï¼æã足ãåºãªãããã®ãã¿ã¼ã³ã§ã¯åã ã®ã¯ã©ã¹ã¯ã·ã³ãã«ãªã®ã§ï¼çãç¯å²ã§è¦ã¦ããã¨ï¼ã°ã°ã£ã¦ä½ãææãããå¾ããã¨ã¯ä¸å¯è½ãªã®ã§ããããããè¨ç®æ©ç§å¦ã®ããã¯ã°ã©ã¦ã³ããæµ ãããã«BNFãè¦ããã¨ãç¡ãå ´åã¯ï¼äºæ ã¯ãããã£ããæªåããã
- ãã®ãã¿ã¼ã³ã®éè¦ã¯ï¼ä¸å¿ãããã·ã¹ãã ã®ã¦ã¼ã¶ã«å¯¾ãã¦ï¼ä½ããç¬ç¹ã®è¨æ³ããæä¾ãããããªå ´åã«å¿ è¦ã«ãªãã
- Chain of Responsibillityï¼ãå©ãè¹ãããã¯ã¼ã¯
- ããè¨ãããã®ã¯ããªã¯ã¨ã¹ãã®ãããåããã ãï¼ããã¡ãã£ã¨ããããããããã¨ãå©ãè¹ã®ãããã¯ã¼ã¯ãã§ãããèªåã§ã¯å¦çããããªãã¿ã¹ã¯ã ï¼ã¨å¤æãããï¼èªåãç¥ã£ã¦ããå©ãèã«ãã«ããæ±ãã¦ï¼ããã¤ã«ä»»ãã¦ãã¾ããä»»ããå ã§ã対å¦ããããªãã£ããï¼ããã«ãã®å©ãè¹ãå¼ã°ããããã®ããã«ï¼å©ãè¹ã«ãã«ããæ±ããé£éæ§é ãä½ãã®ããã®ãã¿ã¼ã³ãå ¨ä½ã¨ãã¦è¦ãã¨ï¼ã奥ã®æãä½éã«ãæã£ã¦ãããäºã«ãªãã®ã ãï¼ããã ã¨ä¸ã¤ã®ã¯ã©ã¹ã対å¦æ¹æ³ãä½éã«ãå¼µãå·¡ããã¦å¾ ã¡æ§ãã¦ããããã«èãããã®ã§èªå¼ããããããã¾ã§ãï¼æåã®åä»ã«ãããé¨åããé çªã«ã¿ã¹ã¯ãéã°ãã¦ããï¼æ¬¡ã®è¡ãå ã¯ç¾å¨ã®å¦çè ã ããç¥ã£ã¦ããï¼ã¨ãããçªå£ä»ãã®ãããã¯ã¼ã¯ç¶ã®åæ£æ§é ãããã¼ã«ãªãã
- å°ãå°éç¨èªã使ã£ã¦è¨ããªããã¨ï¼ãè¦æ±å¦çè ã®ç·å½¢æ§é ãã¨ãè¨ãããããããã®å¦çè éã¯ï¼èªåããã¡ã ã£ãå ´åã®æ¬¡ã®è¡ãå ï¼ãã¤ã³ã¿ï¼åç §ï¼ãæã£ã¦ãããã ããç·å½¢æ§é ã¨å¼ã¹ãªãããªããããããã®ãã¤ã³ã¿ã¯ï¼ã³ã³ãã¸ã·ã§ã³ã¨ãã¦å®ç¾ããã¦ããã®ã§ï¼åçãªæ¸ãæããå¹ãããã ãï¼å¿ ãããä¸æ¬¡å ã®é£éã«éå®ãããï¼åè¿°ã®ããã«ç¶²ç®ç¶ã®ãããã¯ã¼ã¯æ§é ï¼å¾ªç°ããªãæåã°ã©ãæ§é ï¼ã§ãæ§ããªãã
- æè¡çãªè¨èã使ã£ã¦èª¬æããã°ï¼GUIã·ã¹ãã ã«ããããã¤ãã³ãã®ãããªã³ã°ãã§ãããä¾ãã°ãã©ã¦ã¶ä¸ã®DOMæ§é ã§ï¼JavaScriptã®ã¤ãã³ãã¯ï¼è¦ªãã¼ãã¸ã¨ä¼æ¬ãã¦ããããã®ã¨ã³ããªãªã©ãåç §ããããã§ï¼è¡¨é¢ããé çªã«å¥¥ã«åãã£ã¦é²ãã§ããéç¨ã§ï¼ã¤ãã³ãã«å¯¾å¦ãã¹ãé©åãªå¦çè ããã®ãã¡è¦ã¤ããäºã«ãªãã
- ãã®ãã¿ã¼ã³ãå¦ã¹ã°ï¼ãããªã³ã°ã®ãããªUIã·ã¹ãã ã¯ãããã£ã¦å®ç¾ããã¦ããã®ãï¼ã¨æ°ã¥ããã£ããã«ãªããããã¦ï¼å¦çãè¡ãªããªãã¸ã§ã¯ãå士ã®å調æ§ãé«ããããããªçºæ³æ³ãçã¾ããã
- Visitorï¼ãæ§é ã®ä¾¿å©ã¹ãã£ã
- è¤éãªãã¼ã¿æ§é ãããå ´åï¼ãã¼ã¿æ§é ã表ããªãã¸ã§ã¯ãã®ä¸ã«ã¯å ·ä½çãªå¦çãæ¸ããªãããããã«ï¼èªåã«å¯¾ãã¦å¦çãè¡ãªã£ã¦ãããVisitorãåãå ¥ããã¨ãããã¸ãã¯ã ããæ´ãã¦ãããããã¦ï¼Visitorã¯ãã¼ã¿æ§é ã渡ãæ©ãï¼åãã¼ã¿ã«å¯¾ãã¦æå®ã®å¦çãè¡ãªããVisitorã¯ãã¼ã¿æ§é ãã¹ãã£ã³ããªããä»äºãããªãã¦ããã®ã§ããã
- ãã¼ã¿æ§é ã®å´ã¯ï¼å ·ä½çãªå¦çãç¥ããªãã¦æ¸ããVisitorã¨ãããã®ãèªåã®ãã¨ã訪ãã¦ï¼ä½ãã®å¦çããã¦ãããã®ã ã¨ãããã¨ããç¥ã£ã¦ããã°ãããã¾ãï¼Visitorã®å´ãï¼å ·ä½çã«å®ç¾©ããããã¼ã¿æ§é ãç¥ã£ã¦ããå¿ è¦ã¯ãªãããã¼ã¿æ§é ã®æä½éã®ã¤ã³ã¿ãã§ã¼ã¹ãç¥ã£ã¦ããã°ãããããã¦ï¼ãã¼ã¿æ§é å ã§ã®æ¢ç´¢ãè¡ãªãï¼ã¾ãåãã¼ã¿ã«å¯¾ããå ·ä½çãªå¦çãè¡ãªãããã®ããã«ãã¦ï¼ãã¼ã¿æ§é ã¨å¦çãåå²ãããã
- è¦ã¯ï¼visitorã¯ãã¼ã¿æ§é ã«å¯¾ãããå¦çä»ãã®ä¾¿å©ã¹ãã£ãã»ãªãã¸ã§ã¯ããã¨ãªãããªãã¸ã§ã¯ãæåã«ããã¦å½¹å²ã®åå²ã¯èè¦ãªæ¦å¿µãªã®ã§ï¼ãã¼ã¿æ§é ã¨å¦çã®åé¢æ¹æ³ã¨ãã¦ä¸è¦ã®ä¾¡å¤ã¯ããããã ï¼ããã¾ã§ãããªãã¦ãååãä»äºããªããã¹ãã£ã³ãã§ããã®ã§Visitorãå®éã«ä½¿ãå¿ è¦ã¯ãªãï¼ã¨ããå ´åãããã
ï¼åé¡ï¼ï¼ã¡ãªããããããã¥ããï¼ä½¿ããã¥ãããã®ï¼
ãã¶ã¤ã³ãã¿ã¼ã³ã®ãæ¥èçµãã§ããã
æ´»ç¨ã·ã¼ã³ãç¡ãããã§ã¯ãªãããªã®ã§ï¼çªéæã¨ã¾ã§ã¯è¨ããªãã
- Prototypeï¼ãã³ãã¼ã渡ã
- æ´¾çãªãã¸ã§ã¯ãéããããããçæãã¦é³åãã¦ããã¦ï¼å¿ è¦ãªæã«ã³ãã¼ã渡ããæ´¾çãªãã¸ã§ã¯ããåçã«ç®¡çï¼è¿½å ã»åé¤ï¼ã§ããç¹ãã¡ãªãããï¼ããæ´¾çãªãã¸ã§ã¯ãããµãã¯ã©ã¹ã®å½¢å¼ã§æä¾ããã¦ãããããã¯ãããªããï¼
- æµ ãã³ãã¼ã®ããã§ãã©ãã«ãèµ·ãããâ¦ï¼ã¨ãï¼ã°ã©ãã£ãã¯ã¨ãã£ã¿ãä½ãæ©ä¼ãªãã¦ç¡ããã¨ãï¼ãã¾ãã«Prototypeã£ã¦ããååãã¤ããã®ã¯ä»ã«ãè²ã ããããªã©ï¼å種éå£ã®ããã«ï¼å°ã æãåºãã¥ããå½±ãèããªããã¿ã¼ã³ã
- Abstract Factoryï¼ãå·¥å ´ã®å·¥å ´
- å·¥å ´ã¯ï¼å½ä»¤ã«å¿ãã¦æ§ã ãªãããã¯ããåçã«ä½ããã§ãï¼ã ãã ãå·¥å ´ã®ããªã¨ã¼ã·ã§ã³ãå¢ãã¦ãããããã§ï¼å·¥å ´èªä½ãåçã«çæãã¦ï¼ãã¾ãã¾ãªå·¥å ´ã®ããªã¨ã¼ã·ã§ã³ãæãããã誤解ãæããã«ä¸è¨ã§è¨ã表ãã¨ï¼Factoryã®Factoryãå·¥å ´ã®å·¥å ´ã
- è¦ã¯Factory Methodãã¿ã¼ã³ãããã«ä¸ããæ½è±¡åãããã®ãªã®ã§ï¼Factoryã¨Abstractãçµã¿åãããã¨ãããªãã®ãï¼ã¨ããå¿ç¨çãªä½ç½®ä»ãã«ãªãã
- Flyweightï¼ããã£ãã·ã¥ä»ã®å·¥å ´
- ãã®ãã¿ã¼ã³ã¯ï¼ã¤ã³ã¹ã¿ã³ã¹çæã®è² è·ãæ¸ããããã«ï¼æ¢åã®ãªãã¸ã§ã¯ãã使ãã¾ããäºã«ãã£ã¦ããã©ã¼ãã³ã¹ãåä¸ããããã¨ããç¹ã§ã¯ï¼Singletonãã¿ã¼ã³ãPrototypeãã¿ã¼ã³ã¨åãããã ãã¤ã³ã¹ã¿ã³ã¹çæã®ã¿ã¤ãã³ã°ã¨ãï¼åã¤ã³ã¹ã¿ã³ã¹ã®å ±æã®ç¨åº¦ãç°ãªã£ã¦ãã¦ï¼Flyweightãã¿ã¼ã³ã®å ´åã¯å®ç¾ããã¨ãFactoryã«ãã£ãã·ã¥æ©è½ãä»ãããããªç©ããã§ãããããç¹å®ã®ã¿ã¤ãã®ã¤ã³ã¹ã¿ã³ã¹ãããï¼ã¨è¨ãããæç¹ã§ãã®ã¤ã³ã¹ã¿ã³ã¹ãå½±ãªããçæãï¼ãã¨ãã¨ä½¿ãã¾ããã¨ããä»çµã¿ãªã®ã§ãSingletonã¨Prototypeã®ä¸éãããã«ä½ç½®ãããã¿ã¼ã³ã¨è¨ãããããããªãã
- Flyweightã®çºæ³èªä½ã¯ï¼ããã°ã©ãã³ã°ãé²ãã¦ããã°ï¼èªç¶ãªçºæ³ã¨ãã¦ãã¤ã®éã«ã使ã£ã¦ããã¨ããã±ã¼ã¹ããããFactoryã¨Singletonãç¥ã£ã¦ãã¦ï¼Factoryã®è£å´ã§Singletonå対象ãããã¤ããããããªå ´åã¯ï¼èªç¶ã¨ããããè¨è¨ã«ãªããããããæå³ã§ã¯ï¼ãï¼åé¡ï¼ï¼è¨ãããªãã¦ãèªç¶ã«ä½¿ããã®ãã«å ¥ãï¼ã¨èããäºãã§ããã
- ã ãï¼ãã®ãã¿ã¼ã³åèªä½ãä½ãã«ããã¤ãã¼ã ãããã«ï¼ããèããã¨ï¼Flyweightèªä½ããã¨ãã¨æå±ãã¦ããè¨è¨ããã®ã¾ã¾æµç¨ã§ããã·ãã¥ã¨ã¼ã·ã§ã³ã¯ä»¥å¤ã¨å°ãªãããªãã¸ã§ã¯ãã®çæã³ã¹ãã大ããã¦ï¼ãªããã¤ã¤ã³ã¹ã¿ã³ã¹ãããã®ã¾ã¾ã§ã使ãåããå¹ãå¿ è¦ãããã®ã ãæ®éï¼ä½¿ãã¾ããããå´ã¯å¤å°ãªãã¨ãåå¥ã«ã«ã¹ã¿ãã¤ãºãããã®ã§ï¼å ¨ãåä¸ã®ã¤ã³ã¹ã¿ã³ã¹ã§ã¯å°ãããªã®ã§ï¼ãã®ãã¿ã¼ã³ã¯ããèããã¨å½±ãèãæ¹ã«åé¡ãããã®ãããããªãã
- ãããã¯ï¼ãã®ãã¿ã¼ã³ã¯å®ã¯ã¢ã³ããã¿ã¼ã³ãªã®ããã¨å²ãåã£ã¦èããäºãã§ããããªãã¸ã§ã¯ãçæã®ã³ã¹ããåæ¸ããããã«ï¼Factoryå½¹ã«ãã£ãã·ã¥æ©æ§ãæããããã¨ããçºæ³èªä½ã¯ããèªç¶ã ãã ãï¼ããªããã£ãåã§ã¯ãªããã®ããã£ãã·ã¥ãããããã¯å¤ã§ã¯ãªãåç §ã®ä¿æãªããã§ï¼ããåç §ãå ãã§å¤æ´ãçºçãããå ¨ã¦ã®åç §ãå ãã«å½±é¿ãåãã§ãã¾ããã ãããã£ãã·ã¥æ©æ§ãä½ãéã«ã¯ç¨å¿ããªããããã¨ããï¼ããããè¦åãä¼ããã ãã®ããã«ï¼ãã®Flyweightãã¿ã¼ã³ã¯åå¨ããï¼ã¨èãã¦ããããããããªãã
以ä¸ã§ï¼å ¨23ãã¿ã¼ã³ã®è¦ç´ãçµããã
å ¨ãã¿ã¼ã³ãã俯ç°ãã§ããã®ã§ã¯ï¼
大äºãªãã¨ã¯ï¼ä½ãï¼
ãããã®ãã¿ã¼ã³ã®ä¸ã«ã¯ï¼éè¦ã§æç¨ãªç©ãããã°ï¼ããã§ãªããã®ãããã
æé·ã®ããã«ä¸èªãå¿ é ãªã®ããããï¼å½ããåããã¦å¦ã³ç´ã価å¤ããã¾ããªãç©ãããã
ã ããï¼23åå ¨é¨ã®ãã¿ã¼ã³ãããããªããå¿ è¦ã¯ãªãã®ã ã
ï¼åï¼åã®è¨è¨ãã¿ã¼ã³ãã絶対ãã§ã¯ãªãããã
大äºãªã®ã¯ã»ã»ã»
- ï¼åé¡ï¼ï¼ã®ã¬ãã«ã®è¨è¨ã¯ï¼è¨ãããªãã¦ãèªç¶ã«æãã¤ããããªï¼ããããã»ã³ã¹ã身ã«ã¤ãããã¨ã
- ï¼åé¡ï¼ï¼ã®ã¬ãã«ã®è¨è¨ã¯ï¼ãã¡ãã¡åå¼·ããªãã¦ããã©ã£ãã§è¦ãããã¨è¨ãããããã®ï¼çµé¨ãç©ããã¨ã
- ï¼åé¡ï¼ï¼ã®ã¬ãã«ã®è¨è¨ã¯ï¼æå³çã«å¦ç¿ããããã®æéã¨å´åãå²ããã¨ããã¨ï¼ãã®æ®µéããã£ããã¨ç解ã§ããç¨åº¦ã¾ã§ã®æè¡åãï¼ã¡ããã¨èº«ã«ã¤ãããã¨ã
- ï¼åé¡ï¼ï¼ã®ã¬ãã«ã®è¨è¨ã¯ï¼ä»ã®ãã¿ã¼ã³ãåããã°å¥ã«ãããªããªãï¼ã¨èªåèªèº«ã§å¯ç¥ã§ããç¨åº¦ã¾ã§ï¼ä»ã®ãã¿ã¼ã³ãããç解ãããã¨ã
ã¨ããäºã«ãªãã
ããã¾ã§æ¥ãã°ï¼æ¬¡ã®ã¹ããããç®æããã®ã ã
å¦ãã ãã¿ã¼ã³ãå®è·µãããå¿ è¦æ§ãè¦æ¥µãã¦ï¼é©åãªã¿ã¤ãã³ã°ã§æ¡ç¨ããã
ãªãªã¸ãã«ã®ã¯ã©ã¹æ§é ãæèãã¤ã¤ãï¼èªåãªãã«ã¢ã¤ãã¢ãçãè¾¼ãã§ã«ã¹ã¿ãã¤ãºãã¦ï¼å®éã«æãåããã¦å®è£ ãã¦ã¿ãã
ããããã°ï¼è¨è¨åã»å®è£ åãé£èºçã«å¢ãã
ã¾ãï¼ãã¶ã¤ã³ãã¿ã¼ã³ã®æ¬¡ã®æ®µéã¨ãã¦ãEffective Javaããªã©ã®å¿ èªæ¸ãèªããããã«ãªãã
ï¼éã«è¨ãã¨ï¼ãã¶ã¤ã³ãã¿ã¼ã³ãã¨ãã®æ®µéã§ã¤ã¾ããã¦ããã¨ï¼åç¨®å¿ èªæ¸ãèªãããã®åãã¤ããªããï¼
ãã¶ã¤ã³ãã¿ã¼ã³ã¯ï¼ã¨ã³ã¸ãã¢ã«å¯¾ãã¦ï¼å ã ã®ããããªæãéãã¦ãããã®ã ã
ç¬å¦ç¨ã®ãªã³ã¯é
ãã¶ã¤ã³ãã¿ã¼ã³ã®å ·ä½çãªãµã³ãã«ã³ã¼ããï¼åã ã®ãã¿ã¼ã³ã«é¢ãã詳ãã解説ã¯ï¼ä¸è¨ã®ãªã³ã¯éããåå¾å¯è½ã
ã¶ãã¤ãå ¥éæ¸ãè²·ããªãã¦ãï¼ããæ°ããããã°ï¼ãã¶ã¤ã³ãã¿ã¼ã³ã¯ç¡æã§ç¿å¾ã§ããã
â»ã¨ã¯ããï¼å¤æ¬ã§ãæ§ããªãã®ã§ï¼æå
ã«ãªãã¡ã¬ã³ã¹ã¨ãã¦ç´åªä½ããã£ãæ¹ãè¯ããï¼æ¬ã¨ã³ããªãå°å·ãã¦ããããã©ãï¼
ããã«ï¼ãããããåèãã¯å°æ¥çã«èªç ´ã»å¶è¦ããæ¹ãããã
å ¥éè åãã®ãã¿ã¼ã³ä¸è¦§è¡¨ï¼
ãµã«ã§ãããã éå¼ããã¶ã¤ã³ãã¿ã¼ã³ / ãã¶ã¤ã³ãã¿ã¼ã³ã¨ã¯
http://www.nulab.co.jp/designPatterns...
- ååã¨æ¦è¦ã®ä¸è¦§è¡¨
- ã¡ãªããã¯ï¼åå©ç¨æ§ã®é«ãè¨è¨ï¼ã³ãã¥ãã±ã¼ã·ã§ã³æã®å ±éè¨èªï¼ãªãã¸ã§ã¯ãæåã®ç解
Deep Side of JavaãJava è¨èªåå ¥é 第ï¼å ã ã¯ã©ã¹è¨è¨ã¨ãã¶ã¤ã³ãã¿ã¼ã³
http://www.nurs.or.jp/~sug/soft/java/...
- ååã¨æ¦è¦ã¨é©ç¨ä¾ã®ä¸è¦§è¡¨
ç¢æ²¢ä¹ éã®æ©ãããGoFãã¶ã¤ã³ãã¿ã¼ã³
http://itpro.nikkeibp.co.jp/article/C...
- ååã¨ï¼ååã®ç´è¨³ã¨ï¼è§£èª¬è¨äºã¸ã®ãªã³ã¯
- ãããã«ã½ã¼ããäºåæ¢ç´¢ã¨ãã£ããããããå®çªã¢ã«ã´ãªãºã ãã®ãããªãã®ãç¥ãã°ããã°ã©ãã³ã°ã«ç®è¦ããã
Java ããã°ã©ãã®ããã®ãã¶ã¤ã³ãã¿ã¼ã³å ¥é
http://objectclub.jp/technicaldoc/pat...
- ããã¶ã¤ã³ãã¿ã¼ã³ã®ã«ãã´ãªãã«ä¸è¦§è¡¨ã
- è¤æ°çµã¿åããã¦å¹æãçºæ®ããå ´åãå¤ããjava.awtã¯ã©ã¹ã®è¨è¨ä¾
ä¸ç´è
åãã®ãã¿ã¼ã³ä¸è¦§è¡¨ï¼
ãã¶ã¤ã³ãã¿ã¼ã³ãèªã¿è§£ãï¼ããããï¼
http://www.happiese.com/system/dpatte...
- åé¡æ¹æ³ã«é¢ããéãèå¯ã¨ï¼ã¾ã¨ããç´¹ä»ã»è§£èª¬ã ãã§ãªãã³ã¡ã³ãã»æ¹å¤ã¤ã
- ãã¯ã©ã¹è¨è¨ã®ä¸ä½ã¬ãã«ã®ã³ã³ã»ããã¨ãã³ã¼ãã£ã³ã°ã®ãã¯ããã¯ããã£ã¡ãã«ãããããªãã®ã
- ã大æ¹ã¯æ®éã«ã¯ã©ã¹è¨è¨ãã¦ããã°åºã¦ãããã®ã§ï¼ããã¦ãã¿ã¼ã³ã¨åã¥ããã»ã©ã®ãã®ã§ã¯ãªãããã¿ã¼ã³ã¨ãããããã¯ããã¯ãã¤ãã£ãªã ã
- ãã¶ã¤ã³ãã¿ã¼ã³å ¨ä½ãéãã¦å¼·èª¿ããã¦ããã®ã¯ãã¤ã³ã¿ã¼ãã§ã¼ã¹ï¼ãAbstractï¼ã§ããã°ã©ãã³ã°ããã¨ãããã¨
GOF ãã¶ã¤ã³ãã¿ã¼ã³ä¸è¦§
http://www14.atpages.jp/hirotech/top/...
å
¨ã¦ã®ãã¿ã¼ã³ãï¼Javaã®ãµã³ãã«ã³ã¼ãä»ãã§ç¬å¦ã§ãããã¼ã¸ï¼
ãã¶ã¤ã³ãã¿ã¼ã³ INDEX
http://www.techscore.com/tech/DesignP...
- ç·´ç¿åé¡ã¨åçã¨UMLãã¤ã¢ã°ã©ã ã¤ã
ãã¶ã¤ã³ãã¿ã¼ã³å ¥é(C#,Java ãµã³ãã«ã³ã¼ã)ãUMLã§ç´¹ä»
http://www.rarestyle.net/main/pattern...
ãã¶ã¤ã³ãã¿ã¼ã³ã®éª¸éª¨ãã¡ (RE-BONE) with C
http://www002.upp.so-net.ne.jp/ys_oot...
ç¢æ²¢ä¹ éã®æ©ãããGoFãã¶ã¤ã³ãã¿ã¼ã³
http://itpro.nikkeibp.co.jp/article/C...
- ããã°ã©ã å ¨ä½ã®ã³ã¼ããè¼ã£ã¦ããããã§ã¯ãªãï¼è¦æã®ã¿ãæ°è¡ã§ããã£ã¨è§£èª¬
ã¨ãã«ï¼ããªãã¸ã§ã¯ãè³ã®ã¤ããæ¹âJavaã»UMLã»EJBããã¹ã¿ã¼ããããã®ç©¶æ¥µã®åºç¤è¬åº§ãï¼"ãªãè³"ï¼ã¨ããæ¸ç±ãæ¬å±ã§è¦ãäºã®ãã人ãå¤ãã¯ãã
ãã®æ¬ã¯ï¼ã¡ãã£ã¨å¹ã£é£ãã å ¥éæ¸ãªã®ã ãï¼23ãããã¶ã¤ã³ãã¿ã¼ã³ã®ä¸ã§æãéè¦ãªã®ã¯ä¸è¨ã®ï¼ã¤ã ã ã¨ãã¦ããã
- Template Methodãï¼æ¬ã¨ã³ããªã§ã¯åé¡ï¼ï¼
- Factory Methodãï¼ãããåé¡ï¼ï¼
- Compositeãï¼ãããåé¡ï¼ï¼
- State/Strategyãï¼ãããåé¡ï¼ï¼
â»ï¼ç« ã®ãå 人ã¯åããè¶ ææããã¿ã¼ã³ç¿å¾æ³ããåç §ã
èè ã®çå°¾ åæ°ã«ããã°ï¼ãä»ã®ãã¿ã¼ã³ã¯ãããï¼åã®å¿ç¨ã«éããªãã®ã§ï¼å¾ããæãä»ããã°ãããã®ã ã¨ããã
å¤æ°ãããã¿ã¼ã³ããè¦ç¹ã®ã¿ãæ½åºãã¦ï¼å¹ççã«å¦ç¿ããä¸ã§ï¼åèã«ã§ããæè¦ã ããã
ããã«ãã¹ã¬ããç·¨ãã®ãã¶ã¤ã³ãã¿ã¼ã³
ãã¶ã¤ã³ãã¿ã¼ã³ã«ã¯ããã«ãã¹ã¬ããçããããï¼ã¨ããã¦ããã
ããã¯GoFã¨ã¯é¢ä¿ãªãã
å½å ã§ã®èªç¥ã¯ï¼ä¸è¨ã®æ¸ç±ã®è²¢ç®ã大ããã
å¢è£æ¹è¨ç Javaè¨èªã§å¦ã¶ãã¶ã¤ã³ãã¿ã¼ã³å ¥é ãã«ãã¹ã¬ããç·¨ [大åæ¬]
http://www.amazon.co.jp/exec/obidos/A...
- 700ãã¼ã¸ãããæ¬
ãã®æ¬ã®æ§çã®æ¸è©
http://manuke.com/review/view.php?f_r...
- ãã³ã³ãã¥ã¼ã¿ç§å¦ã«ã®ã£ã¨ã£ãç¾ãã解説ã«æå¿ã
- Immutableï¼ãèªã¿åãã ããªãæä»å¶å¾¡ã¯å¿ è¦ãªããã¨ããæ°å¦ã§è¨ãã°ã¼ãã«ãããæ¦å¿µ
- ãã«ãã¹ã¬ããéçºã«ãããå ¬çç³»ã¨ãè¨ããã¢ãã¿ã¼(synchronized)ãã¦ã§ã¤ãã»ãã
- å®çã®éåã¨ãè¨ãããã¿ã¼ã³ã©ã³ã²ã¼ã¸
- synchronizedãè¦ã¤ãããããªã«ãå®ã£ã¦ããã®ããã«çç®ããã¨è¯ããã®ãããªå®è·µçãªæå¼ãã
Think ITèè é£ããããããã¶ã¤ã³ãã¿ã¼ã³å¿ æºæ¸ç± å³é¸6å
http://thinkit.co.jp/article/941/1
- ã¹ã¬ããã®é£ããå«ããå æããå ¥éæ¸
- 並è¡å¦çã®ã·ã¹ãã éçºã¯ããªãã¸ã§ã¯ããå£ããããããããã¯ãããããªãæ§è³ªããã¤å¿ è¦ãããããã®ããã®ãã¿ã¼ã³ã®åºæ¬
å¢è£æ¹è¨ç Javaè¨èªã§å¦ã¶ãã¶ã¤ã³ãã¿ã¼ã³å ¥é ãã«ãã¹ã¬ããç·¨ãã®ææ³
http://www.sutosoft.com/room/archives...
- ã¯ãªãã£ã«ã«ã»ã¯ã·ã§ã³çã®å®ç³ãï¼Javaç¨ã®ãã¿ã¼ã³åã¨ãã¦è¨ããªããããã®
- ãã«ãã¹ã¬ããã§ã®éçºãæªçµé¨ã§ããã°å¿ èªæ¸
- çµé¨è ã§ããã°æè¡çã«æ°ãã«å¾ãç©ã¯å°ãªããããããªããï¼ãã¿ã¼ã³åãå ±éã®ããã£ãã©ãªã¨ãã¦ç²å¾ã§ããã®ã§ï¼ãã«ãã¹ã¬ããã«é¢ããæè¡çãªè§£èª¬æç« ãæ¸ãæã«éå®ããããã¿ã¼ã³åãæ示ããã ãã§èª¬æãæ¸ãããã
ä¸è¿°ã®æ¸è©ããè¦ã¦ãããããã«ï¼ãããã«ãã¹ã¬ããã«èªä¿¡ããªããã°ï¼ä¸å¤ã»æ°ååããè³¼å ¥ãæ¨å¥¨ããããï¼ãã¡ããGoFãçµãã£ã¦ããã®æ®µéã ãï¼
WIN32APIä¸ã¨ãï¼ä»ã®ãã©ãããã©ã¼ã ãä»ã®è¨èªã§ã¹ã¬ãããååã«æ±ã£ãçµé¨ããã£ãããã¦ãï¼ã¨ããããç®æ¬¡ã®ä¸è¦§ã«ç®ãéãï¼ãã¿ã¼ã³åããJavaç¨ã®ããã£ãã©ãªãã¨ãã¦è¦ãã¦ãããæ¹ãããã
Webä¸ã§ç¬å¦ããããã®ãªã½ã¼ã¹ï¼
ãã¶ã¤ã³ãã¿ã¼ã³å ¥é ãã«ãã¹ã¬ããç·¨ã¾ã¨ã
http://d.hatena.ne.jp/otuzak/20080527...
- å ¨12ãã¿ã¼ã³ã®è¦ç´ã¡ã¢
- Single Threaded Execution
- Immutable
- Guarded Suspention
- Balking
- Producer-Consumer
- Read-Write Lock
- Thread-Per-Message
- Worker Thread
- Future
- Two-Phase Termination
- Thread-Specific Strage
- Active Object
ã®ã³ç«ã¨ãã«ãã¹ã¬ããã®ãã¿ã¼ã³ãã¡
http://www.hyuki.com/dp/cat_index.htm...
- 12ãã¿ã¼ã³ã®æ¦è¦ãAAã§å¦ã¶ãã¨ãã§ãã
ãã¶ã¤ã³ãã¿ã¼ã³(ãã«ãã¹ã¬ãã)
http://www.tom.sfc.keio.ac.jp/~fjedi/...
- 12ãã¿ã¼ã³ã®Javaã«ãããµã³ãã«ã³ã¼ãã¨è§£èª¬é
Javaã®ãã«ãã¹ã¬ããã»ããã°ã©ãã³ã°ã®ãªã³ã¯éãï¼ãã¶ã¤ã³ãã¿ã¼ã³ã®è§£èª¬éã¤ãï¼
http://language-and-engineering.hatenablog.jp/entry/20120905/p1
ãã®ä»ã®ãã¿ã¼ã³
GoF以å¤ã®ä»ã®ãã¶ã¤ã³ãã¿ã¼ã³ã¯ï¼ä¸è¨ã®ãµã¤ãã§å¦ç¿ã§ããã
GoF以å¤ã®ãã¿ã¼ã³ãç´¹ä»ãã¾ã
http://www.hyuki.com/dp/dpinfo.html
ãããã£ãã®ãå¦ã¶éã«ã¯ï¼å種ã®ããªãã¸ã§ã¯ãæåã®ååããé ã«å
¥ãã¦ããã¨ï¼å
¨ä½ã俯ç°ããããã¨æãããã
ãªãã¸ã§ã¯ãæåã®åå
http://www.tom.sfc.keio.ac.jp/~fjedi/...
è£è¶³ï¼é¢è«ç¨ã®ä¸è¦§è¡¨
åé ã®ä¸è¦§è¡¨ããï¼ã³ã¡ã³ãããã¹ã¦é¤å»ããç©ãæ²è¼ããã
ã»Factory Method | ã»Abstract Factory ã»Builder ã»Prototype ã»Singleton |
ã»Adapter | ã»Adapter ã»Bridge ã»Composite ã»Decorator ã»Facade ã»Flyweight ã»Proxy |
ã»Interpreter ã»Template Method |
ã»Chain of Responsibility ã»Command ã»Iterator ã»Mediator ã»Memento ã»Observer ã»State ã»Strategy ã»Visitor |
ä¾ãã°æ¡ç¨ã®é¢è«ãªããã§ï¼
é¼»é«ã
ã«ãJavaã®è¨è¨ã§ãã¾ãããã¨ããã¨ã³ã¸ãã¢ããããï¼ä¸è¨ã®è¡¨ãå°å·ã
ãããã¯ã¨ã¦ãè¯ããã¨ã§ãããããï¼ããã«ããã®ãå
¨é¨ï¼ããããä¸è¨ã§èª¬æãã¦ãããã¾ããã
ã¨è¨ãã
åè¿°ã®éãï¼å ¨é¨ãããã§è¨ããå¿ è¦ã¯ãªãã
éè¦ãªãã®ã¨ããã§ãªããã®ãåºå¥ããï¼ãããªãã«çãå°ãåçãè¿ã£ã¦ããã°ï¼OKã
ããã«ï¼èªåããã使ããã¿ã¼ã³ã®å¥½ãã»å«ããè¨ããã°ï¼ãªãè¯ãã
ããæ°ã¾ãã表æ
ã§ï¼ãããããã¾ããã¨ããåçãè¿ã£ã¦ããã°ï¼
ããããï¼ãããã«ä½ã使ã£ã¦ãªãã¸ã§ã¯ãæåã®è¨è¨ãåå¼·ããã®ï¼ã
ã¨è³ªåããã
çéã ã¦ã¦èª¬å¾åã®ããç´å¾ã®ããåçãè¿ã£ã¦ããã°ï¼åé¡ãªãã
å£ããã£ããï¼åãæ¨ã¦ã
é¢é£ããè¨äºï¼
Java使ãã®å¿
æºæ¸ãEffective Java 第ï¼çããï¼éèªã»ãã¹ã¿ã¼ã»äºå¾åç
§ããããã®ãªã³ã¯é
http://language-and-engineering.hatenablog.jp/entry/20121211/p1
Javaã®ã¸ã§ããªã¯ã¹ã§ï¼T.class ã new T() ãã§ããæ©ãã 話ãï¼åãã©ã¡ã¼ã¿ã®ã¤ã³ã¹ã¿ã³ã¹åã«é¢ãããã¬ã¼ã ã¯ã¼ã¯è¨è¨ããã±ã¼ã¹ã¹ã¿ãã£ï¼
http://language-and-engineering.hatenablog.jp/entry/20120502/p1
Javaã®ãã«ãã¹ã¬ããã»ããã°ã©ãã³ã°ã®ãªã³ã¯éãï¼ãã¶ã¤ã³ãã¿ã¼ã³ã®è§£èª¬éã¤ãï¼
http://language-and-engineering.hatenablog.jp/entry/20120905/p1
ãããªãã¼ã·ã§ã³ãAPIã¨ãåä½ãã¹ããAPIã®é¡ä¼¼æ§ï¼ããã³ãã®ã¹ã¿ã¤ã«ãæ代ã¨å
±ã«æ´ç·´ãããéç¨ã®æ¦è¦³
http://language-and-engineering.hatenablog.jp/entry/20120320/p1
Javaã®éåæå¦çãï¼ã·ã³ã°ã«ã¹ã¬ããã®ããã«ã·ã³ãã«ã«ã³ã¼ãã£ã³ã°ããããã®è¨è¨ãã¿ã¼ã³ãï¼ä¸¦åå¦çãé次å¦çã«ããï¼
http://language-and-engineering.hatenablog.jp/entry/20120205/p1
ã°ã©ãã£ãã¯ç³»ã¢ã«ã´ãªãºã ã«å½¹ç«ã¤ãè¨ç®å¹¾ä½å¦ãã®å
¥éç¨ãã¼ãPDF ï¼Computational Geometryï¼
http://language-and-engineering.hatenablog.jp/entry/20140528/ComputationalGeo...
ãã¾ãç¥ããã¦ããªãï¼Webã¢ããªéçºæã®ï¼ï¼ã®ç¥èª ï¼ä¾æã¤ãï¼
http://language-and-engineering.hatenablog.jp/entry/20101102/p1
ã
*1:è±èªã®ã¢ã«ãã¡ãããé ã§ï¼ãAããæåã ããã ããæ¥æ¬äººã«ãã£ã¨é æ ®ãã¦ããããã ããã¨è¨ã£ã¦ï¼äºåé³é ã§ãã¢ãããå§ããã°ããã£ã¦äºãããªãã