æåã®éšåã®å 容ïŒ
â MVCãšã¯äœã§ããïŒ
â JS MV *ãã¬ãŒã ã¯ãŒã¯ãå¿ èŠã«ãªãã®ã¯ãã€ã§ããïŒ
â MV *ã¯ã©ãã§å¿ èŠã§ããïŒ
â éžæã®åé¡ïŒãªãã·ã§ã³ãå€ãããŸããïŒ
â TodoMVCïŒåŠç¿ãšæ¯èŒã®ããã®äžè¬çãªã¢ããª
â ãã¬ãŒã ã¯ãŒã¯ãéžæããããã®ææ¡ãããåºæº
â DojoãšJavaScriptãã¬ãŒã ã¯ãŒã¯ã®è€éã
â TodoMVCã³ã¬ã¯ã·ã§ã³ïŒTodoãã¹ãã¢ããªã±ãŒã·ã§ã³ã®å®è£ ãè¡ããããã¬ãŒã ã¯ãŒã¯ïŒ
â ã©ã®ãã¬ãŒã ã¯ãŒã¯ããã€äœ¿çšããå¿ èŠããããŸããïŒ
ãã¬ãŒã ã¯ãŒã¯ã®æ€çŽ¢ç¯å²ãçµã蟌ãããã«ããµã³ãã«ã®ããã€ãã®ãªãã·ã§ã³ãéžæããã®ã«åœ¹ç«ã€æ©èœã«åºã¥ããŠãé«ã¬ãã«ã®ãã¬ãŒã ã¯ãŒã¯ã®éžæãæäŸããããšèããŠããŸãã
ã¢ããªã±ãŒã·ã§ã³å ã®ã¿ã¹ã¯ãåé¢ããããã®æå°éã®ãœãªã¥ãŒã·ã§ã³ãåããæè»ãªãã®ãå¿ èŠã§ãã äžå®ã®æ¥ç¶æ§ãšRESTåæãã¢ãã«ããã¥ãŒïŒã³ã³ãããŒã©ãŒä»ãïŒãã€ãã³ãé§ååããŒã¿äº€æããã³ãã¬ãŒããããã³ããã²ãŒã·ã§ã³ïŒURLã¢ã³ã«ãŒçµç±ïŒããµããŒãããŸãã ã¢ãã«ãå€æŽããããšããã¥ãŒã¯ããã«å€æŽãããŸãã èªåã§ã¢ãŒããã¯ãã£ãé©åã«ç®¡çããããšæããŸãã çæ³çãªã®ã¯ãå€ãã®å€§äŒæ¥ãèªæã§ãªãã¢ããªã±ãŒã·ã§ã³ã®ããã«ãœãªã¥ãŒã·ã§ã³ã䜿çšããå Žåã§ãã ç§ã¯è€éãªãã®ãåŸãããšãã§ããã®ã§ããã¬ãŒã ã¯ãŒã¯ã®åšãã®æŽ»çºãªã³ãã¥ããã£ãèŠãããšæããŸããããªãã¯ãã€ã§ãç°¡åãªè³ªåã§ã¯ãããŸããïŒ MarionetteãChaplinãAuraãThorax ïŒã ãã«ãããŒã«ïŒ grunt-bbbãbrunch ïŒãæã€ããšãçæ³çã§ãã Backbone.jsã䜿çšããŸãã
Webçšã®ãã¹ã¯ãããã¬ãã«ã®ã¢ããªã±ãŒã·ã§ã³ã®åºç€ãå¿ èŠã§ã ã ãã®ãã¬ãŒã ã¯ãŒã¯ã¯ããã¹ãŠãæåã§çµã¿ç«ãŠãæ°žç¶æ§ïŒãã¡ã€ã«ã®ã¡ã¿ãã¡ãŒãæã€æ°žç¶ãªããžã§ã¯ããããã€ã¹ïŒãèšç®ãããããããã£ãããã³èªåæŽæ°ãã³ãã¬ãŒããå¿ èŠãšããªããé«ã¬ãã«ã®ã¢ãžã¥ãŒã«åŒMVCã§ããå¿ èŠããããŸãã ããã¯ãæåæ§æã§ã¯ãªããå€ãã®é£æ¥ãããã¬ãŒã ã¯ãŒã¯ãšã®äºææ§ã®ããã€ã³ããªãžã§ã³ããªç¶æ 管çã«å¿ èŠã§ãã é©åãªããã¥ã¡ã³ãã䜿çšãã¿ãŒã³ããã«ãããŒã«ïŒ ember.gemãember for brunch ïŒã䜿çšããå¿ èŠããããŸãã Ember.jsã䜿çšããŸãã
ãã³ãã¬ãŒãããªã³ã¶ãã©ã€ã§æ¥ç¶ãããã²ãŒã·ã§ã³ãäž»èŠãªã©ã€ãã©ãªïŒ jQueryãDojoãªã© ïŒãšã®çµ±åãé«éã§ã倧èŠæš¡ã¢ããªã±ãŒã·ã§ã³ã§ã¯ãŸã åäœããªãå¯èœæ§ã®ããMVCã³ã³ããŒãã³ãã®ç¶æ¿ããµããŒãããã軜éãªãã®ãå¿ èŠã§ãã è€éãªã¢ããªã±ãŒã·ã§ã³ãäœæããçµéšã®ãã人ãè¡ãå Žåã«æé©ã§ãã CanJSã䜿çšããŸã ã
Viewã䜿çšããŠãã¢ããªã±ãŒã·ã§ã³ã®ã«ãŒã«ã«åŸã£ãŠHTMLãšã³ã³ããŒãã³ããã«ã¹ã¿ãã€ãºããããšã«ããããŠãŒã¶ãŒã®è¡åã«é¢ããããŒã¿ãåéãã宣èšåã©ãããŒãå¿ èŠã§ãã MVCãŸãã¯ãã®ããªã¢ã³ããä»ããURLããã²ãŒã·ã§ã³ãšã¿ã¹ã¯å ±æã䜿çšãããã·ã³ãã«ãªãã¹ãã·ã¹ãã ã®ãµããŒãã ããã«ãããHTMLã§ç¬èªã®DSL ïŒãµããžã§ã¯ãæåèšèªïŒãæ§ç¯ããããã«HTMLã³ã³ãã€ã«ãè¡ãé¢é£ã©ã€ãã©ãªã«ã«ã¹ã¿ãã€ãºãããã¢ãããŒããæäŸãããŸãã ããã¯ãWebã³ã³ããŒãã³ããªã©ã®ãããã¯ãŒã¯ãã©ãããã©ãŒã èŠçŽ ã«å¿ èŠã§ãã ãŸã çµã¿ç«ãŠããŒã«ïŒ è§åºŠä»ãã·ãŒã ïŒãå¿ èŠã§ãã AngularJSã䜿çšããŸãã
èšå€§ãªã¢ããªã±ãŒã·ã§ã³ã®åªããåºç€ãå¿ èŠã§ããããã«ã¯ãå®çžŸã®ãããŠã£ãžã§ããã®ã€ã³ãã©ã¹ãã©ã¯ãã£ããã¹ãããŒãã£ã³ã°ãåããã¢ãžã¥ãŒã«ãå¿ èŠã§ãã ãããã-éåæã§ã·ã³ãã«ãªCDNãšã®çµ±åãã¢ãžã¥ãŒã«ãšãŠã£ãžã§ããïŒã°ã©ãããã£ãŒããããŒãã«ãªã©ïŒã®éžæãåªããå€èšèªïŒi18nãl10nïŒã è€éãªã¢ãŒããã¯ãã£ãäœæããã«ã¯ãOOPãMVCãããã³ãããã¯ãã«ããŒïŒã¢ãžã¥ãŒã«ïŒã®ãµããŒããå¿ èŠã§ãã Dojoã䜿çšããŸãã
YUIæ¡åŒµæ©èœã䜿çšããããã«æé©åããããã®ãå¿ èŠã§ã ã ã¢ãã«ããã¥ãŒãããã²ãŒã·ã§ã³ã®ãµããŒãã«ãããæ å ±ãããŸããŸãªæ¹æ³ã§è¡šç€ºãããã衚瀺ãªãã·ã§ã³ãçžäºã«åãæ¿ãããããã¢ããªã±ãŒã·ã§ã³ãç°¡åã«äœæã§ããŸãã ããã¯ããŠã£ãžã§ãã/ã³ã³ããŒãã³ããåããå®å šãªãœãªã¥ãŒã·ã§ã³ã§ãããã¢ããªã±ãŒã·ã§ã³ã®ã¢ãŒããã¯ãã£ãèšè¿°ããããšãã§ããŸãã ãã«ãããŒã«ïŒ yuiproject ïŒãååšããå ŽåããããŸãããä»ã®ããŒã«ã®ä»£ããã«ãªãå¯èœæ§ããããŸãã YUIã䜿çšããŸãã
MVCãã€ãã³ããããã²ãŒã·ã§ã³ããµããŒãããªãããã³ã³ãã¯ããªãŸãŸã§ãã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ããéã«æè»ã§ãéåæã€ã³ã¿ãŒãã§ã€ã¹ã§äŸåé¢ä¿ã®ãªãã·ã³ãã«ãªãã®ãå¿ èŠã§ã ã 詳现ãªããã¥ã¡ã³ããšãšãã«ãCoffeeScriptçšã«æé©åãããŠããŸãã Spineã䜿çšããŸãã
ããŒã¿ã¢ãã«ãšå®£èšåãã€ã³ãã£ã³ã°ã¹ã¿ã€ã«ã«åºã¥ããŠè€éãªåçUIãæ§ç¯ããããŒã«ãå¿ èŠã§ã ã ã¢ãã«ãå€æŽããããšãã®UIã®æŽæ°ã§ã¯ãããŒã¿ãã©ããã³ã°ã«ããåæ¹åãã€ã³ãã£ã³ã°ãšäŸåé¢ä¿ã®ãµããŒãã䜿çšããŸãã ããã¯ãä»»æã®ãã¬ãŒã ã¯ãŒã¯ãŸãã¯æ¢è£œã®ã¢ããªã±ãŒã·ã§ã³ã§ã䜿çšã§ããã¯ãã§ãã çµã¿èŸŒã¿ã®ãã³ãã¬ãŒããšç°¡åãªæ¡åŒµæ§ãå¿ èŠã§ãã KnockoutJSã䜿çšããŸãã
ã·ã³ãã«ãªWebã¢ããªã±ãŒã·ã§ã³ããµã€ãçšã®ãã®ã欲ãã ã ç§ã¯ããã«å€ãã®ã³ãŒãããããšã¯æããªãã®ã§ãããŸãå¹²æžããŸããã ã¿ã¹ã¯ã«éäžããããã®ã¯ãã¹ãã©ãŠã¶ã ç°¡åãªã€ãã³ãåŠçããªã¢ãŒããµãŒãã¹ãšã®ããåããæ¡åŒµæ§ãèšå€§ãªãã©ã°ã€ã³ã»ããã jQueryã䜿çšããŸãã
â éçºè ã¯ãæã人æ°ã®ãããã¬ãŒã ã¯ãŒã¯ã«ã€ããŠã©ãæããŸããïŒ
TodoMVCã®MV *ãã¬ãŒã ã¯ãŒã¯ãšãã®èšäºã®ç 究ã®äžç°ãšããŠãéçºè ã察象ã«èª¿æ»ãå®æœããŸããã 圌ãã¯ã©ã®ãã¬ãŒã ã¯ãŒã¯ãããé »ç¹ã«äœ¿çšããŸããããããŠæãéèŠãªã®ã¯ããªããããæšå¥šããã®ã§ããïŒ ãã®ãã¬ãŒã ã¯ãŒã¯ããããžã§ã¯ãã«ãªãã£ããã圌ãã¯äœãæããŸããïŒ
æãèå³æ·±ãçãã®ããã€ãã次ã«ç€ºããŸãã
Ember.js
é·æïŒã©ã€ããã¿ãŒã³ãšç£èŠå¯èœãªãªããžã§ã¯ãã®çµã¿åããã«ãããJavaScriptã®åäœãå€ãããŸããã æåã¯å°ãæ··ä¹±ããŠããããã«èŠãããããããŸããããã³ãŒãã®è²¬ä»»ãé©åã«åæ ããŠäœæ¥ãçµäºããŸãã ãã¹ãŠã説æãããããã«ãããªãè€éãªæ©èœãè¿œå ããã«ã¯æ°è¡ãããããšãããããŸããã Emberããªããã°ããããã®åãæ©èœãå®è£ ããã®ã¯éåžžã«å°é£ã§ãã
çæ ïŒ Emberã¯åŒãç¶ãããŒãžã§ã³1.0ã«å°éããå¿ èŠããããŸãã ã«ãŒã¿ãŒãEmberããŒã¿ãªã©ãå€ãã®ãã®ããŸã åããŠããŸãã æ°ããWebãµã€ãã¯éåžžã«äŸ¿å©ã§ãããä»ã®ãã¬ãŒã ã¯ãŒã¯ãç¹ã«Backboneã®ãããªEmberã®ããã¥ã¡ã³ãã¯ãããŸããã ãã¬ãŒã ã¯ãŒã¯ã«å€ãã®éæ³ããããããå°ãæãã§ãã äœããå£ããå Žåããã®çç±ãæ£ç¢ºã«ææ¡ããããšã¯ã§ããŸããã ãŸãã Emberã®ãšã©ãŒã¡ãã»ãŒãžã¯ãã°ãã°äžæ£ç¢ºã§ãã
ã察象ã ïŒäž»ãªèŠå ïŒ
aïŒãã€ã©ãŒãã¬ãŒãã³ãŒãïŒãã€ã³ãã£ã³ã°ãèšç®ãããããããã£ãåªãããã¬ãŒã³ããŒã·ã§ã³ã³ã³ãããŒã«ã¬ã€ã€ãŒïŒãåé¿ã§ããæ©èœã
bïŒéçºããŒã ã ç§ã¯ã«ãã¹ãã§ãããã€ã§ããã»ã«ããã®äŸ¡å€ãç¥ã£ãŠããŸãã ç§ã¯ç·ãä¿¡é Œãã=ïŒã
çæ ïŒããã¥ã¡ã³ãã Emberã«åªããããã¥ã¡ã³ãããã¥ãŒããªã¢ã«ã BackboneãAngularãªã©ã®ãã¬ãŒã ã¯ãŒã¯ãªã©ã®ã¹ã¯ãªãŒã³ãã£ã¹ãããªãããšã¯æ¬åœã«æ®å¿µã§ãã çŸåšãå®å šã§ã¯ãªãããã¥ã¡ã³ããæ¢ããŠããã³ãŒããæ¢ããŠããŸãã
çæ ïŒæ§æå¥çŽã ãšã³ããŒã¯ããªãã®ããã«å€ãã®å°ããªä»äºãåããŸãã ããã¯ãæè¿ã§ã¯ã¯ã©ã€ã¢ã³ãåŽã®ã¢ããªã±ãŒã·ã§ã³ãæ§ç¯ããæãç°¡åãªæ¹æ³ã§ãã
çæ ïŒåŠç¿ã®ãããå€ã Backboneã®ãããªä»ã®ãã¬ãŒã ã¯ãŒã¯ã®ããã«ååšããåå¿è åãã®ãã¥ãŒããªã¢ã«ãå€ããªãã®ã¯ãäžéšã¯å°ããªã³ãã¥ããã£ã«ãããã®ã§ãããããŒãžã§ã³1.0ã«åããã³ãŒãã¢ããªãã£ã®ããã ãšæããŸãã
é·æïŒãã€ã³ãã®å®¹æããã³ã³ãããŒã«ãšã®ç·å¯ãªçµ±åãç¬èªã®ã³ãŒãã®ç°¡åãªã¢ãžã¥ãŒã«æ§ã
çæ ïŒ EmberããŒã¿ãšã®å®å®ããçµ±åãšãREST APIãšåæãããçµ±åãããlocalStorageãµããŒããå¿ èŠã§ãããããã¯ãã¹ãŠå€¢ã®ãããªãã®ã§ãã
Backbone.js
ã察象ã ïŒã·ã³ãã«-4ã€ã®äž»èŠã³ã³ããŒãã³ãïŒã³ã¬ã¯ã·ã§ã³ãã¢ãã«ããã¥ãŒãã«ãŒã¿ãŒïŒã®ã¿ã StackOverflowã®å·šå€§ãªã³ãã¥ããã£ïŒãšã³ã·ã¹ãã ïŒãšå€ãã®ãœãªã¥ãŒã·ã§ã³ã MarionetteãVertebraeãªã©ã®é«æ¬¡ãã¬ãŒã ã¯ãŒã¯-å éšã«å€ãã®ã¹ããŒãã³ãŒãããããŸãã 誰ãããäœã¬ãã«ãã奜ã-ããªãã¯å®åçãªã³ãŒããããããæžãå¿ èŠãããããããªãã®ããã«äœãããã¢ãŒããã¯ãã£ãæã«å ¥ããªããã
ãå察ã ïŒç¶æ¿ã奜ãã§ã¯ãããŸãã-芪ãªããžã§ã¯ãã®å 容ãæ°ãããªããžã§ã¯ãã«ã³ããŒãããŸãã ãããã¿ã€ãã®ç¶æ¿ãå¿ èŠã§ãã ããã¯ã®äŸã§ãçŸå®ã®ã·ããªãªããèªãã§ããªãããšããããŸãã TODOã䜿çšãããã¥ãŒããªã¢ã«ãèªãã åŸãå°ãè€éãªã¢ããªã±ãŒã·ã§ã³ãäœæããæ¹æ³ãèŠã€ããããã«ãå€ãã®èª¿æ»ãè¡ãå¿ èŠããããŸãã
DocumentCloudïŒ BackboneãUnderscore ïŒã®ãããžã§ã¯ãã§ã¯ã AMDã®å ¬åŒãµããŒãã䜿çšããŸãã[ãã ããããã¯RequireJS 2.0ã®æ°ããshimïŒïŒã¡ãœããã®åé¡ã§ã¯ãããŸãã]ã
ã察象ã ïŒ Backboneã®æåã®äžå¯è§£ãªç 究ã®åŸãããã¯ãã¹ãŠéåžžã«å®çšçã§ããããšãå€æããŸããã å®çšæ§-é©åã«ç®¡çããã軜éã§ãåžžã«æŽæ°ãããã©ã€ãã©ãªãŒãé©åãªç°å¢ã«ãããŸãã UnderscoreãjQuery / Zepto ãç§ã®ã¹ã¿ãžãªã®ã»ãšãã©ã®ãããžã§ã¯ãã§äœ¿çšã§ããããŒã«ã®ãã¬ã³ããªãŒãªãµããŒãã
çæ ïŒ Backboneã®æäœæ¹æ³ã«é¢ãããã¥ãŒããªã¢ã«ã®æ°ã¯ãããŒãžã§ã³ã«ãã£ãŠç°ãªããŸãã ç§ã¯ä»ã®éçºè ã«BackboneãèŠãŠããããããŒãžã§ã³0.3ã®ã³ãŒããæžãããšã«ããŸããã ç¥ããã«ã åé¡ã¯ãããŸãããã Backboneã¯ãããä¿®æ£ã§ããŸãããããã¯ããããããã«é¢é£ããäž»ãªäžäŸ¿ã§ãã
çè«çã«ã¯ãäœã§ãåãããšãèšããŸããã Backboneã§ã¯ãç®ã®åã§å®æçã«ç¹°ãè¿ãããŸãã å°çãç§ã¯äžã¶æåã«å€ä»£ã®æ¹æ³ãšæè¡ã䜿ã£ãèšäºãèŠããããŸããã
ãã¬ãŒã ã¯ãŒã¯ã«å¯Ÿããç§ã®æ 床ã«é¢ä¿ãªããåççãªç·šéãšã¢ãããŒãã§ã³ãã¥ããã£ãä¿®æ£ã§ããã®ã¯ãã®åé¡ã§ãã ããããã³ãã¥ããã£ã®ãµããŒãã®ããã«ã Backboneãç§ãå°æ¬ããã«å€ããçç±ã§ãã
ãForã ïŒåççãªå¶éãªãã«æå°éã®æœè±¡åã®ã¿ãæäŸããŸã-ããŒãºã«å¿ããŠãããžã§ã¯ããçµã¿ç«ãŠãããšãå¯èœã«ããŸãã
çæ ïŒ Backbone.syncãæžãæãããåé€ããŸãã ããã¯HTTPãããã³ã«çšã«æ§ç¯ãããŠãããWebSocketæ©èœã«ããŸãé©å¿ããŸããã
ãã®ããã«ã ïŒåãå§ããã®ã¯éåžžã«ç°¡åã§ãç¥ãããã®è¯ãæ¹æ³ãæäŸããŸãã ããã¯æ¯èŒçããã«ã¹ã¿ãã€ãºå¯èœã§ãããããã䜿çšããŠããä»ã®å€ãã®äººã ãå©ããããšãã§ããŸãã
çæ ïŒããã©ã«ãã®ãã¥ãŒãã€ã³ãã£ã³ã°ããªããšããäºå®ïŒæå®ã§ããŸããïŒã åäžã®ããããã£ãå€æŽããããšãã«ãã¥ãŒå šäœãæŽæ°ããããšã¯äžçµæžã§ãã
REST APIã«ã¯å€ãã®å©ç¹ããããŸãããå€æ°ã®ã¬ã³ãŒãã«ã¯åé¡ãããïŒç¢ºãã«ãRESTã®åé¡ã¯ç¬èªã®ãã®ã§ããããŸã æ®ã£ãŠããŸãïŒãããŸããŸãªã¿ã€ãã®æäœãåŠçããããã®ããŸããŸãªURIã¹ããŒã ãååŸããéã«äžå¿«ãªåé¡ããããŸãã
Angularjs
è³æ ïŒ
aïŒåæ¹åã®ããŒã¿ãã€ã³ãã£ã³ã°ã¯éåžžã«åŒ·åãªã¢ãããŒãã§ãã äžé£ã®ã€ãã³ããæŽçããã®ã§ã¯ãªããã¢ãã«ãšç¶æ ã«ã€ããŠãã£ãšèããŸãã ã¢ãã«ã¯å¯äžã®çå®ã®æºã§ãã
bïŒã¹ããŒãã AngularJSã¯ç°¡åã«ããŠã³ããŒãã§ããŸãã innerHTMLã®ä»£ããã«ããŒããæ§ç¯ããããšã§ãã³ãã¬ãŒãåãããçè«çã«ã¯çç£æ§ãåäžããŸãã
cïŒææ°ã®ãã©ãŠã¶ããã³/ãŸãã¯ãããthçŽã«ãã£ãŠå°ãããŠããå Žåã¯ãjQueryãªãã§è¡ãããšãã§ããŸãã
çæ ïŒã¢ãã«ã«ãã£ãŠå€æŽãããUIç¶æ é·ç§»ã瀺ãããšãã§ããããã«ããããšæããŸãã ã€ãŸãã ng-show / ng-hideã䜿çšããèŠçŽ ã¯ãåçŽãªå®£èšã§é衚瀺ãŸãã¯æãããã¿ãããšæããŸãã
é·æ ïŒããã¯éåžžã«çŽæçã§ãåªããããã¥ã¡ã³ãããããŸãã ããŒã¿ãã€ã³ãã£ã³ã°ããã¥ãŒããŒã¹ã®HTMLãã¹ã³ãŒããžã®ã¢ãããŒããæ°ã«å ¥ã£ãŠããŸãã Backbone / ThoraxããAngularã«åãæ¿ããŸããããæ¯ãè¿ãããšã¯ãããŸããã§ããã Chromeã®æ°ããBatarangã¢ããªã³ã¯Chromeéçºè ããŒã«ãšçµ±åããã AngularããŒã¿æ§é ãžã®ãªã¢ã«ã¿ã€ã ã¢ã¯ã»ã¹ãæäŸããŸãã
çæ ïŒãã©ãã°ã¢ã³ããããããªã©ã®æ©èœã®çµã¿èŸŒã¿ãµããŒããå¿ èŠã§ãããããã¯GitHubã§å©çšå¯èœãªå€éšã³ã³ããŒãã³ããä»ããŠè¿œå ã§ããŸãã åå©çšã«é©ãããµãŒãããŒãã£ã®ã³ã³ããŒãã³ãããã£ãšèŠããã§ãã ããã¯ã AngularJSãåãå·»ããšã³ã·ã¹ãã ãããæçããããã®æéã®åé¡ã§ããã jQueryã®ãããªã³ãã¥ããã£ã®ããã«ãã¢ã¯ã»ã¹å¯èœã§å€æ§ã«ãªããšæããŸãã
é·æïŒå®åã³ãŒããå€§å¹ ã«åæžããã³ã³ããŒãã³ããä»ããŠã³ãŒããåå©çšã§ããããã«ããå€ãã®è€éãªæ©èœãHTMLã§å±æ§ãèšè¿°ããã®ãšåããããç°¡åã«ãªãããã«HTMLæ§æãæ¡åŒµããäŸåé¢ä¿ã®å®å šãªèª¬æã®ãããã§ãã¹ããéåžžã«ç°¡åã«ãªããŸãã
DOMãçŽæ¥å¶åŸ¡ããããšãªãã jQueryã䜿çšããã«éèŠãªã¢ããªã±ãŒã·ã§ã³ãäœæã§ããŸãã ãã®ãããªæ¥œåšãäœãããšã¯æ¬åœã®ã¹ãã«ã§ãã
ãAgainstã ïŒåœŒå¥³ã®åŠç¿ãããå€ã¯Backboneã®åŠç¿ãããå€ïŒãã¹ã¿ãŒã«ãšã£ãŠéåžžã«ç°¡åã§ãïŒããããããã«é«ãã§ãããçµæã¯äŸ¡å€ããããŸãã ããã¥ã¡ã³ããæ¹åãããå¯èœæ§ããããŸãã
ããã¯ã¢ãŠã
é·æ ïŒåžžã«äœ¿çšããããã§ã¯ãããŸãããã KnockoutJSã¯åäžããŒãžã®ã¢ããªã±ãŒã·ã§ã³ã«æé©ã§ãã ãªããžã§ã¯ããå€æŽããããã®éåžžã«ç°¡åãªãµãã¹ã¯ãªãã·ã§ã³ã 芳枬å¯èœãªé åã䜿çšãããããããããã¯ããŒã³ ãã³ã¬ã¯ã·ã§ã³ãã¥ãŒãçšã®ã¯ããã«åªããAPIã ãŸãã芳å¯ããããªããžã§ã¯ãã®ãšãã§ã¯ããªã©ã®ã«ã¹ã¿ã ã€ãã³ã
çæ ïŒAPIãæ¡åŒµããã®ã¯é£ãããšæããŠããŸãã 倧èŠæš¡ãªã¢ããªã±ãŒã·ã§ã³ïŒã³ãã¥ããã£ã®ãµããŒããªã©ãå«ãïŒã§Backboneãéžæããããšããå§ãããŸãã
ãForã ïŒããŒã¿ãã€ã³ãã£ã³ã°ã®ã¡ã«ããºã ãšãã®äŸ¿å©ãªäœ¿çšã奜ãã§ãã ç¹ã«ããã³ãã¬ãŒããå¶åŸ¡ããžãã¯ãžã®ãã€ã³ãã«çœ®ãæããããããšãæ°ã«å ¥ã£ãŠããŸãã
çæ ïŒã¢ããªã±ãŒã·ã§ã³æ§é ã«é¢ãããã¹ããã©ã¯ãã£ã¹ã¬ã€ãããªãã®ã¯æªãããšã§ãã ãã¬ãŒã ã¯ãŒã¯ã¯ããã¥ãŒã¢ãã«ãæã£ãŠããã ãã§ãªããé©åã«æ§é åããããã¥ãŒã¢ãã«ãèšè¿°ããã®ã«åœ¹ç«ã¡ãŸããã 倧ããªã¢ã³ãããŒãžé¢æ°ã§éåžžã«ç°¡åã«çµäºããŸãã
éå Ž
é·æ ïŒæ§æçã«-Dojoã¯éåžžã«åçŽã§ãã ããã¯ãéåžž6 KBã®ãµã€ãºã®åæããŒããŒãã¡ã€ã«ã䜿çšããåçã§å ç¢ãªãã«ãã«é©ããŠããŸãã AMDäºæïŒããŒãåŸïŒã§ãããããéåžžã«ã³ã³ãã¯ãã«ãªããDOMã®åºæ¬çãªäœæ¥ããè€éãªSVGãVMLããã£ã³ãã¹ã«è³ããŸã§å€ãã®æ¡åŒµæ©èœãåããŠããŸãã DijitãŠã£ãžã§ããã·ã¹ãã 㯠ã䜿ãããããšæ¡åŒµæ§ã«åªããŠããŸãã ããã¯éåžžã«é©åã§å®å šãªããŒã«ããã¯ã¹ã§ãã
çæ ïŒdojo / _base / declareæ©èœã¯100ïŒ å³å¯ã«ç®¡çãããããŒã«ã§ã¯ãããŸããããäžäœäºææ§ã®ããã«ããã€ãã®ãªãŒããŒã¬ã€ããããŸãããããã¯ã»ãšãã©Dojo 2.0ã§ä¿®æ£ãããŸã ã
ã察象ã ïŒGoodã³ã³ããŒãã³ãïŒã¿ããããŒã¿ããŒãã«ããã©ãŒã ãããŒãžã£ãŒ...ãã¹ãŠã®ãã©ãŠã¶ãŒã§åãã åãAMDã ããŒã¿ã·ãã¥ã¬ãŒã¿ã䜿çšããç°¡åãªãã¹ãã AMDã®ãããã§ä»ã®ãã¬ãŒã ã¯ãŒã¯ãšããŸãçµ±åã§ããŸãïŒ JMVCãšçµ±åããŸã ïŒã
çæ ïŒãããžã§ã¯ãã¯ãå€ãã³ã³ããŒãã³ãçšã«ããã©ã«ãã§æ§æãããŠããŸãã å®å šã«html5ã§ã¯ãããŸããã ããã¥ã¡ã³ãã¯ãŸããŸãã§ãã æšæºåã®æªãã·ã¹ãã ïŒããªã³ã¶ãã©ã€ãã§ã®ãã€ã³ãã£ã³ã°ãªãïŒã
ãã
é·æ ïŒ YUI3ã¯ãBackboneãªã©ã®ãã¹ãŠã®å©ç¹ãå«ããã¢ãžã¥ãŒã«åŒã§èªç±ã«å®è¡ã§ããã³ã³ããŒãã³ãã©ã€ãã©ãªã§ãã ç§ã®æèŠã§ã¯ãããã¯ããŒã³ã®æŠå¿µã®äžéšãæ¹åããããã€ãã®ããšãå ±æããŸãïŒããšãã°ãå±æ§ã¯ä»»æã®ãªããžã§ã¯ãã«æ··åã§ããå¥åã®ã¢ãžã¥ãŒã«ã§ã-ã€ãã³ãã®ãã¢ãžã¥ãŒã«ããæ··åã§ããŸãïŒã
çæ ïŒ YUI3ãEmberããã®èªåé ç·ããµããŒãããŠããããšã確èªããããšæããŸãã ããã¯ãšã³ããŒã«ãšã£ãŠæ¬åœã«çŽ æŽãããææã ãšæããŸãã ããã§ãªããã°ã YUI3ã¯å¿ èŠãªãã®ãèŠã€ããããšãã§ããåªããã³ã³ããŒãã³ãã©ã€ãã©ãªã ãšæããŸãã æ¹åãããAMDäºææ§ã¢ãžã¥ãŒã«ããŒããŒãèŠããã ä»æ¥ã¯åé¡ãªãåäœããŸãããAMDã¢ãžã¥ãŒã«ã§æ°ãããããžã§ã¯ããéå§ãã YUI3ããã®ä»ã®ãµãŒãããŒãã£ã®ãã®ãAMDã䜿çšããAMDã³ã³ããŒãã³ãã«æ¿å ¥ã§ãããšããã§ãããã
JavascriptMVC
ã察象ã ïŒãã¹ãŠã®ããŒã«ããããã«äœ¿ãããç¶æ ã§ãããããŒã ãå®è¡ããŠã¢ã»ã³ããªãéå§ããããã ãã«æ®ããŸãã ç§ã¯6ãæ䜿çšããŸããããæ¬åœã«è¯ãã£ãã§ãã
çæ ïŒç§ãèŠããã®ã¯ã次ã®ããŒãžã§ã³ã®éçºãã¹ããŒãã¢ããããããšã ãã§ãã éçºè ã¯åé¡ãèªèããŠè§£æ±ºããŸãããããã»ã¹ã¯ç°ãªãå ŽåããããŸã-ä¿®æ£ããŠè§£æ±ºçãéä¿¡ãããããã€ãã®åé¡ã«ã€ããŠã¯æ°ãæã§ã¯ãªã-ãã®åŸãããããäœæããŠãªã¯ãšã¹ãããã«ã§ããŸãã
ããªã¢
é·æ ïŒ Mariaã¯çŽç²ãªMVCãå®è£ ããããã®ãã¬ãŒã ã¯ãŒã¯ã§ãããããMVCãã¬ãŒã ã¯ãŒã¯ã§ããããšã«çŠç¹ãåœãŠãŠããŸãã ãã以äžã§ããã以äžã§ããããŸããã ãã¹ãŠãã·ã³ãã«ã§ãã
çæ ïŒãœãŒã¹ã³ãŒãã§æžãããããã¥ã¡ã³ããããå°ãå€ãã®ããã¥ã¡ã³ããšããã€ãã®ãã¹ãã±ãŒã¹ã Mariaã§ã®MVCã®å®éã®äœ¿çšã®åºæ¬ã瀺ããã¥ãŒããªã¢ã«ã¯ããŸããããŸãã
Cujo.js
ã察象ã ïŒå®éã®ã¢ããªã±ãŒã·ã§ã³ã®å ŽåãMV *ã¯ããã«äœ¿çšã§ãããã®ã§ã¯ãªããæãéèŠãªããŒã«ãããã¯ããã«äœ¿çšã§ããå Žåãã»ãšãã©ã§ãã cujo.jsã䜿çšããŠãããã¯ã¹ãå®çŸ©ããŸãã
ã¯ãã cujo.jsã«ã¯ãã¥ãŒãã¢ãã«ãã³ã³ãããŒã©ãŒãªã©ãäœæããããã®é«ã¬ãã«ã®MV *ã®ãããªæ©èœããããŸãããåã¢ããªã±ãŒã·ã§ã³ã¯ç°ãªãã100ïŒ ã®ãœãªã¥ãŒã·ã§ã³ã«ãªããã¬ãŒã ã¯ãŒã¯ã¯ãããŸããã cujo.jsã¯ãã¿ããªãåã°ããããšãã代ããã«ãäœã¬ãã«ã®ããŒã«ãã¢ãŒããã¯ãã£ã®ã«ã¹ã¿ãã€ãºãããã³ä»ã®MV *ãã¬ãŒã ã¯ãŒã¯ãçµã¿åãããŠæ¡åŒµããããšãã§ããè±å¯ãªãã©ã°ã€ã³ã·ã¹ãã ãæäŸããŸãã
誰ãã®ã¢ãŒããã¯ãã£ã«ã¢ããªã±ãŒã·ã§ã³ãé 眮ãã代ããã«ãã¢ããªã±ãŒã·ã§ã³ã«æé©ãªã¢ãŒããã¯ãã£ãäœæããŸãã
ãå察ã ïŒJavaScriptã®å€§éšåã¯å®å šã«æºåãæŽã£ãŠãããã倧èŠæš¡ãªã¢ããªã±ãŒã·ã§ã³ãéçºããããã®ãã¬ãŒãã³ã°ãåããŠããŸããã ãããã®ã»ãšãã©ã¯ãèšèšãã¿ãŒã³ãšã¢ãŒããã¯ãã£ã®ååšãèªèããŠããŸããã
cujo.jsã¯ä»ã®ãã®ãšã¯éåžžã«ç°ãªããããAPIãšã³ãŒããµã³ãã«ãžã®åãªãåç §ä»¥äžã®ãã®ãå¿ èŠã§ãã ãã¥ãŒããªã¢ã«ãææãããã³æè²çšã®äŸããªããã°ã cujo.jsã¯èŠãç®ãå¥åŠã§æ°ã®ãããããã«èŠããŸãããããã«ããã¥ã¡ã³ããäœæãããäºå®ã§ãã
Extjs
é·æ ïŒ ExtJSã¯Ext Designerã§æé©ã«æ©èœãããšæããŸãã ä»ã®GUIãã¬ãŒã ã¯ãŒã¯ããåé¢ããããããããã°ã©ããŒä»¥å€ã®ãŠãŒã¶ãŒãUIãã¢ãã¯ã§ããããã°ã©ããŒã¯ç©ºçœãåããããšãã§ããŸãã ç§ã®æèŠã§ã¯ã Backboneãªã©ã®MVCãã¬ãŒã ã¯ãŒã¯ãšã®æ¯èŒã¯ééã£ãŠããŸããExtJSã®åŒ·ã¿ã¯ã軜éã®Webã¢ããªã±ãŒã·ã§ã³ã§ã¯ãªãããªãããªGUIãäœæããããšã«ãããŸãã
åçšããªã¢ãŒããªãã£ã¹ããªããã¢ããªã±ãŒã·ã§ã³ã®å ŽåãJavaScriptãœãªã¥ãŒã·ã§ã³ã«é¢ããŠã¯ExtJSãæé©ãªéžæè¢ã§ãããšæããŸãïŒ GWTãªã©ãé€ãïŒã ãããªãã¯Webã¢ããªã±ãŒã·ã§ã³ã®å ŽåãããŒã¯ã¢ããããã詳现ã«å¶åŸ¡ã§ããïŒãããŠå®å šã«ã°ã¬ãŒã¹ãã«ãã°ã©ããŒã·ã§ã³ãå®çŸããïŒãã®ããããŸãã
ãAgainstã ïŒä»ã®å€ãã®çŸä»£ã®æ§é ãã¬ãŒã ã¯ãŒã¯ãããé«ããšã³ããªãŒãããå€ãæã£ãŠããŸãã , ExtJS , , , .
«» : , ExtJS 4 â MVC . Dojo , , ExtJS , .
ExtJS , , HTML. , , HTML .
, , - . , DOM .
«» : . ExtJS , , . , , â .
«» : ExtJS â RIA . , , HTML JavaScript, . ExtJS , HTML, , , , UI.
«» : ⊠, , , . , â , . , Sikuli , Selenium .
Batman
«» : . â .
«» : , , Shopify , , .
â å®éšããããšãæããªãã§ãã ãã
, . ( ) , .
: , Batman.js . CoffeeScript- Batman.js , . , . , , Batman.js , .
, , , .
â MV*
MV* , , , Views, , . .
, MVC, .
. , Backbone , , . Backbone (, ), . Initializer .Derick Bailey â Marionette
, MVC . â , , .
, Marionette . â , ( ) , .
Marionette TodoMVC, Backbone , MV*.
JavaScript MVC, . , API , , .Dustin Boston â Aura
, , , MV* . « », â , - . , , JavaScript .
J2EE. , «PHP Objects, Patterns, and Practice», Matt Zandstra, , ! J2EE , , URL . , , , .
J2EE , .
â ãããã«
, -, : , . , .
TodoMVC . , , , , .
, .
, TodoMVC Sindre Sorhus .
: Addy Osmani â - Chrome Google. JavaScript, : « JavaScript » " Backbone ", Modernizr JQuery . " Yeoman " â .