ä»åã¯MVCããŒããäžå¿ã«ã ãã¡ãŠã©ãŒã¯åœŒã«ã€ããŠéåžžã«äººæ°ããããŸããã ç§ã¯äžè¬çã«ç¿»èš³ããããšããŸãã:)ããã§ã誰ããæžãããããã°ã®ããã«MVCã身ã«çããŠããçç±ãç解ã§ããŸãã ã¡ãªã¿ã«ããã¡ãŠã©ãŒã¯æ£ããã§ã-å€ãã®äººã ãšå€ãã®äººãç¬èªã®æ¹æ³ã§MVCãèªèããŠããŸãã Fowlerèªèº«ããSmalltalkãã©ãããã©ãŒã ã§æ©èœãããªãªãžãã«ã®MVCã«ã€ããŠæžããŠããŸãã éåžžã«æçã§ãã
åã®éšåã¯ãã¡ãã§ãã å ã®èšäºã¯ãã¡ãã§ãã Fowlerã¯äžè¬çãªåé¡ã®äŸãæŠèª¬ããŠãããããæåã®éšåãèªãããšã匷ããå§ãããŸãã ãã®ã¿ã¹ã¯ã«ã€ããŠèªãã§ããªãå Žåããããäœã§ããããå°ãäžæçã«ãªããŸãã
æããäžç·ã«ãªã£ãŠã翻蚳ã®æ¬¡ã®éšåãæžããŸãã
ã¢ãã«ãã¥ãŒã³ã³ãããŒã©ãŒ
ã¢ãã«ãã¥ãŒã³ã³ãããŒã©ãŒã ãããããUIéçºã§æãäžè¬çãªãã¿ãŒã³ã¯Model-View-ControllerïŒMVCïŒã§ãã ããã«ãã»ãšãã©ã®å Žåãæã誀解ãããŠããŸãã ç§ã¯ãMVCãšåŒã°ãããã®ãèŠãåæ°ããã§ã«å€±ããŸããããMVCã¯èªåèªèº«ãèŠã€ããŸããã§ããã ççŽã«èšã£ãŠãããã¯å€å žçãªMVCãæè¿ã®å€ªã£ã顧客ã«ãã¯ãé©ããªãããã§ãã MVCãã©ãããæ¥ãã®ãèŠãŠã¿ãŸãããã
MVCãæãäžããåã«ã圌ããœãªã¥ãŒã·ã§ã³ã®èŠæš¡ã«é¢ä¿ãªãUIã®åé¡ã®è§£æ±ºã«çå£ã«åãçµãæåã®è©Šã¿ã®1人ã§ããããšãèŠããŠããããšãéèŠã§ãã 70幎代ããã°ã©ãã£ã«ã«ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ãã®æŠå¿µã¯ããŸãäžè¬çã§ã¯ãããŸããã§ããã äžã§èª¬æããShapes and Elementsãã³ãã¬ãŒãã¯ãMVCãããåŸã«ç»å ŽããŸããã ç§ã¯äž»ã«ãããããåçŽã§ãããåžžã«èšèã®è¯èã§ã¯ãªããããããã説æããŸããã ãã§ã«ããç¥ãããŠããã¢ã€ã¹ã¯ãªãŒã æ¿åºŠã®äŸã§Smalltalk 80 MVCãèŠãŠãããŸãã åæã«ãç§ã¯èªåèªèº«ã«ããã€ãã®èªç±ãèªããSmalltalk 80ãã©ãããã©ãŒã ã«ã€ããŠèª¬æããŸãã
MVCã¢ã€ãã¢ã®æ žå¿ã¯ãåŸç¶ã®ãã¹ãŠã®ãã¬ãŒã ã¯ãŒã¯ã®æ žå¿ã¢ã€ãã¢ã§ãããç§ãã åé¢ãã¬ãŒã³ããŒã·ã§ã³ ããšåŒãã§ãããã®ã§ãã å¥ã®ãã¥ãŒã®æå³ã¯ãçŸå®äžçãåæ ãããã¡ã€ã³ãªããžã§ã¯ããšãç»é¢äžã®GUIèŠçŽ ã§ãããã¬ãŒã³ããŒã·ã§ã³ãªããžã§ã¯ãã®éã«æ確ãªç·ãåŒãããšã§ãã ãã¡ã€ã³ãªããžã§ã¯ãã¯å®å šã«ç¬ç«ããŠããããã¬ãŒã³ããŒã·ã§ã³ãåç §ããã«åäœããå¿ èŠããããè€æ°ã®è¡šçŸããµããŒãããå¿ èŠããããŸããåæã«ãå¯èœã§ãã ã¡ãªã¿ã«ããã®ã¢ãããŒãã¯Unixæåã®éèŠãªåŽé¢ã®1ã€ã§ããããä»æ¥ã§ãã³ãã³ãã©ã€ã³ãšã°ã©ãã£ã«ã«ã€ã³ã¿ãŒãã§ã€ã¹ã®äž¡æ¹ã§ïŒåæã«ïŒå€ãã®ã¢ããªã±ãŒã·ã§ã³ã§äœæ¥ããããšãã§ããŸãã
MVCã§ã¯ãã¢ãã«ã¯ãã¡ã€ã³ãªããžã§ã¯ããæããŸãã ãã¡ã€ã³ãªããžã§ã¯ãã¯UIãšã¯é¢ä¿ãããŸããã MVCã§æ¿åºŠãšæž¬å®å€ã䜿çšããŠäŸãã¬ã€ã¢ãŠãããããã«ãé¢å¿ã®ãããã¹ãŠã®ãã£ãŒã«ããæã€èªã¿åããªããžã§ã¯ããã¢ãã«ãšããŠäœ¿çšããŸãã ïŒã芧ã®ãšããããªã¹ãããã¯ã¹èŠçŽ ããããšã¢ãã«ãå°ãè€éã«ãªããŸããããã°ããã¯ãã®ãã¥ã¢ã³ã¹ãç¡èŠããŸãïŒã
MVCã§ã¯ã ã¬ã³ãŒãã®ã»ãã ïŒ Record Set ïŒãæ±ã£ãããã©ãŒã ãšèŠçŽ ããšã¯å¯Ÿç §çã«ããã¡ã€ã³ã¢ãã«ïŒ Domain Model ïŒã®éåžžã®ãªããžã§ã¯ããåç §ããŸãã ããã¯ã2ã€ã®ãã³ãã¬ãŒãã®èšèšäžã®éãã®1ã€ã§ãã ããã©ãŒã ãšèŠçŽ ãã§ã¯ãã»ãšãã©ã®äººããªã¬ãŒã·ã§ãã«ããŒã¿ããŒã¹ã®ããŒã¿ãç°¡åã«æäœãããã®ã«å¯ŸããMVCã¯éåžžã®Smalltalkãªããžã§ã¯ããæäœããããšãåæãšããŠããŸãã
MVCã®ãã¬ãŒã³ããŒã·ã§ã³éšåã¯ããã¬ãŒã³ããŒã·ã§ã³ãšã³ã³ãããŒã©ãŒã®2ã€ã®èŠçŽ ããäœæãããŸãã ã³ã³ãããŒã©ãŒã®ä»äºã¯ããŠãŒã¶ãŒå ¥åãååŸãããããã©ãåŠçããããææ¡ããããšã§ãã
ããã§ããã®äŸã§ã¯ããã¥ãŒãšã³ã³ãããŒã©ãŒãåæ°åœ¢ã§ååšããªãããšã匷調ããå¿ èŠããããŸãã ç»é¢äžã®åé ç®ãç»é¢äžã®åã³ã³ãããŒã«ãããã³ç»é¢èªäœã«å¯ŸããŠããã¥ãŒãšã³ã³ãããŒã©ãŒã®ãã¢ãå¿ èŠã§ãã ãããã£ãŠããã®äŸã§ã¯ããŠãŒã¶ãŒå ¥åã«å¯Ÿããæåã®åå¿ã¯ã³ã³ãããŒã©ãŒã®å ±åäœæ¥ã§ãããããã¯çŸåšã©ã®èŠçŽ ããã®ããŒã¿ãåä¿¡ããŠââãããã決å®ããŸãã ãã®ãããªèŠçŽ ã¯ãå®éã®éäžåºŠã®ããã¹ããã£ãŒã«ãã«ãªããŸãã ãã®ããã¹ããã£ãŒã«ãã®ã³ã³ãããŒã©ãŒã¯ãå ¥åãããããŒã¿ãåŠçããŸãã
å³4.ã¢ãã«ããã¥ãŒãã³ã³ãããŒã©ãŒéã®åºæ¬çãªé¢ä¿ã ïŒå®éããã¥ãŒãšã³ã³ãããŒã©ãŒã¯äºãã«çŽæ¥é¢é£ããŠããå¯èœæ§ããããããåºæ¬ãšåŒã³ãŸãããã ããéçºè ã¯ãã®æ¥ç¶ãã»ãšãã©äœ¿çšããŸãããïŒ
ãã®åŸã®éçºç°å¢ãšåæ§ã«ãSmalltalkãã©ãããã©ãŒã ã¯ãåå©çšå¯èœãªæ±çšUIã³ã³ããŒãã³ããäœæããæ©èœãæäŸããŸããã ç§ãã¡ã®å Žåããã®ãããªã³ã³ããŒãã³ãã¯ãã¥ãŒãšã³ã³ãããŒã©ãŒã®ãã¢ã«ãªããŸãã äž¡æ¹ãšãæ±çšã¯ã©ã¹ã§ãïŒ ããããæ§æã«å¿ããŠ-ãããTranslã ïŒã ããŸããŸãªã¢ããªã±ãŒã·ã§ã³ã§äœ¿çšã§ããããã«ãäžè¬åãå¿ èŠã§ãã 1ã€ã¯è©äŸ¡ãã¥ãŒã§ããããã¯ç»é¢å šäœã®åœ¹å²ãæãããããåçŽãªèŠçŽ ã®å Žæã決å®ããŸãã ãã®é åºã¯ãããã©ãŒã ãšèŠçŽ ãã®é åºãšäŒŒãŠããŸãã ãã ããããã©ãŒã ãšèŠçŽ ãã®ãã©ãŒã ãªããžã§ã¯ããšã¯ç°ãªããMVCã«ã¯è©äŸ¡ã³ã³ãããŒã©ãŒã«ããã¹ããã£ãŒã«ãã€ãã³ããã³ãã©ãŒããããŸããã
å³5.ã¢ã€ã¹ã¯ãªãŒã æ¿åºŠã®äŸã®MVCããŒãžã§ã³ã®ã¯ã©ã¹ã
å®éã®å€ãå ¥åãããŠãŒã¹ã±ãŒã¹ãæ€èšããŠãã ããã å®éã®å€ã®ããã¹ããã£ãŒã«ãèŠçŽ ã®æ§æã¯ãã¢ãã«ïŒæž¬å®ãªããžã§ã¯ãïŒãšã®æ¥ç¶ã§æ§æãããŸãã èŠçŽ ã§ããã¹ããå€æŽããããšãã«ã¢ãã«ã§åŒã³åºãå¿ èŠãããã¡ãœããã ç»é¢ãåæåãããšãéžæãããã¡ãœããã¯ã#actualãã«ãªããŸãïŒè¡ã®å é ã®ãïŒãæåã¯ã€ã³ã¿ãŒã³ãããè¡ã瀺ããŸãïŒã ããã¹ããå ¥åããããšãã³ã³ãããŒã©ãŒã¯æž¬å®ãªããžã§ã¯ãã§æå®ãããã¡ãœãããååž°åŒã³åºãããŸãïŒå®éã®ãã£ãŒã«ãã®å€ãå€æŽããŸãïŒã å®éãããŒã¿ãã€ã³ãã£ã³ã°ã§ããŸã£ããåãã¡ã«ããºã ãçºçããŸããã ã³ã³ãããŒã«ã¯ãåºç€ãšãªããªããžã§ã¯ãïŒã¬ã³ãŒãïŒã«é¢é£ä»ããããã©ã®ã¡ãœããïŒã€ãŸãåïŒãå¶åŸ¡ããããèªèããŠããŸãã
å³6.å®éã®å€ãã£ãŒã«ãã®å€æŽ
ãã®ãããçµæã®ãœãªã¥ãŒã·ã§ã³ã«ã¯äžè¬çãªãã©ãŠãžã³ã°ãªããžã§ã¯ãã¯ãããŸããïŒã€ãã³ããã³ãã©ãŒãæã€ãã©ãŒã ãªããžã§ã¯ããæãåºããŠãã ããïŒã 代ããã«ãã³ã³ãããŒã«ã¯ïŒãã©ãŒã ãªããžã§ã¯ãã§ã¯ãªãïŒåäœãå®çŸ©ãããŠããã¢ãã«ãèŠèœãšããŸãã ã€ãŸããã€ã³ãžã±ãŒã¿ãŒã®å·®ïŒåæ£ïŒã®å€ã決å®ããå¿ èŠãããå Žåãã¢ãã«ã¯ããèªäœã«å¯ŸåŠããŸãã
ãã©ãŠã¶ã¯MVCã«ãããŸãã å®éãããã¯MVCã«ãã£ãŠçæãããã¢ã€ãã¢ã®1ã€ã§ãã ãã®äŸã§ã¯ããã¹ãŠã®ãã¥ãŒãšã³ã³ãããŒã©ãŒãã¢ãã«ãèŠèœãšããŠããŸãã ã¢ãã«ãå€æŽããããšãè¡šçŸãåå¿ããŸãã å®éã®å€ã®ããã¹ããã£ãŒã«ãã®è¡šçŸã¯ã枬å®ãªããžã§ã¯ããå€æŽããããšããæ å ±ãåãåãããã®åŸãç¹å®ã®ããã¹ããã£ãŒã«ãïŒãã®å Žåã¯#actualïŒã®ã¢ã¹ãã¯ããšããŠå®çŸ©ãããã¢ãã«ã¡ãœãããåŒã³åºãããã®å€ããã£ãŒã«ãã«èšå®ããŸãã ïŒããã¹ãããã¯ã¹ã®è²ã«ã€ããŠãã»ãŒåãããšãèµ·ãããŸãããããã«èª¬æããç¬èªã®ããŽãŒã¹ããããããŸããïŒ
ããã¹ããã£ãŒã«ãã³ã³ãããŒã©ãŒèªäœã¯ãããã¹ããã£ãŒã«ããã¥ãŒã«å€ãå ¬éããªãããšã«æ³šæããŠãã ããã ã¢ãã«ãæŽæ°ãããã©ãŠã¶ã¡ã«ããºã ãä»ã®ãªããžã§ã¯ãã®æŽæ°ãåŠçã§ããããã«ããŸãã ãã®ã¢ãããŒãã¯ããã©ãŒã ãªããžã§ã¯ããæŽæ°ãããšã³ã³ãããŒã«ãæŽæ°ãããããŒã¿ãã€ã³ãã£ã³ã°ãä»ããŠåºã«ãªãã¬ã³ãŒãã»ããïŒã¬ã³ãŒãã»ããïŒãæŽæ°ãããããã©ãŒã ãšèŠçŽ ããšã¯ç°ãªããŸãã ããã2ã€ã®ã¢ãããŒãããã³ãã¬ãŒãã«éžæããããã«å¿ããŠååãä»ããŸãïŒ Flow SynchronizationãšObserver Synchronizationã§ãã 圌ãã¯ã¹ã¯ãªãŒã³ç¶æ ãšã»ãã·ã§ã³ç¶æ ã®éã§åæããç°ãªã£ãæ¹æ³ã«ã€ããŠèª¬æããŸãã ããã©ãŒã ãšèŠçŽ ãã¯ãã¢ããªã±ãŒã·ã§ã³ã®åŒã³åºããããŒãä»ããŠãçŽæ¥ã¢ã¯ã»ã¹ããŠçŽæ¥æŽæ°ããå¿ èŠãããããŸããŸãªå¶åŸ¡èŠçŽ ãšããŒã¿ãåæããŸãã MVCã¯ã¢ãã«ã®æŽæ°ãä»ããŠåæãããã©ãŠã¶ãŒãšã®é¢é£ä»ããä»ããŠã³ã³ãããŒã«ã®è¡šçŸãæŽæ°ããããšã«äŸåããŠããŸãã
ã¢ããªã±ãŒã·ã§ã³ã«ããŒã¿ãã€ã³ãã£ã³ã°ããªãå Žåãã¹ããªãŒã ã®åæã¯ããé¡èã«ãªããŸãã ãã®å Žåãã¢ããªã±ãŒã·ã§ã³ã¯éèŠãªæ®µéïŒã¢ããªã±ãŒã·ã§ã³ãããŒïŒã®1ã€ã§æ瀺çã«åæããå¿ èŠããããŸããããšãã°ãç»é¢ãéãããšãããŸãã¯ãä¿åããã¿ã³ãæŒãããšããªã©ã§ãã
ãã©ãŠã¶ãŒãä»ããåæ ïŒ Observer Synchronization ïŒã®çµæã®1ã€ã¯ãçªç¶ãŠãŒã¶ãŒãäœããã®æ¹æ³ã§å€æŽããå ŽåïŒã€ãŸããå¥ã®èŠçŽ ïŒãã³ã³ãããŒã©ãŒãä»ã®èŠçŽ ã®å€æŽãèªèããªãããšã§ãã ãForms and Elementsãã®ãã©ãŒã ãªããžã§ã¯ãã¯ãäœããå€æŽãããå ŽåïŒãã©ãŒã ã®è€éãªã¬ã€ã¢ãŠãã§ã¯éåžžã«æéããããå¯èœæ§ããããŸãïŒãç»é¢ã®ç¶æ ã®æŽåæ§ãæ éã«ç£èŠããå¿ èŠããããŸãã
ãã®äŸ¿å©ãªå©ç¹ã¯ãåãã¢ãã«ãªããžã§ã¯ããèŠèœãšãè€æ°ã®ç»é¢ãéããŠããå Žåã«ç¹ã«äŸ¿å©ã§ãã MVCã®å žåçãªäŸã¯ãããŒãã«ãããšãã°ããŒã¿ãå«ãç»é¢ãšããã®ããŒã¿ã®ããŸããŸãªã°ã©ãã®ããã€ãã®ãŠã£ã³ããŠã§ãã ããŒãã«ã®ãããŠã£ã³ããŠã¯ãä»ã®ãŠã£ã³ããŠãéããŠããããšãç¥ãå¿ èŠã¯ãããŸããã ã¢ãã«ãæŽæ°ããã ãã§ã Observer Synchronizationãæ®ããè¡ããŸãã Stream Synchronizationã䜿çšãããšãæŽæ°ããããã«ä»ã®ãŠã£ã³ããŠãéããŠããããšãäœããã®æ¹æ³ã§ç¥ãå¿ èŠããããŸãã
Observer Synchronizationã®ãã¹ãŠã®å©ç¹ã«ã¯ã1ã€ã®æ¬ ç¹ããããŸãã ãªãã¶ãŒããŒåæã®åé¡ã¯ãã©ãŠã¶ãŒèªäœã«ãããŸããã³ãŒããèŠããšãäœãèµ·ãã£ãŠããã®ãããããŸããã Smalltalk 80ã«å®è£ ãããŠããäŸãç解ãããšãããã®äžäŸ¿ããéåžžã«ã¯ã£ãããšæãåºããŸããã äžéšã®ã³ãŒãã®ã»ã¯ã·ã§ã³ã§äœãèµ·ããããç¥ãããšã¯ã§ããŸããããã©ãŠã¶ãŒãããžãã¹ãå§ãããšããã«ã次ã«äœãèµ·ããããç解ããããã«ãã¬ãŒãµãŒãšãããã¬ãŒãå¿ èŠã§ãã ãã©ãŠã¶ãŒã®åäœã¯æé»çã§ãããããç解ãè°è«ãå°é£ã§ãã
æ瀺ãããå³ãããç¶æ åæãžã®ããŸããŸãªã¢ãããŒãã芳å¯ã§ããŸãã ãã ããMVCã®æãéèŠã§åœ±é¿åã®ããéãã¯ã Separated Presentationã®äœ¿çšã§ãã å®éã®å€ãšç®æšå€ã®éã®åå·®ã®èšç®ã¯ããã¡ã€ã³ã¢ãã«ã®åäœã§ãããUIã«äŸåããã¹ãã§ã¯ãããŸããã ãããã£ãŠããã®åäœãã·ã¹ãã ã®ãã¡ã€ã³å±€ïŒæž¬å®ïŒèªã¿åãïŒã®å¯Ÿè±¡ã§ãããã®å±€ïŒã«å®è£ ããŸãã åå·®ãèšç®ããæ¹æ³ã¯ã枬å®ãªããžã§ã¯ãã«ãšã£ãŠçµ¶å¯Ÿã«è«ççã§ããããŠãŒã¶ãŒã€ã³ã¿ãŒãã§ã€ã¹ã«ã€ããŠã¯ããããŸããã
ããããä»ãç§ãã¡ã¯ç©äºã®çŸåšã®ç¶æ ã®ããã€ãã®å䜵çãèæ ®ããããšãã§ããŸãã MVCçè«ã«ã€ããŠè©±ãããšãã«ç§ãããæãã2ã€ã®äžå¿«ãªé åããããŸãã æåã®åé¡é åã¯ãå·®ç°ããã¹ããã£ãŒã«ããžã®è²ã®å²ãåœãŠã§ãã ãã®ããžãã¯ã¯ãåå·®å€ã匷調衚瀺ããè²ããã®äžéšã§ã¯ãªãããããã¡ã€ã³ãªããžã§ã¯ãã«å®å šã«å±ããŠããããã§ã¯ãããŸããã ããã«ããããããããã®ãããªããžãã¯ã®äžéšã¯ããã«ããããããäžéšã§ãã ããšãã°ãåå·®ã®å質ã®è©äŸ¡ïŒè¯å¥œïŒ5ïŒ ä»¥äžïŒãäžè¯ïŒ10ïŒ æªæºïŒãæ£åžžïŒãã®ä»ãã¹ãŠã®å€ïŒã è©äŸ¡èšç®ã¯ãã¡ã€ã³ããžãã¯ã§ãã ããã¹ããã£ãŒã«ãã®è²ä»ãã¯ãã¬ãŒã³ããŒã·ã§ã³ããžãã¯ã§ãã åé¡ã¯ããã¬ãŒã³ããŒã·ã§ã³ããžãã¯ãé 眮ããå Žæã§ãã éåžžã®ããã¹ããã£ãŒã«ãã®ããžãã¯ã®äžéšã§ã¯ãããŸããã
Smalltalkã®æåã®éçºè ã¯ãã®åé¡ã«çŽé¢ãããã®åé¡ã®è§£æ±ºçãææ¡ããŸããã äžèšã®ãœãªã¥ãŒã·ã§ã³ã¯ããã¡ã€ã³ããžãã¯ã®ãçŽåºŠãã«éåãããããæ±ããŠããŸãã ç§ã¯ã©ã³ãã ãªãæ±æãè¡çºãèªãããããç¿æ £ã«ãªããªãããã«ããŠããŸãïŒ ããã¯ããã¡ãŠã©ãŒãåè«ãèšã£ãŠãã-ãããTranslãã§ã ïŒã
ããã©ãŒã ãšèŠçŽ ããšåãæ¹æ³ã§ãã®åé¡ã解決ããããšãã§ããŸã-è©äŸ¡ç»é¢ã§åå·®ããã¹ããã£ãŒã«ãã®è¡šç€ºãèŠèœãšãããšãã§ããŸãã å€ãå€æŽããããšãç»é¢ãå¿çããããã¹ããã£ãŒã«ãã«è²ãå²ãåœãŠãããŸãã ãããããã®ãããªãœãªã¥ãŒã·ã§ã³ã«ã¯ãã©ãŠã¶ãŒã¡ã«ããºã ã®äœ¿çšãå«ãŸããŸãããããŠãããããæãäžããã»ã©ãïŒææ°é¢æ°çã«ïŒããããšã®äœæ¥ãããè€éã«ãªããç°ãªãè¡šçŸéã®äžèŠãªæ¥ç¶ã®æ°ãå¢å ããŸãã
æ°ããã¿ã€ãã®UIèŠçŽ ãéçºããããšæããŸãã ãã®èŠçŽ ã®åäœã®ç¹åŸŽã¯ããã¡ã€ã³ãªããžã§ã¯ãã«æšå®å€ãèŠæ±ããå€ãšè²ã®å éšããŒãã«ãšæ¯èŒããããŒãã«ããååŸããè²ã§åŒ·èª¿è¡šç€ºããããšã§ãã ããŒãã«ãšãã¡ã€ã³ãªããžã§ã¯ãã®å€ã®èŠæ±ã¯ãããèªäœã®ã¢ã»ã³ããªæ®µéã§ã®è©äŸ¡ã®æ瀺ã«ãã£ãŠå²ãåœãŠãããŸãã ãŸã£ããåãæ¹æ³ã§ãå€ã®ã¢ã¹ãã¯ããããã«ç¶ãããã«ããã¹ããã£ãŒã«ãã«å²ãåœãŠãããŸãã ããã¹ããã£ãŒã«ãããç¶æ¿ããç°¡åãªæ¹æ³ãããã°ããã®ã¢ãããŒãã¯éåžžã«ããŸãæ©èœããŸãïŒæ°ããããã€ãã¢ãè¿œå ããŸãïŒã ãã®ãããªæ¹æ³ããããã©ãã-ããã¯ãé©åã«èšèšãããã³ã³ããŒãã³ããç¶æ¿ããµããŒããããã©ããã«äŸåããŸã-Smalltalkã§ã¯éåžžã«ç°¡åã§ãä»ã®ç°å¢ã§ã¯ããè€éã«ãªãå¯èœæ§ããããŸãã
å³7ïŒè²ã®å®çŸ©ããµããŒãããããã¹ããã£ãŒã«ãã¯ã©ã¹ã®ç¶æ¿ã䜿çšããŸãã
æåŸã®ä»äžãã¯ãç»é¢äžã®èŠçŽ ã«åŸãç¹å¥ãªãã¡ã€ã³ãªããžã§ã¯ãã®äœæã§ãããåæã«ããã«äŸåããŸããã ã€ãŸããç»é¢ã®ã¢ãã«ãäœæããŸãã 以åã«æž¬å®ãªããžã§ã¯ãã«å¯ŸããŠåŒã³åºãããã¡ãœããã¯ãã¢ãã«ã«ãã£ãŠæž¬å®ãªããžã§ã¯ãã«å§ä»»ãããŸãã ãŸããè²æ±ºå®ãªã©ã®ãUIã®ã¿ãã®ã¡ãœãããå®çŸ©ããŸãã
å³8ïŒãã¬ãŒã³ããŒã·ã§ã³ããžãã¯ã®åŠçã§ã®ãã¬ãŒã³ããŒã·ã§ã³ã¢ãã«ã®äœ¿çšã
ææ¡ããããœãªã¥ãŒã·ã§ã³ã¯å€ãã®å Žåã«æ©èœããåŸã§èŠãããã«ãSmalltalkéçºè ãåŸãäžè¬çãªææ³ã«ãªããŸããã ãã¥ãŒã¬ã€ã€ãŒçšã«èšèšãããŠããïŒãã¥ãŒã¬ã€ã€ãŒã®äžéšã§ããïŒããããã¥ãŒã¢ãã«ïŒïŒãšåŒã³ãŸãã
ãã¬ãŒã³ããŒã·ã§ã³ã¢ãã«ã¯ããã¬ãŒã³ããŒã·ã§ã³ããžãã¯ã®å¥ã®åé¡-ãã¬ãŒã³ããŒã·ã§ã³ç¶æ ã®åé¡ã解決ããŸãã MVCã®åºæ¬æŠå¿µã¯ããã¥ãŒã¹ããŒããã¢ãã«ã¹ããŒãããç¶æ¿ãããããšãåæãšããŠããŸãã ã©ã®ã¹ããŒã·ã§ã³ããªã¹ãã§éžæãããŠããããå€æããæ¹æ³ã¯ïŒ ãã¬ãŒã³ããŒã·ã§ã³ã¢ãã«ã¯ ããã®ãããªç¶æ ãé 眮ããå ŽæãæäŸããããšã«ããããã®åé¡ã解決ããŸãã ããŒã¿ãå€æŽããããšãã«ã®ã¿æŒãããšãã§ãããä¿åããã¿ã³ãããå Žåãåæ§ã®åé¡ãçºçããŸãããã®ç¶æ ã¯ãã¢ãã«èªäœã§ã¯ãªããã¢ãã«ãšã®çžäºäœçšã«ãã£ãŠæ±ºå®ãããŸãã
ä»ãMVCã®ç¹æ§ãç¹å®ããæãæ¥ããšæããŸãã
- ãã¬ãŒã³ããŒã·ã§ã³ïŒãã¥ãŒãšã³ã³ãããŒã©ãŒïŒãšãã¡ã€ã³ã¢ãã«- åé¢ãã¬ãŒã³ããŒã·ã§ã³ãæ確ã«åé¢ããŸãã
- UIèŠçŽ ãã³ã³ãããŒã©ãŒïŒãŠãŒã¶ãŒå ¥åã«å¯Ÿå¿ïŒãšãã¥ãŒïŒã¢ãã«ã®ç¶æ ã衚瀺ããïŒã«åé¢ããŸãã ã³ã³ãããŒã©ãŒãšãã¥ãŒã¯ãïŒã»ãšãã©ã®å ŽåïŒã¢ãã«ãä»ããŠã®ã¿çŽæ¥å¯Ÿè©±ããå¿ èŠããããŸãã
- ãã¥ãŒïŒããã³ã³ã³ãããŒã©ãŒïŒãã¢ãã«ãèŠèœãšãããã«ããŸãã ããã«ãããè€æ°ã®ãŠã£ã³ããŠãçžäºã«çŽæ¥å¯Ÿè©±ããããšãªãåžžã«ææ°ã®ç¶æ ã«ããããšãã§ããŸã-ãã©ãŠã¶ãŒãä»ããåæ ïŒ Observer Synchronization ïŒã
ç¶ç¶ããã