ãã®èšäºã¯ã翻蚳äœæ¥ã®éã«é¢ããŠ2ã€ã®éšåã«åãããŠããŸãã 2çªç®ã®éšåã¯éããªã衚瀺ãããŸãã
å 容
çãã¬ãã¥ãŒ
1ã¯ããã«
2å¥çŽæ³šé
3ã³ã³ããŒãã³ããšã¢ãŒããã¯ãã£
4å¥çŽé¢ã®ç·šé
4.1ããŒãã®äœæ
4.2æ¥ç¶ãã€ã³ããšãªã³ã¯
4.3è©è°äŒã®ç¶æ¿
4.4ã³ã³ãã€ã«ææ³ã®å¶é
5å¥çŽã©ã€ããµã€ã¯ã«
5.1å¥çŽã®ã³ã³ãã€ã«ã®ã¯ããŒãºã¢ãã
5.2å¥çŽæ¹æ³ã®ã¬ã€ã¢ãŠã
5.2.1ã¯ã©ã¹ãšã€ã³ã¿ãŒãã§ãŒã¹
5.3ã©ã³ã¿ã€ã ã§ã®å¥çŽã®åäœ
5.3.1å¥çŽã®ååž°
5.4å€ãå€ã®åŒã®ç¹æ®ãªã±ãŒã¹
6ãã£ã¹ã«ãã·ã§ã³
7çµè«
8è¬èŸ
åç §ãªã¹ã
ãã£ããã»ãã³ã»ã«
2011幎1æ12æ¥
çãã¬ãã¥ãŒ
ãã®èšäºã§ã¯ãJavaã³ã³ãã©ã¯ãããã°ã©ãã³ã°çšã®æ°ããã©ã€ãã©ãªã§ãããModern JassïŒJohannes RiekenïŒã®åŸç¶ã§ããJavaçšã³ã³ãã©ã¯ãïŒCofojaïŒã玹ä»ããŸãã ãã®ã©ã€ãã©ãªã¯ã ã¹ã¿ãã®åå¥ã®ã³ã³ãã€ã«ã«åºã¥ããŠå è¡æŠç¥ãæ¹åããŸãããã¢ãããŒã·ã§ã³åŠçããã€ãã³ãŒãã€ã³ã¹ãã«ã¡ã³ããŒã·ã§ã³ãªã©ãåãJavaãã¯ãããžãŒã䜿çšããŠããŸãã
Contracts for Javaã¯ãEiffelèšèªã«ãã£ãŠéæãããå ã®Design By Contractã¢ã€ãã¢ãé£æ³ãããè¡šçŸåè±ããªã³ã³ã¹ãã©ã¯ãã®ã»ããã§ããããªãºã ãä¿é²ããŸããããã«ãããã³ã³ãã€ã«ããã»ã¹ã§ä¿¡é Œæ§ãå®è¡ã匷å¶çãªæ§ãããã«éäžã§ããŸãã
ã¯ããã«
ã³ã³ãã©ã¯ãããã°ã©ãã³ã°ã¯ããªããžã§ã¯ãæåãœãããŠã§ã¢ãæ§ç¯ãããã©ãã€ã ã§ããããã¯ãBertrand Mayerã«ãã£ãŠæåã«èšè¿°ãããçµã¿èŸŒã¿ã®Design By Contractã³ã³ã¹ãã©ã¯ããåããEiffelããã°ã©ãã³ã°èšèªã®ãããã§åºãŸããŸããã åºæ¬çã«ãããã«ãããå¥çŽãšåŒã°ãããœãããŠã§ã¢å¶çŽã®ããå¶çŽã«ãããã¯ã©ã¹éå±€é¢ä¿ãæ¡åŒµãããŸãã Mayerã®å ã®æã§ã¯ããããã¯ãã¹ãŠã®ã¯ã©ã¹ã€ã³ã¿ãŒãã§ã€ã¹ã«å¯Ÿããåææ¡ä»¶ãšäºåŸæ¡ä»¶ã®äž¡æ¹ãšããŠæ©èœããHoareããžãã¯ãšã¯ã©ã¹äžå€æ¡ä»¶ã«äŒŒããäºåæ¡ä»¶ãšäºåŸæ¡ä»¶ã®ã¡ãœãããšããŠè¡šçŸãããŸããã å¥çŽã¯ã代çBarbara Liskovaã®ååã«åŸã£ãŠç¶æ¿ã§ããŸãã
ã³ã³ãã©ã¯ãããã°ã©ãã³ã°ã¯ãåºæ¬çãªã€ãã£ãªã ãšããŠå°æ¬ãããEiffelèšèªã®å ã®å®è£ ã§ã¯éåžžã«æåããŠããŸãããJavaãå«ãä»ã®èšèªã«ããŸããŸãªã¬ãã«ã§æåããŠãšã¯ã¹ããŒãããã³é©åãããŠããŸãã
Javaã®å¥çŽã¯ãµãŒãããŒãã£ã®ã©ã€ãã©ãªã«äŸåããŠããŸã èšèªèªäœã«ã¯ãJava 6ã®ãããªæªéçºã®ã¢ãµãŒã·ã§ã³ã®ã¿ãå«ãŸããŠããŸããè¿å¹ŽãJMLãC4JãContract4JãJASSãããã³Cofojaã®ããŒã¹ãšãªã£ãŠããåè¿°ã®Modern Jassãªã©ãå€ãã®åªåã代æ¿æ段ããããããŸããã
Cofojaã¯ãJavaã®å¥çŽããã°ã©ãã³ã°ã«ç¹åããå®å®ããç¬ç«ããã©ã€ãã©ãªãäœæããããã«ã以åã«ç¥ãããŠãããã¹ãŠãã³ã³ãã€ã«ããåè¿°ã®ã©ã€ãã©ãªã«åå¥ã«å°å ¥ãããèå³æ·±ãã¢ãããŒããæ¹åããŸããã
- Javaã¢ãããŒã·ã§ã³ã䜿çšããç°¡åãªå¥çŽä»æ§ïŒContract4JãModern JassïŒ
- æšæºã³ã³ãã€ã©APIïŒModern JassïŒã«ããåæã³ã³ãã€ã«ã䜿çšãããå¥çŽã§ã®JavaåŒã®å®å šãµããŒã
- æ§æãšåã®ã³ã³ãã€ã«æéã®ç¢ºèªïŒContract4Jãªã©ãã³ã³ãã©ã¯ãã®åŒã®å®è¡æã®è§£éãªãïŒ
- ãã€ãã³ãŒãã®æžãæãã䜿çšããŠãå¥çŽãã¿ãŒã²ããã«ãªã³ã©ã€ã³ããã³ãªãã©ã€ã³ã§ãªã³ã¯ããŸãã ïŒC4JãContract4JãModern JassïŒ
- ãŸãã軜éã³ãŒãã¯å°æ°ã®äŸåé¢ä¿ã«åºã¥ããŠããŸãïŒç¹ã«ãContract4Jã®å Žåã®ããã«AspectJãšã®äŸåé¢ä¿ã¯ãããŸããïŒ
ãã®å®è£ ã®äž»ãªè²¢ç®ã¯ãAOPãã¯ããã¯ã«è§ŠçºãããJavaã³ã³ãã€ã©æšæºã®äœ¿çšã«åºã¥ããŠModern Jassã§æ瀺ãããã¢ãã«ã®ã³ã³ãã€ã«ã®æ¹åãããããŒãžã§ã³ã§ãããã¹ã¿ããšä»®æ³ãªããžã§ã¯ãïŒã¢ãã¯ïŒãçæããŸãã
ã»ã¯ã·ã§ã³2ãš3ã§ã¯ãCofojaã©ã€ãã©ãªãšãã®äœ¿çšã®æŠèŠã説æããã»ã¯ã·ã§ã³4ãš5ã§ã¯ãå¥çŽã®è¡šç€ºã®è©³çŽ°ãå éšããã®å¥çŽèªäœã®å®è£ ã«ã€ããŠèª¬æããŸãã
2å¥çŽæ³šé
ãã¹ãŠã®Cofojaã³ã³ã¹ãã©ã¯ãã¯ãJavaã¢ãããŒã·ã§ã³ã®å°ããªã»ããïŒReuiresãEnsuresãInvariantãEiffelããçŽæ¥åçšã䜿çšé »åºŠã®äœãThrowEnsuresããã³ContractedïŒã§è¡šãããŸãã æåã®4ã€ã®æ³šéã¯ãå¥çŽãã¹ããŒãã¡ã³ãã®ãªã¹ããšããŠå®çŸ©ããããã«å°å·ãããŸãïŒã¹ãããã1ãåç §ïŒ
<ã³ãŒã> @InvariantïŒ "ãµã€ãºïŒïŒ> = 0"ïŒ ã€ã³ã¿ãŒãã§ã€ã¹ã¹ã¿ãã¯<T> { public intãµã€ãºïŒïŒ; @RequiresïŒ "sizeïŒïŒ> = 1"ïŒpublic T peekïŒïŒ; @RequiresïŒ "sizeïŒïŒ> = 1"ïŒ @EnsuresïŒ{ ããµã€ãºïŒïŒ==å€ãïŒãµã€ãºïŒïŒïŒ-1ãã ãçµæ==å€ãïŒããŒã¯ïŒïŒïŒã }ïŒ ãããªãã¯TãããïŒïŒ; @EnsuresïŒ{ ããµã€ãºïŒïŒ==å€ãïŒãµã€ãºïŒïŒïŒ+ 1ãã ãããŒã¯ïŒïŒ==å€ãïŒobjïŒã }ïŒ public void pushïŒT objïŒ; } </ code>
ãã©ã°ã¡ã³ã1ïŒå¥çŽã®ããã¹ã¿ãã¯ã®äŸã
Eiffelãšåæ§ã«ãANDããã³ORããŒã«æŒç®åã䜿çšããŠç¶æ¿ãã§ãŒã³ã®ãã©ã°ã¡ã³ããæ§æããããšã«ãããã³ã³ãã©ã¯ããç¶æ¿ã§ããŸãã
ãããã®ã¢ãããŒã·ã§ã³ã¯ãåºæ¬çãªå¥çŽä»æ§ã®å®å šãªã»ãããæäŸãããã®äžã§ãããè€éãªåäœãç°¡åã«æ§ç¯ã§ããŸãã å®éãã¹ããŒãã¡ã³ãã«ã¯ä»»æã®JavaåŒãå«ããããšãã§ããŸãã Javaã§èšè¿°ãããæ€èšŒã¯ãCofojaã³ã³ãã©ã¯ãã§èšè¿°ã§ããŸãã
Cofojaã¯ããã®ç®çã®ããã«å®çŸ©ãããŠããããã«ãJMLãJASSãªã©ã®ããã±ãŒãžã«å°å ¥ãããé©æ°çã§å°éçãªæ©èœãæäŸããããšã¯ããŠããŸããã 代ããã«ãã³ã¢æ©èœã®ãŠãŒã¶ããªãã£ãšã¢ã¯ã»ã·ããªãã£ã«çŠç¹ãåœãŠãŠããŸãã Javaãªã©ã®æ¢åã®èšèªã®ã³ã³ã¹ãã©ã¯ãã®é åå šäœã«å°ãã®æ©èœãè¿œå ããããšãããè©Šè¡é¯èª€ãããã¿ã¹ã¯ã§ãããJavaã³ã³ãã©ã¯ãããã°ã©ãã³ã°ã©ã€ãã©ãªã§ã®ä»¥åã®è©Šã¿ã¯ããã°ãã°ã³ã³ãã©ã¯ãæ©èœãéšåçã«ãµããŒãããããšã«ãªããŸããïŒããšãã°ãJMLã¯ãæé; ãžã§ããªãã¯åã䜿çšããŠã³ãŒããã³ã³ãã€ã«ãããšãçŸä»£ã®Jassã¯å€±æããã³ãŒããŸãã¯ãã€ãã³ãŒãã®æäœãæ§ããã©ã€ãã©ãªã¯ãã€ã³ã¿ãŒãã§ã€ã¹ã®çŸ©åã®ã¿ãåãå ¥ããããšãã§ããŸãã
Cofojaã®ç®æšã®1ã€ã¯ãJavaã³ãŒãã®å¯èœãªéãå€ãã®ããªãšãŒã·ã§ã³ãã䜿ãããããšå埩å¯èœæ§ãè¡šçŸã§ãã圢ã§åãå ¥ããããšã§ãã 次ã®èšäºã§ã¯ãCofojaã§ã®å¥çŽã®å®è£ ã«ããåºæ¬çãªææ³ã«ã€ããŠèª¬æããŸãã ãããã°ãªã©ã®è£å©çãªæ©èœã¯ãé©åãªå Žæã§ã®ã¿èšåãããŠããããããã®èšäºã®å€éšã«ããç¬ç«ããç 究ã«å€ããŸãã
3ã³ã³ããŒãã³ããšã¢ãŒããã¯ãã£
ãã©ã°ã¡ã³ã2ïŒã³ã³ãã€ã«ããã³å±éããã»ã¹
ãã©ã°ã¡ã³ã2ã¯ãCofojaã³ã³ãã©ã¯ããæå¹ã«ããã³ã³ãã€ã«ããã³å®è¡ããã»ã¹ã説æããŠããŸãã ã³ã³ãã©ã¯ãã¯ãã³ã³ãã€ã«æãšå®è¡æã®äž¡æ¹ã§ãJavaããŒã«ãã§ãŒã³ã䜿çšããŠããŸããŸãªãšã³ããªãã€ã³ãã§çµ±åãããŸãã
- Javaãã³ã³ãã€ã«ããåã«ããœãŒã¹ãããªããã»ããµã«ãã£ãŠèªã¿åããããšããã«ã ãã®æé ã§ã¯ãœãŒã¹ãã¡ã€ã«ãå€æŽãããªãããšã«æ³šæããŠãã ããã ãã®æä»çãªç®çã¯ãããã§ãªããã°ãã³ãã©ãŒã®æ³šéã§å©çšã§ããªãã£ãæ å ±ãåŒãåºãããšã§ãïŒä»¥äžãåç §ïŒã Javaã³ã³ãã€ã©ã«com.sun.sourceããã±ãŒãžã䜿çšããéæšæºAPIãããå Žåãããªããã»ããµã¯äžèŠã§ã
- 泚éããã»ããµãªã©ã®Javaãã¡ã€ã«ãã³ã³ãã€ã«ãããšãã 泚éããã»ããµã¯ãå¥çŽã³ãŒããçŸåšã®åå¥ã®ãã€ãã³ãŒããã¡ã€ã«ã«ã³ã³ãã€ã«ãã責任ããããŸãã
- ã¯ã©ã¹ã®ããŒãäžã«ãJavaãšãŒãžã§ã³ããšããŠãJavaããã°ã©ã ãèµ·åããããã®ã¢ãžã¥ãŒã«ã®ãã©ã°ã€ã³ã JavaãšãŒãžã§ã³ãã¯ãã³ã³ãã©ã¯ãã¯ã©ã¹ã®ãã€ãã³ãŒããæžãæããŠãã³ã³ãã©ã¯ããã¿ãŒã²ããã«æ¥ç¶ããŸãã
- ãªãã·ã§ã³ã®ã¹ãããã Javaããã°ã©ã ã®èµ·åã®å€åŽã§ãéåžžã®ã³ã³ãã©ã¯ããªãã®ãã€ãã³ãŒãïŒæšæºã¯ã©ã¹ãã¡ã€ã«ã®åœ¢åŒïŒãšå¯Ÿå¿ããã³ã³ãã©ã¯ããã€ãã³ãŒãïŒã³ã³ãã©ã¯ããã¡ã€ã«ã®åœ¢åŒïŒãçµã¿åãããŠãæ¢åã®ã³ã³ãã©ã¯ããšã¯ã©ã¹ãåæããç¬ç«ããããã»ã¹ãšããŠå®è¡ã§ããããŒã«ãããã¹ãããã
Cofojaã«ã¯ãã³ãã³ãã©ã€ã³ããç°¡åã«å®è¡ã§ããããã«ãæåã®2ã€ã®ã¹ããããšæåŸã®ã¹ããããããããå®è¡ããcofojacãšcofojabãšãã 2ã€ã®ãŠãŒãã£ãªãã£ãä»å±ããŠããŸãã
Modern Jassã®éèŠãªã¢ã€ãã¢ã¯ãå¥çŽãåå¥ã«ã³ã³ãã€ã«ããããšã§ãã ãããã«ããŠããå ã®ãœãŒã¹ãã¡ã€ã«ã¯å€æŽãããŸããã äž»ã«æ§æïŒããšãã°ãäºéåŒçšç¬Šã§å²ãŸããå¥çŽã³ãŒãïŒã®æ¬ ç¹ããããŸãããä¿¡é Œæ§ããã®ã¢ãããŒãã«ãããã次ã®2ã€ã®ç¹æ§ãä¿èšŒããŸãã
- ã³ã³ãã©ã¯ãã®ã³ã³ãã€ã«ã¯ãéåžžã®ã³ã³ãã€ã«ããã»ã¹ãšéè€ããŸããã ããã«ãããã³ã³ãã€ã©ã«ãã£ãŠæŠèª¬ãããå ã®ã³ãŒãã®åäœã䜿çšããŠãã³ã³ãã©ã¯ãã®ã³ã³ãã€ã«äžã®ãã°ã®å¯èœæ§ãå¶éãããŸãã
- ã³ã³ãã©ã¯ãã³ã³ãã€ã©ã¯ãã³ã³ãã€ã«ããã³ã³ãã©ã¯ããå«ãã³ãŒããå¿ èŠãšããŸããã ã³ãŒããšæ³šéããªã³ã¯ããã ãã§ååã§ãã äœããã®çç±ïŒã©ã€ãã©ãªã®ãã°ããµããŒããããŠããªãJavaæ©èœãªã©ïŒã§Cofojaãã³ãŒãã®ç¹å®ã®ã»ã¯ã·ã§ã³ã§äœ¿çšã§ããªãå Žåãéçºãç¶ç¶ããŠãå¥çŽãéžæçã«ãŸãã¯ãã°ããã®éæ®ãããšãã§ããŸãã
ã³ã³ãã©ã¯ãã¯ãåŠçåŸããã«ã¯ã©ã¹ã«åå ãããããäžæŽ»æ§ããŒã¿ïŒããšãã°ãæååãªãã©ã«ïŒãšããŠã®åæè¡šçŸã¯ãç涯ãéããŠå€ãã®åœ¢åŒãçµãŸãã 以äžã®ã»ã¯ã·ã§ã³ã§ã¯ãå¥çŽãä»æ§ããæå¹ãªãã€ãã³ãŒãã«å€æãããæ¹æ³ã«ã€ããŠèª¬æããŸãã ã»ã¯ã·ã§ã³4ã§ã¯AOPããåçšããäžè¬çãªã³ã³ãã€ã«ææ³ã«ã€ããŠèª¬æããã»ã¯ã·ã§ã³5ã§ã¯Cofojaã®å éšå®è£ ã«ã€ããŠèª¬æããŸãã
4å¥çŽé¢ã®ç·šé
å¥çŽã®æ€èšŒã¯ãã¢ã¹ãã¯ãæåã®çšèªã§èª¬æãããŠããããã«ãã³ãŒãã暪æããããšã§äœæãããŸãã ã³ã³ãã©ã¯ãèªäœãããã°ã©ã ã®ããžãã¹ããžãã¯ã®ããããã£ã決å®ããŸããããããã®ãã§ãã¯ã¯ã¢ããªã±ãŒã·ã§ã³ã®ã¢ã¹ãã¯ããšããŠè¡šçŸã§ããŸãã
åŒã³åºãããã³ãŒãã®ç¢ºèªãŸãã¯ççŸã¯ãåœç¶ãå¥çŽäžã®ã¡ãœããã«é¢ããã¢ããã€ã¹ãšããŠè¡šçŸã§ããŸãã Modern Jassã©ã€ãã©ãªãŒã¯ãã¹ã¿ãã«åºã¥ãæ°ããã³ã³ãã€ã«ææ³ãšããã€ãã³ãŒãã®ãã³ããçæããæšæºJavaã³ã³ãã€ã©ãŒã®äœ¿çšãå°å ¥ããŸãããããã¯ãåŸã§JavaãšãŒãžã§ã³ãããŒã«ããããä»ããŠãªã³ã¯ã§ããŸãã ãã®ãããªã¢ãããŒãã«ã¯ãJavaèšèªãç解ããŠããè¿œå ã®ã³ã³ãã€ã©ãŒãäžèŠã«ãããšããå©ç¹ããããŸãã ãã ãã圌ã¯ã³ãŒããã³ã³ãã©ã¯ãããžãã¯ãšå¯æ¥ã«çµã³ä»ããŠããŸãã
Cofojaã¯ãã³ã³ãã€ã«ããã»ã¹ããããééçã«ã¢ã¹ãã¯ãã®æŠå¿µã衚瀺ããäœç³»çãªæ§é ã«æ¡åŒµããããšã«ããããã®ã¢ãããŒããæ¹åããŸããã
4.1ããŒãã®äœæ
è©è°äŒã®ã³ãŒããã³ã³ãã€ã«ããéã®äž»ãªåé¡ã¯ãè©è°äŒãé©çšãããæ¹æ³ãšåãç°å¢ãžã®ã¢ã¯ã»ã¹ãå¿ èŠãšããã³ãŒãã«ãããŸãã ã€ãŸããè©è°äŒã®äžéšã¯ãå€æŽå¯èœãªã³ãŒããšåãå¢çå ã«ãããã®ããã«ã³ã³ãã€ã«ãããããšãæåŸ ããŠããŸãã ããšãã°ãåææ¡ä»¶ã¯ãããããåŒã³åºãã®åŒæ°ããã§ãã¯ããŸãããŸãã¯ãä»»æã®ã³ã³ãã©ã¯ãããã©ã€ããŒãã¯ã©ã¹ã¡ãœãããåŒã³åºãããå ŽåããããŸãã ã³ã³ãã€ã©ããããç¥ã£ãŠããã°ãããã¯ç°¡åã«éæã§ããŸãã ãã ããæšæºã®Javaã³ã³ãã€ã©ã¯ãããã«æ³šæãæããŸããã
ãã®ããã«ãJavaã³ã³ãã€ã©ã¯æ¬¡ã®é åºã§äœ¿çšãããŸããè©è°äŒã¯å ã®ã¯ã©ã¹ã®ã³ããŒã«åã蟌ãŸãããã€ãã³ãŒãã«å€æãããŸãããã®çµæãã³ã³ãã€ã«ãããã¡ãœãããæœåºãããŸãã ãããã®ã¡ãœããã¯ãããŒãããåã«æçµã¯ã©ã¹å ã«ïŒãªãã·ã§ã³ã®ã¡ãœãããšããŠïŒç°¡åã«ãã€ã³ãã§ããŸãã ãããã£ãŠããã€ãã³ãŒãã¯è¿œå ã®åŽé¢ã«å±ããããã«ãã³ã³ãã€ã«ãããŠå¥åã«å®å šã«åå©çšå¯èœãªç¶æ ã§ä¿åãããŸãã
å ã®ã¯ã©ã¹ã®ã¡ãœãããã¹ã¿ãã«çœ®ãæããããšãã§ããããã«ãææ³ãæ¹åãããŸããã éèŠãªã®ã¯ãã³ã³ãã€ã©ãè©è°äŒã³ãŒãå ã§ãããã®ã¡ãœããã®åŒã³åºããé©åã«çæããããšã§ãã çŸåšã®ã³ã³ãã³ãã¯é¢ä¿ãããŸããã ãã®ç¹ã§ãæšæºã®æ³šéåŠçAPIã¯ãã¯ã©ã¹éå±€ã®åæ èŠçŽ ãšããŠãç°¡åã«åœ¢æãããã¹ã¿ãã«ååãªæ å ±ãæäŸããŸãã è¿œå ã®å©ç¹ã¯ããã€ãã³ãŒããšããŠã®ã¿å©çšå¯èœãªã¯ã©ã¹ã®é©çšæ§ã®æ¡åŒµã§ããã¡ãœãã眲åã¯ãé¢é£ããã¡ãœããæ¬äœãç¡èŠããŠãã¯ã©ã¹ãã¡ã€ã«ããèªã¿åãããšãã§ããŸãã
4.2æ¥ç¶ãã€ã³ããšãªã³ã¯
ãã€ã³ãã£ã³ã°ã¯ãã€ãã³ãŒããæžãæããããšã§çµäºããŸããè¿œå ã®ã¡ãœãããã¯ã©ã¹ã«è¿œå ããããã³ããé©çšãããã¡ãœããã¯ãã¡ãœããã®éå§æãšåºåæã«ãããã®åŒã³åºãã«ãã£ãŠè£è¶³ãããŸãã
åŒæ°ãæ»ãå€ãªã©ã®äžæããŒã¿ã¯ãã¡ãœããããã¡ãœããã«æé»çã«ç§»åãããã®ããã«ãæ瀺çã«ã³ããŒããå¿ èŠããããŸãã
ããã«å ããŠãã¡ãœãããåãå²ã¿ãå€ãå€ã®åŒãæã€äºåŸæ¡ä»¶ãæã€è©è°äŒã®äžéšã¯äžè¬çã§ãããã³ã³ããã¹ããç¶æããå¿ èŠãããç¹å¥ãªã±ãŒã¹ã§ãã Cofojaã§ã¯ãCouncilã¡ãœããã®å®è¡åŸã®çœ²åã«è¿œå ãããè¿œå ã®ããŒã«ã«å€æ°ãèšå®ããããšã«ãããã³ã³ããã¹ããä¿åããããã®ãœãªã¥ãŒã·ã§ã³ãäœæãããŸãã
æ å ±ã®ã³ã³ããã¹ãã¯èªç¶ã«ã°ãã°ãã®å€æ°ã®ã»ããã«å解ããããããå¥çŽã¯ãã®ã¢ãããŒãã«ç¹ã«é©ããŠããŸãã 2ã€ã®ä»£æ¿æ段ïŒã¡ãœããå ã«Councilãã€ãã³ãŒãã¡ãœãããåã蟌ã¿ãCouncilã¡ãœãããè£å©ãšã³ãã£ãã£å ã«åå²ããŸãã
è©è°äŒã®ã³ãŒããç¶æ¿ãããªãå ŽåããŸãã¯å ç¥ã¯ã©ã¹ã®ãã©ã€ããŒãã¡ã³ããŒãžã®ã¢ã¯ã»ã¹ããªãããšãä¿èšŒããå Žåãã¡ãœãããåã蟌ãããšã¯é åçãªãœãªã¥ãŒã·ã§ã³ã§ãã ãã以å€ã®å Žåãåã蟌ã¿ã¯ã¢ã¯ã»ã¹å¢çã®å©ç¹ãæãªããŸãã
ããäžè¬çãªæŠç¥ã¯ãå®éã®ã³ãŒããšå ã®ååãšçœ²åãåãåãã©ãããŒã§æ§æããããã«ããŒå ã«Councilã¡ãœãããé 眮ããããšã§ããããã®å®éã®äœæ¥ã¯ãè£å©ããã·ãŒãžã£ã®åŒã³åºããæ åœããCouncilã¡ãœããã«åŸããŸãã
4.3è©è°äŒã®ç¶æ¿
ç¶æ¿ã¯ãå¥çŽãã©ãã€ã ã®äžå¿éšåã§ãã ããããããã¯AOPãšã»ãšãã©çŽäº€ããŠããŸãã ãã®ã¢ãããŒãã§ã¯ãCouncilã®ã¡ãœããã¯éåžžã®ã¯ã©ã¹éå±€ãéããŠèªç¶ã«ç¶æ¿ããããã€ã³ãã£ã³ã°æã«å©çšå¯èœã§ããããšã¯æããã§ãã è¿œå ã®åªåãããã°ããœãŒã¹ã³ãŒãã§ãå©çšã§ããå ŽåããããŸãã
ã¢ããªã±ãŒã·ã§ã³ã«å¿ããŠãç¶æ¿ãããè©è°äŒã¯ãã®æ¬è³ªãšç®çã倧ããå€ããããšãã§ããããŸããŸãªæŠç¥ãå¯èœã§ãããããã¯ãã®ããã¥ã¡ã³ãã®ç¯å²å€ã§ãã
ãã ããã€ã³ã¿ãŒãã§ã€ã¹ã䜿çšãããšãã«åé¡ãçºçããŸãã ãããã®èŠçŽ ããã®ã€ã³ã¿ãŒãã§ã€ã¹ãå®è£ ããç¹å®ã®ã¯ã©ã¹ã«æ¥ç¶ããæ¹æ³ãããå Žåãã€ã³ã¿ãŒãã§ã€ã¹çšã®è©è°äŒãäœæããããšã¯éèŠãªã³ã³ããŒãã³ãã§ããããšã«æ³šæããŠãã ããã æããã«ãå ã®ã€ã³ã¿ãŒãã§ã€ã¹ã«ã¢ã¹ãã¯ãã³ãŒããæ¿å ¥ããæ¹æ³ã¯ãããŸããã çµæã®Javaãã¡ã€ã«ã¯ã³ã³ãã€ã«ããããããã¯ãã®ææ³ã®ã¢ã€ãã¢ã«ã¶ã€ãããŸãã
代ããã«ãè¿œå ã®ã¡ãœããã¯ãåäžã®ã€ã³ã¿ãŒãã§ã€ã¹ãå®è£ ããç¹å®ã®ã¯ã©ã¹ããŸãã¯ããããæ¥ç¶ãããŠããã€ã³ã¿ãŒãã§ã€ã¹ãšåãå¢çå ã®ãŠãŒãã£ãªãã£ã¯ã©ã¹ïŒåãããã±ãŒãžãŸãã¯å€éšã¯ã©ã¹ïŒã«ååšããããšãã§ããŸãã
æåã®æ±ºå®ã¯ãæ¢åã®æ¥ç¶ãããã€ã³ãã©ã¹ãã©ã¯ãã£ã䜿çšããããšã§ããã€ã³ã¿ãŒãã§ã€ã¹ãå®è£ ããã¯ã©ã¹ã¯ãCouncilã¡ãœãããç°¡åã«ã¢ã¿ããããéåžžã©ããååšãç¶ããããšãã§ããŸãã ãã ããå®è£ ãããã¯ã©ã¹ãžã®ãã¹ãŠã®åç §ããã¡ãœãããã€ã³ãžã§ã¯ããããå®éã®ã¯ã©ã¹ãžã®åç §ã«å€æããå Žåã¯æ³šæãå¿ èŠã§ãã ã³ãŒãã®è€è£œã䌎ãã¿ã¹ã¯ããããŸãã
2çªç®ã®ãœãªã¥ãŒã·ã§ã³ã§ã¯ãå®éã®ãªããžã§ã¯ããå¶åŸ¡ããããã«æå¹ãªè¿œå ã®ãã©ã¡ãŒã¿ãŒã䜿çšããããã«ãã€ã³ã¿ãŒãã§ã€ã¹ã®ããŒãã®æçãåäœæããå¿ èŠããããŸãã ãã ããããã«ããéè€ãæé€ãããŸãã å€éšæé ã®åžæã¯ããããã®æ§é ã®è¡šçŸåãå¶éããªãããšã«æ³šæããŠãã ããã ã€ã³ã¿ãŒãã§ã€ã¹ã«ã¯ãããªãã¯æ§é ã®ã¿ããããŸãã
ã»ã¯ã·ã§ã³5.2.1ã§ã¯ãå¥çŽæ £è¡ã®èŠ³ç¹ãããããã®åé¡ã«å¯ŸåŠããŸããæåã®ãœãªã¥ãŒã·ã§ã³ã®ããªã¢ã³ãã䜿çšããModern Jassãš2çªç®ã®ãœãªã¥ãŒã·ã§ã³ãé©çšããCofojaã®å®è£ ãæ¯èŒããŸãã
4.4ã³ã³ãã€ã«ææ³ã®å¶é
ãã®ã¢ã¹ãã¯ãã³ã³ãã€ã«ã¢ãããŒãã¯ãJavaã³ã³ãã€ã©ããã®å¢çå ã§ã¡ãœãããæé©åããªããšããä¿èšŒã«åºã¥ããŠããŸãã å®éãããã«ã¯ããœãŒã¹ã³ãŒãã¡ãœãããšãã€ãã³ãŒãã¡ãœããã1察1ã§çµåããå¿ èŠããããŸããããšãã°ãã³ã³ãã€ã«äžã«ã¡ãœãããæçåããããšã¯ãããŸããã ã¹ã¿ãã§ã¯ãã¡ãœããããŒã¹ãçŽæ¥åã蟌ãããšã¯ãå¥ã®å€§ããªæãŸãããªãæé©åã§ãã å®éã«ã¯ãã³ã³ãã€ã©ãããä»®æ³ãã·ã³ã®ã¬ãã«ãæé©åãããšããçŸåšã®åŸåãèæ ®ãããšãããã¯å€§ããªåé¡ã«ã¯ãªããŸããã ããã«ãç¹ã«å¥çŽã¯ãäž»ã«éçºãšãããã°ãç®çãšããŠããŸãããããã£ãŠãããããæé©åãæå¹ã«ããŠã³ã³ãã€ã«ãããŸããã
å¥ã®å¯èœæ§ã®ããããæ·±å»ãªåé¡ã¯ãã³ã³ãã€ã«ãšã©ãŒã§ãã ãšã©ãŒå ±åã«ã¯ããã«æ³šæãå¿ èŠã§ãã 圌ã¯ãšããã©ããã®ãªãççŸãè£åãåŸåããããŸãã ç°¡åãªã¢ã€ãã¢ã¯ãã¡ã€ã³ã³ã³ãã€ã©ããã»ã¹ããçµæãè¿ãããšã§ããããã«ããããŠãŒã¶ãŒã³ãŒããšã¯é¢ä¿ãªããçæãããèŠçŽ ãšã®æ··åã³ãŒãã«å¯Ÿå¿ãã圢æãããã¡ãã»ãŒãžããŠãŒã¶ãŒã«è¡šç€ºãããŸãã Cofojaã¯ãäžè¬çãªãšã©ãŒã¡ãã»ãŒãžãæ確ã«ããã®ã«åœ¹ç«ã€é«åºŠãªæ©èœã§ãã®ãªãã·ã§ã³ãè£å®ããŸãã ããäžè¬çãªãœãªã¥ãŒã·ã§ã³ã§ã¯ãã³ã³ãã€ã©APIãšã®æ¹åãããçµ±åã䜿çšã§ããŸãã
åŒçšæç®ãªã¹ã
- J.ããããã JSR 41ïŒåçŽãªã¢ãµãŒã·ã§ã³æ©èœã 1999幎11æ
- C4j
- DR Cokã JMLããžã§ããªãã¯åãšJava 1.6ã«é©åãããŸãã ã³ã³ããŒãã³ãããŒã¹ã®ã·ã¹ãã ã®ä»æ§ãšæ€èšŒã«é¢ãã第7ååœéã¯ãŒã¯ã·ã§ãããppã 2008幎11æ27ã34æ¥ã
- ã³ã³ãã€ã©ããªãŒAPI
- Contrac4j
- ãšããã§ã«ãœãããŠã§ã¢ã å¥çŽã«ããèšèšã®å
- A.ãšãªã¢ãœã³ã åçãããã·ã䜿çšããŠJavaåãã®å¥çŽã«ããèšèšãå®è£ ããŸãã 2002幎2æ
- ã«ãŒãã¢ã ã³ã³ãã¥ãŒã¿ããã°ã©ãã³ã°ã®å ¬ççåºç€ã ACMã®éä¿¡ã第12å·»ã第10å·ãppã 576-580ã 1969幎10æã
- ã¢ãµãŒã·ã§ã³ä»ãã®Java
- Javaã¢ããªã³ã°èšèª
- B.ãªã¹ã³ããJããŠã£ã³ã°ã ãµãã¿ã€ãã³ã°ã®åäœæŠå¿µã ACM Transactions on Programming Languages and SystemsïŒTOPLASïŒãVolume 16ãIssue 6ãppã 1811-1841ã 1994幎11æ
- B.ãã€ã€ãŒã ãDesign by Contractãã®é©çšãã³ã³ãã¥ãŒã¿ãŒïŒIEEEïŒã第25å·»ã第10å·ãppã 40-51ã 1992幎10æ
- Oracle Corporationã Java HotSpot Virtual Machineãv1.4.1
- J.ãªãŒã±ã³ã Javaã®å¥çŽã«ããèšèš-æ¹èšã 2007幎4æ
- D.ã¯ã³ãã©ãŒã Javaã§ã®å¥çŽã«ããèšèšã®ããã®Contract4JïŒèšèšãã¿ãŒã³ã®ãããªãããã³ã«ãšã¢ã¹ãã¯ãã€ã³ã¿ãŒãã§ã€ã¹ã 2006