ኌ‫܋‬໩Ϸ ᮗࡋ੸‫᦯ݩ‬Ѳ࡚У
THE INSTITUTE OF ELECTRONICS,INFORMATION AND COMMUNICATION ENGINEERSѲ࡚ବ‫ݩ‬TECHNICAL REPORT OF IEICE.

UML ͍̗͟ʾࢧᢏɪɈə̳͝ˋ˧̇ͯ͝˨҉ងඬՌɶ᠂ʙ
‫ޅ‬ᅏణ‫†خ‬‫ظ‬ᅏխខ††༓‫ء‬ӣ††ϢΨӴ᧽††† ޿ᬹ޿࡚‫ݙ‬ኁि࡚ᨃ੸‫ݩ‬ኽ࡚ኽ Ȕ 560–8531 ޿ᬹউᢉιॎ৷Ԍࣟᅕ 1–3†† ޿ᬹ޿࡚޿࡚ᭌ੸‫ݩ‬ኽ࡚ቆዲኽ Ȕ 560–8531 ޿ᬹউᢉιॎ৷Ԍࣟᅕ 1–3
E-mail: †kis-masd@ics.es.osaka-u.ac.jp, ††{n-yosida,y-hamagt,inoue}@ist.osaka-u.ac.jpʲΈͥ˲̳̘̂˔˗ˌɶ៬ៜʾᝑȦ᭩ɰʫȸᅋȣʭʲʱ៙᠚ɪɈɧ UML (Uniﬁed Modeling Language) ȳ୯Ⱦʭʲʱ᷷ʗəᦌॴ̳̘̂˔˗ˌɶ޷ᨃɰࢧɍʱ୴ʱᖌȣʾ‫ޱ‬ȫɏɰԏᨃ෬ᦳʾదჼɍʱ̳͝ˋ˧̇ͯ͝˨ʾ UML ͍̗͟ɰࢧɈɧᝑȦቆዲȳᇲˀɨȞʱ̳᷷͝ˋ˧̇ͯ͝˨ʾᝑȦፚକɪɈɧᷳෲǻɮ̷͢˨͉͛ɨԔՠᅋɨȴʱາᅋᇒɮ៬ៜ̫̇͹ͯɨȞʱ̗˴ˑ̫ͯ̇͹ͯɶ᧜ᅋ‫ث‬ᔥፚକȳ୯Ⱦʭʲʱ᷷ɈȱɈ޿ួญɮ̳̘̂˔˗ˌɨɸᷳᬓᇊᓑȳ UML͍̗͟ȱʭ̳͝ˋ˧̇ͯ͝˨ፚକʾ႒ࡱɍʱɶɸ‫܍‬ᮎɨȞʱ᷷ೠዠɨɸᷳɀɶ‫ڦ‬ᰊʾ។ໃɍʱəʝɰᷳUML ͍̗͟ʾ។ഐɍʱɀɪɨᷳUML ͍̗͟Ψɶ̗˴ˑ̫ͯ̇͹ͯ᧜ᅋ‫ث‬ᔥፚକʾඬՌɈ̗ᷳ˴ˑ̫ͯ̇͹ͯ᧜ᅋৼɶ UML ͍̗͟ʾ஭ኊɍʱଚ໩ʾ஭൙ɍʱ᷷Ʉʭɰᷳೠଚ໩ʾࡵჹɈə̑͹͟ʾо૾Ɉ̳ᷳ͝ˋ˧̇ͯ͝˨҉ងඬՌʾᝑȫʱɀɪʾቭ᠔Ɉə᷷
ϘҸҝҸЬ UML ͍̗̳ᷳ͟͝ˋ˧̇ͯ͝˨̗ᷳ˴ˑ̫ͯ̇͹ͯ

A Method to Identify Refactoring Opportunities in UML Models
Keishi MASUDA† , Norihiro YOSHIDA†† , Yuu HAMAGUCHI†† , and Katuro INOUE††† School of Engineering ScienceᷳOsaka University
1–3ᷳMachikaneyama-choᷳToyonaka-shiᷳ560–8531ᷳJapan†† Graduate School of Information Science and TechnologyᷳOsaka University
1–3ᷳMachikaneyama-choᷳToyonaka-shiᷳ560–8531ᷳJapanE-mail: †kis-masd@ics.es.osaka-u.ac.jp, ††{n-yosida,y-hamagt,inoue}@ist.osaka-u.ac.jp
Abstract Uniﬁed Modeling Language (UML) is widely used in Object-Oriented software design. Recently, severalstudies have been done on refactoring for UML models. Refactoring is a well-known process to improve software
design. However, it is diﬃcult to identify refactoring opportunities manually in large-scale UML models. In thispaper, we propose a refactoring support tool for UML models. The tool automatically identiﬁes refactoring opportunities for applying design patterns that are general repeated solutions to common problems in software design. Inaddition, we present some case studies to show the usefulness of the proposed tool.
Key words UML ModelᷳRefactoringᷳDesign Pattern1. ͥ ˅ ˑ ˓əʗʗᷳჼ។ʣѶ๪ȳࢂ౨ɰɮʱʫȦɰ̂͹˺ˮ͹̚ʾѶ๪Ɉ̳̘̂˔˗ˌᬓᇊᓑɶᬗɨ̳̘̂˔˗ˌɶჼ។ʾԇ೎ɍʱəʫȦɰӬǻ̳͝ˋ˧̇ͯ͝˨ɪɸ̂͹˺ˮ͹̚ɰࢧɈɧᝑȦʟʝɶ៙᠚ɪɈɧᷳUML (Uniﬁed Modeling Language) ȳ಑ؓɶɨȞɠə᷷ɈȱɈೋᦌɶቆዲɨɸ̳͝ˋ˧̇ͯ͝˨ʾ៬ៜ͍Ɉɧȣʱ᷷UML ʾՠᅋɍʱɀɪɨᷳ˝̵˸˗˧̘୪‫៬ـ‬ៜᠳ̗͟ɰࢧɈɧʟ᧜ᅋɍʱɪȣȦଚ໩ [1], [3] ȳ஭൙ɄʲɧȮʮᷳɰ‫ݙ‬ɤȣɧ̳̘̂˔˗ˌɶ៬ៜ͍̗͟ʾ‫ث‬ឿ‫׈‬ɨȴʱ᷷ɀȦɈə̳͝ˋ˧̇ͯ͝˨ଚ໩ɸ͍̗̻͟͹˺̳͝ˋ˧̇ͯ͝ɧԏᨃɶ෬ᦳʾఏ‫ڲ‬Ɉɧȣȸо෉”ɪࡱᒳɄʲɧȣʱ [4]᷷ɀɶɀȦɈɧо૾Ʉʲə៬ៜ͍̗͟ɸиঋʟఏᖧɄʲʱɀɪɨ‫ڀ‬˨ [11] ɪ៙ʸʲʱ᷷៬ៜຊ᭢ɨ̳͝ˋ˧̇ͯ͝˨ʾᝑȦɀɪɨᷳᣏɶᲛȣ៬ៜ͍̗͟ɪɮʱ᷷៬ៜ‫ޱ‬ೀɶ‫ث‬ᔥਵɶȞʱፚକȳ՝ࡵ᝾ʾᝑɠəৼɰ៬ៜʾ‫ޱ‬ೀɈᷳʟȦ΢ঋࡵ᝾ɍʱɪȣȦଚଓ౦Ɉə౾ဠɨᦧ๓៬ៜ͍̗͟ʾఏᖧɈɧᷳ‫ޱ‬ೀɰࢧɍʱഭ᥆ਵʮʾཚʭɍɀɪȳɨȴʱ [1], [3]᷷ʾ୨əɑʱо෉ʾ̳͝ˋ˧̇ͯ͝˨ [4] ɪ៙Ȧ̳᷷͝ˋ˧̇ͯ͝˨ɸᷳ“̳̘̂˔˗ˌɶ޷ᨃᇒ୴ʱᖌȣʾѰɠ̳͝ˋ˧̇ͯ͝˨ɶ᭩ɰᷳᧉ؎ɰ៬ៜᓑȳ᏾ᱸᇒɰਁəԔՠᅋ‫ث‬ᔥɮ៬ៜ̫̇͹ͯɨȞʱ̗˴ˑ̫ͯ̇͹ͯ [7] ʾՠᅋɍʱ

—1—ɀɪɨ̳̘ᷳ̂˔˗ˌᬓᇊɰȮȣɧᰅՌɍʱԋܽᇒɮ‫ڦ‬ᰊɰࢧՀɨȴʱ᷷UML ͍̗͟Ψɰ̗˴ˑ̫ͯ̇͹ͯʾ᧜ᅋɍʍȴፚକȳࡑ‫ܤ‬ɍʱɪȣȦɀɪɸᷳɕɶፚକɶ៬ៜɰиʭȱɶ๒ဠȳȞʮ̳ᷳ͝ˋ˧̇ͯ͝˨҉ងɪɮʱ‫ث‬ᔥਵȳᲛȣɀɪʾኊɈɧȣʱ᷷ᬓᇊᓑɸ̗˴ˑ̫ͯ̇͹ͯ᧜ᅋ‫ث‬ᔥፚକʾඬ៟ɍʱɀɪɨࡵ᭩ɰ̳͝ˋ˧̇ͯ͝˨ʾᝑȦȱɶ՝ాʾᝑȦɀɪȳɨȴʱ᷷ɈȱɈᷳ޿ួญɮ̳̘̂˔˗ˌᬓᇊɨɸᷳᬓᇊᓑȳ̗˴ˑ̫ͯ̇͹ͯ᧜ᅋ‫ث‬ᔥፚକʾ႒ࡱɍʱɀɪɸ‫܍‬ᮎɨȞʱ᷷ʫɠɧᷳ

UML ͍̗͟ʾ។ഐɈ̗ᷳ˴ˑ̫ͯ̇͹ͯ᧜ᅋ‫ث‬ᔥፚକʾᕳ֧ɨඬՌɨȴʱʫȦɮЄᏹʙȳਓាɪᓏȫʭʲʱ᷷ೠቆዲɨɸ̳̘ᷳ̂˔˗ˌɶ៬ៜ౾ɰᷳ˧͛˺܏ʾ᝝ɍ UML

܏ 1 UML ȳ஭їɍʱ̉ˑˌ˨͉͛ɶ΢ᨃ͍̗͟ɨኊɄʲʱ˧͛˺ɶ෬ᦳɪ˧͛˺ᬗɶᬝѢʾᕳ֧ᇒɰ។
ഐɍʱɀɪɰʫɠɧᷳ៬ៜ͍̗͟ɶ̳͝ˋ˧̇ͯ͝˨౾ɰ᧜ᅋ

2. 2 ҏяεϟЍҏҪϡ‫ث‬ᔥɮ̗˴ˑ̫ͯ̇͹ͯʾ႒ࡱɈ̳̘ᷳ̂˔˗ˌɶ‫ڀ‬ᣏ‫ـ‬Ψʾ̳͝ˋ˧̇ͯ͝˨ɪɸ̳̘ᷳ̂˔˗ˌɶ޷ᨃȱʭូə֧оʾఉஶɍʱɀɪʾᇼᇒɪɍʱ̗᷷˴ˑ̫ͯ̇͹ͯ᧜ᅋ‫ث‬ᔥፚକɶ‫ޱ‬ȫɏɰᷳԏᨃ෬ᦳʾదჼɈɧ̳̘̂˔˗ˌɶѶ๪ࢂ౨ਵɪ‫ث‬

႒ࡱɸ UML ɶ XML (eXtensible Markup Language) ᝝ჹ [2]ᠤਵʾᲛʝʱɀɪɨȞʱ᷷ɨȞʱ XMI ʾ។ഐɍʱɀɪɨ‫ث‬ᔥɨȞʱ᷷˧͛˺܏ʾ᝝ɍ΢ঋо૾Ɉə̳̘̂˔˗ˌɶ៬ៜʾ‫ޱ‬ೀɈɮȽʲɺɮʭɮȣ

UML ͍̗͟ɸ̫̏˪͹˸ᷳ˧͛˺ᷳ‫ޱ‬తᷳ؏၄ɶᬝѢɪȣɠ‫ݪ‬ᯃɸ޺ȣ̳̘᷷̂˔˗ˌɶᬓᇊᦪιɶЄෲ‫ޱ‬ೀ̗̩ᷳ̏˨ᷳថə̗͹̇ʾ୨ɢɶɨᷳɀʲʭʾೝ෬ᦳɨ᝝ჹɨȴʱ᷷ɕɶəʝᷳ‫ڀ‬ɪɈɧᧇᅋɄʲɧȣʱຊ᭢ɨɶยᔥᦝ֐ɶា೗ȳՌəɪȴɮబጜ෬ᦳ‫׈‬៙᠚ɨȞʱ XML ʾᅋȣɧ UML ͍̗͟ɶ̗͹̇෬ɭɨȞʱ᷷ʫɠɧ̳̘ᷳ̂˔˗ˌɸ‫ޱ‬ೀɰࢧɍʱഭ᥆ਵʾ୨ɠᦳʾ᝝ɍɀɪȳɨȴʱ᷷ɧȣɮȽʲɺɮʭɮȣ᷷஭൙ଚ໩ɨɸᷳʗɏ UML ɶ XML ᝝ჹɨȞʱ XMI ʾ។ഐʗəᷳ៬ៜʾɈəᬓᇊᓑА޷ɶϷᬗȳ៬ៜ͍̗͟ʣ̂͹˺ɍʱ᷷๓ɰ̗˴ˑ̫ͯ̇͹ͯʾ᧜ᅋɈə‫طݪ‬ɰѶ๪Ɉəৼɶ˧ˮ͹̚ʾʙʱ‫ݪ‬ᯃʟ޺ȣ᷷ᬓᇊᦪιɰˮ͹̮͓̚͡͹ʾᝑɠɧ͛˺܏ʾኊɍ XMI ̳ˋˑ͟ʾՌ֍ɍʱ᷷UML ͍̗͟ɪ XMIᬓᇊ̊͹͉Ԁзɰሻᡨʾ༞ᦦɄɑʱ‫طݪ‬ʣᷳ΢ঋ͝͝͹˺Ɉə̳ˋˑ͟ɶᇿϠ‫ޱ‬றɸ JUDE [6] ɮɭɶ UML ͍̗ͯ͝˨̑͹ថ‫ڀ‬ɰࢧɈɧЅɶᬓᇊᓑȳ‫ޱ‬ೀʾ֐ȫʱ‫طݪ‬ȳȞʱ᷷ʫɠɧᷳ͟ɰʫɠɧᝑȦ̳᷷͝ˋ˧̇ͯ͝˨ʾᝑȦᬓᇊᓑɸᷳ̑͹͟ȱ̳̘̂˔˗ˌɸᠤʙଚɰɕɶยᔥʾ๪ቭɰХȫʱჼ។ࢂ౨ਵʾ

ʭՌ֍Ʉʲə XMI ̳ˋˑ͟ʾ‫ޱ‬றɈɧਁə UML ͍̗͟ʾូ୨ɠɧȣɮȽʲɺɮʭɮȣ᷷ɧᷳ៬ៜʾ‫ޱ‬ೀɍʱ‫ث‬ᔥਵɶȞʱፚକʾቭ᠔ɍʱɀɪȳɨȴʱ᷷

2. 2. 1 ̂͹˺ˮ͹̚ɰࢧɍʱ̳͝ˋ˧̇ͯ͝˨Ʉʭɰᷳೠଚ໩ʾࡵჹɍʱ̑͹͟ʾо૾ɈᷳᅖᯃΨɰ౾ժʾ̳͝ˋ˧̇ͯ͝˨ɪɸ̳̘̂˔˗ˌɶࡵ᝾ʾᝑɠəৼɨ̂͹᝝ኊɍʱ̷͢˨͉͛ʾ᝝ჹɈə Digital Clock [10] ͍̗͟ʣᷳᅈ˺ˮ͹̚ʾ໽ᑄɈɧȣȴᷳ៬ៜʾఏ‫ڲ‬ɍʱо෉ɪࡱᒳɄʲɧȣ෉ᅝɨᬓᇊɄʲࡵ᭩ɰዝ֧Ɉɧȣʱ̳̘̂˔˗ˌɶ UML ͍̗ʱ [4]᷷ᨿបɈəˮ͹̚ʾʗɪʝəʮᷳᬌɍȷʱ͋̂̏̚ʾՒտᷳ͟˝͹̷ͯ̂͹˺̳̘̂˔˗ˌɶ UML ͍̗͟ɰ᧜ᅋɈɧᷳɍʱɮɭෲǻɮ̳͝ˋ˧̇ͯ͝˨ɶూ໩ȳቆዲɄʲɧȣʱ᷷о૾Ɉəʾщᅋɍʱɀɪɨᬓᇊᓑȳ̳͝ˋ˧̇ͯ͝˨҉ងɶቭ

2. 2. 2 ͍̗͟ɰࢧɍʱ̳͝ˋ˧̇ͯ͝˨᠔ʾᝑȫʱɀɪȳʸȱɠə᷷ೠ೽̳͝ˋ˧̇ͯ͝˨ɸ̂͹˺ˮ͹̚ɰࢧɈɧᝑʸʲʱʟ

2. ჉‫׻‬ɶɨȞɠəȳ͍̗ᷳ͟ι਒ɶᬓᇊଚ໩ȳᇊࣖɍʱɰɢʲ͍̗̻ᷳ͟͹˺ɶ̳͝ˋ˧̇ͯ͝˨ȳీəɰࡱᒳɄʲə [11]᷷܏ 2 ɰ

2. 1 UML Σ኏ʹ̈ЉяЪςφθ᱗ጎUML ͍̗͟ʾ̳͝ˋ˧̇ͯ͝˨ɍʱɀɪɨ៬ៜȳ໽ᑄɄʲɧ

UML ɸ OMG (Object Management Group) [12] ɰʫɠɧȣȸෲࡋʾኊɍ᷷បᮇɮ˧͛˺ᬗɶᬝᦶʾᎋ྽ɰɍʱɀɪɨɕɶЄෲȳฉ྅‫׈‬Ʉʲɧȣʱ͍̗ͯ͝˨៙᠚ɨȞʱ᷷UML ɸ̗͹̇ɶ༎ʲȳᬓᇊᓑɰɪɠɧʸȱʮ౨ȸɮʱ᷷

̳̘̂˔˗ˌᬓᇊɶΨ༎िውȱʭΩ༎िውʗɨՠᅋɨȴᷳȱɢ̂͹˺ˮ͹̻̚͹˺ɶ̳͝ˋ˧̇ͯ͝˨ɰࢧɈɧ͍̗ᷳ͟˶˺͉̕ɶෲǻɮҬᯃʾ͍̗͟‫׈‬ɨȴʱʫȦɰᷳ܏ 1 ɶʫȦɮ̻͹˺ɶ̳͝ˋ˧̇ͯ͝˨ɸ៬ៜຊ᭢ɨࡵᝑɨȴʱɪȣȦՠဠ޺ȸɶ̉ˑˌ˨͉͛ʾ஭їɈɧȣʱ (UML2.0 ɨ 13 ዘᰓ)᷷ȳȞʱ᷷̂͹˺ˮ͹̚ʾ៥ᦗɍʱձɶຊ᭢ɨѶ๪ȳɈ౨ȸᷳ‫ث‬

UML ɶ಑ؓɰʫɠɧᷳ‫ض‬िውɶ૾ഔႏɸચٟࡱᒳȳฉ྅‫׈‬ᠤਵɶᲛȣ͍̗͟ʾо૾ɍʱɀɪɨᷳᬓᇊɶଚଓʮʾࢶɮȸɍɄʲə͍̗͟ɪɈɧ៥ᦗɄʲʱʫȦɰɮɠə᷷ɀʲɰʫʮᬓᇊʱɀɪȳɨȴʱ᷷ʗə̳ᷳ͝ˋ˧̇ͯ͝˨ɶ༎ʲʾ UML ͍̗ᓑɰԇ᦯ɶˮ͇͓̞˪͹˶͗ͯ‫ݙ‬ᇸʾʟəʭɈə᷷ᐁഔ͍̗ᷳ͟ɨቭ᠔ɨȴʱəʝᷳᬓᇊᓑɰɪɠɧ̳͝ˋ˧̇ͯ͝˨ፚକɶ͟ɶᨿាਵɸঀȸ᠔ᡨɄʲʱʫȦɰɮʮᷳᕳဵ៙᠚ɨ៥ᦗɄʲቭ᠔ȳࢂ౨ɪɮʱ [1], [3]᷷ə៬ៜೃʣ̷͢˨͇͛ͯ˨៙᠚ɨ៥ᦗɄʲə̂͹˺ˮ͹̚ʫʮ

2. 3 ЦϲξҪфЍҸҪʟ͍̗ᷳ͟ʾι਒ɪɈɧ̳̘̂˔˗ˌᬓᇊʾᝑȦଚ໩ȳ᠔ʝʭ̗˴ˑ̫ͯ̇͹ͯɸາᅋᇒɮ៬ៜ̫̇͹ͯɨȞʱ̗᷷˴ˑͯ

ʲʱʫȦɰɮɠə᷷

̫̇͹ͯʾՠᅋɍʱɀɪɰʫɠɧ̳̘ᷳ̂˔˗ˌᬓᇊɰȮȣɧᰅՌɍʱԋܽᇒɮ‫ڦ‬ᰊɰࢧՀɍʱəʝɶ៬ៜ̫̇͹ͯʾо૾ɨ

—2—܏ 2 UML ͍̗͟ɰࢧɍʱ͍̗̻͟͹˺̳͝ˋ˧̇ͯ͝˨

܏5܏3XMI ̳ˋˑ͟ (ी) ɪࢧਚɍʱ UML ͍̗͟ (‫)د‬̗˴ˑ̫ͯ̇͹ͯʾՠᅋɈə͍̗̻͟͹˺̳͝ˋ˧̇ͯ͝˨ǳ

܏ 6 Ѷ๪ৼɶ XMI ̳ˋˑ͟ (ी) ɪѶ๪ȳ‫ؖ‬౮Ʉʲə UML ͍̗͟ (‫)د‬ǳ
܏4஭൙ଚ໩ɶූា

3. 2 ЦϲξҪфЍҸҪᬠ኏‫ݯ‬ᙩᒞౙ̵໰‫ྮֺ̤ڐ‬UML ͍̗͟ʾ។ഐɈ̗ᷳ˴ˑ̫ͯ̇͹ͯȳ᧜ᅋɨȴʱፚକȴʱ [5]᷷ʾඬՌɈɧѶ๪ɍʱଚ໩ʾኊɍ᷷ʗəᦌॴ͍̗͟ɰࢧɍʱ̳͝ˋ˧̇ͯ͝˨౾ɰ̗˴ˑ̫ͯ̇͹ͯʾՠᅋɍʱଚ໩ȳቆዲɄʲɧȣʱ [7]᷷ɀɶᔕಒɰɸᷳ΢ᖑɰࢭ೽‫ޱ‬ೀȳਓាɰɮʭɮȣፚକɰ̗˴ˑ̫ͯ̇͹ͯʾ᧜ᅋɈɧʟȱȫɠɧ៬ៜȳបᮇɰɮʱəʝᷳ៬ៜɶ՜೚ຊ᭢ʫʮʟ
Ѷ๪ຊ᭢ɨ̗˴ˑ̫ͯ̇͹ͯʾ᧜ᅋɈəʐȦȳ֜ოȳʫȣɪȣȦჼᅐȳȞʱ᷷ʭɰ̗˴ˑ̫ͯ̇͹ͯʾᅋȣə̳͝ˋ˧̇ͯ͝˨ʾᝑȦෲࡋʾኊɍ᷷˧͛˺ɶ୅ᢏ‫׈‬ʾᝑȣᷳ2 ɢɶ˧͛˺ɶԇ᦯ᨃՒʾះ˧
͛˺ȱʭᐖଫɄɑʱ᷷ɀʲɰʫʮৼɰ‫ػ‬ɋʫȦɮยᔥʾ୨ɢ˧͛˺ʾᦝ֐ɍʱɀɪȳࢂ౨ɰɮʱ᷷

3. ೱ ຝ ౞ ိ

ʱ᷷܏ 5 ɰ‫ש‬Ꮱɮ UML ͍̗͟ɪᷳɕɶ UML ͍̗͟ʾ᝝ɍXMI ̳ˋˑ͟ʾኊɍ᷷ɮȮᷳXMI ̳ˋˑ͟ɸჼ។Ɉ౨ȸɍʱూʾ‫ޱ‬ೀɍʱɀɪɨᷳЅూʟ‫ޱ‬ೀɄʲʱ᷷

XMI ̳ˋˑ͟ɨɸ˧͛˺̗͹̇ʾ Class ̇˨ɨ᝝ɈᷳɕɶΩɶ᭢ࣚɰ͋̂̏̚ʾ᝝ɍ Operation ̇˨ʾ୨ɢ᷷ʗəះࡋᬝѢɸ Generalization ̇˨ɨ᝝ɈᷳɕɶΩɶ᭢ࣚɰࡋ˧͛˺ʾኊɍ
ɪ Child ̇˨ɪះ˧͛˺ʾኊɍ Parent ̇˨ʾ୨ɢ᷷
܏ 6 ɰ XMI ̳ˋˑ͟ʾѶ๪ɍʱɀɪɨᷳѶ๪ȳ‫ؖ‬౮Ʉʲə

UML ͍̗͟ʾኊɍ᷷XMI ̳ˋˑ͟ɶ‫ޱ‬ೀፚକʾᣤࡐɨኊɈɧ᣺܏ 4 ɰ஭൙ଚ໩ɶූាʾኊɍ̳̘᷷̂˔˗ˌɶ UML ͍̗͟ʾ XML ᝝ჹɨ᝝ɍ XMI ̳ˋˑ͟ʾӿ֍ɪɍʱ᷷UML ͍̗ͯ͝˨̑͹͟ʾᅋȣɧᷳUML ͍̗͟ȱʭ XMI ̳ˋˑ͟ʾ‫ؙ‬
ਁɍʱ᷷XMI ̳ˋˑ͟ʾ។ഐɈ̗ᷳ˴ˑ̫ͯ̇͹ͯʾ᧜ᅋɨ
ȴʱፚକʾ̗˴ˑ̫ͯ̇͹ͯʾ᧜ᅋɈə៥ᦗɰѶ๪ɍʱ᷷Ѷ๪Ɉəፚକɶʙ XMI ̳ˋˑ͟Ԁзȱʭ୅ՌɈɧՌ֍ɍʱ᷷UML͍̗ͯ͝˨̑͹͟ʾᅋȣɧᷳՌ֍Ʉʲə XMI ȱʭ UML ͍̗͟ʾ‫ਁؙ‬ɍʱ̳̘᷷̂˔˗ˌɶ UML ͍̗͟ɶ XML ᝝ჹɨȞʱ XMI ̳ˋˑ͟ʾ។ഐᷳѶ๪ɍʱɀɪɨᷳࢧਚɍʱ UML ͍̗͟ʾѶ๪ɍအɰᎋᅪ‫׈‬ɈɧኊɈɧȣʱ᷷ϝɢɸȮϠȣɰࢧਚɈɧȮʮᷳ΢

܏ 3 ɰ܏ 2 ɨ̳͝ˋ˧̇ͯ͝˨Ɉə UML ͍̗͟ɰࢧɈɧɄ

3. 1 ༚

3. 2. 1 XMI ។ഐɰʫʱ UML ͍̗͟ɶ੸‫ਁؙݩ‬ɪѶ๪ȣʱ᷷Car ˧͛˺ɰ set ͋̂̏̚ʾᦝ֐ɈᷳVehicle ˧͛˺ɪ Car˧͛˺ɶះࡋᬝѢȳᦢ᥇Ɉɧȣʱ᷷ɀɶ‫ޱ‬ೀɰࢧਚɈɧᷳीɶ

UML ͍̗͟ʟѶ๪Ʉʲɧȣʱ᷷ɀɶʫȦɰɈɧ UML ͍̗͟ʾѶ๪ɍʱɀɪȳɨȴʱ᷷

3. 2. 2 ̗˴ˑ̫ͯ̇͹ͯ᧜ᅋ೹Е
UML ͍̗͟ʾ។ഐɈ̗ᷳ˴ˑ̫ͯ̇͹ͯȳ᧜ᅋɨȴʱፚକʾඬՌɍʱ᷷UML ͍̗͟ʾ។ഐɈəᐁഔᷳ႒ࡱɶ෬ᦳʾ୨ɢ‫طݪ‬ɸ̗˴ˑ̫ͯ̇͹ͯȳ᧜ᅋɨȴʱ̗᷷˴ˑ̫ͯ̇͹ͯຕɰ᧜ᅋ೹ЕʾໃʝɧȮȴᷳ೹ЕɰȞɠə UML ͍̗͟ʾѶ๪ɍʱ᷷—3—܏ 9 ̳̘̂˔˗ˌɶ UML ͍̗͟ (܏ी) ɪᷳѶ๪Ɉəፚକɶ UML
܏ 7 Observer ̫̇͹ͯɶ᧜ᅋ೹Е͍̗͟ (܏‫)د‬ǳǳɶᇼᇒɸ๓ɶϝɢɨȞʱ᷷•̳͝ˋ˧̇ͯ͝˨҉ងඬՌยᔥʾ៼њ̑͹͟ʾщᅋɍʱɀɪɨᷳUML ͍̗͟ιɶ̗˴ˑ̫ͯ̇͹ͯ᧜ᅋ‫ث‬ᔥፚକʾඬՌɨȴʱɀɪʾቭ᠔ɈᷳɀɶยᔥʾՠᅋɈɧ̳͝ˋ˧̇ͯ͝˨҉ងɶඬ៟ȳՌ೽ʱȱʾᠪʍʱ᷷•໳ᇼ̫̏˪͹˸៥ᦗɶ୅Ռยᔥʾ៼њ̑͹͟ʾщᅋɍʱɀɪɨᷳUML ͍̗͟ɶᮀ‫ط‬ȱʭ໳ᇼɈəȣ̫̏˪͹˸៥ᦗɶʙʾ୅Ռɨȴʱɀɪʾቭ᠔ɍʱ᷷
܏8Observer ̫̇͹ͯ᧜ᅋৼɶ UML ͍̗͟ǳ

4. 2 হ ᶼ ৫ ᧓
4. 2. 1 UML ͍̗͟ɰࢧɍʱ̳͝ˋ˧̇ͯ͝˨҉ងඬՌยᔥʾ៼њࡵ᝾Ɉə̑͹͟ɨɸᷳюȫɺ܏ 5 ɶ GenerationData ៥ᦗʾՠᅋɈɧᷳ˧͛˺ᬗɶᬝᦶʾ។ഐɈᷳUML ͍̗͟ȳ᧜ᅋ೹Еɰ‫ط‬ᕶɍʱȱʾ՝ࡱɍʱ᷷܏ 7 ɰᷳ2.3.2 ጜɨᏴϿɈə Observer ̫̇͹ͯʾ᧜ᅋɍʱ UML ͍̗͟ɶ೹Еʾኊɍ᷷Subject ˧͛˺ɪConcreteObserver ˧͛˺ȳᇿϠɰᬝᦶɈɧȣʱ‫طݪ‬ᷳObserveṙ̫͹ͯȳ᧜ᅋɨȴʱ᷷

3. 2. 3 ̗˴ˑ̫ͯ̇͹ͯ᧜ᅋৼɶ UML ͍̗͟ɰѶ๪̗˴ˑ̫ͯ̇͹ͯɶ᧜ᅋ೹Еʾྀəɍ UML ͍̗͟ʾѶ๪ɍ
ʱ᷷܏ 7 ɶ UML ͍̗͟ɰ Observer ̫̇͹ͯʾ᧜ᅋɈɧѶ๪Ɉə UML ͍̗͟ʾ܏ 8 ɰኊɍ᷷Observer ˑͯ̇͹̳˗͹˺ʾᦝ֐ɈᷳConcreteObserver ˧͛˺ɰ Observer ˑͯ̇͹̳˗͹˺ʾࡵ᝾Ʉɑʱ᷷ʗə Subject ˧͛˺ɸ Observer ˑͯ̇͹̳˗͹˺ʾՠᅋɍʱ᷷ɀȦɍʱɀɪɨ Observer ˑͯ̇͹̳˗͹˺ʾࡵ᝾ɈɧȣʱЅɶ˧͛˺ʟ Subject ˧͛˺ʾՠᅋɨȴʱ᷷

3. 3 ЦϲξҪфЍҸҪᬠ኏‫ݯ‬ᙩᒞౙ̵ಉ‫ڐ‬̗˴ˑ̫ͯ̇͹ͯȳ᧜ᅋɨȴʱፚକʾԀзɶ XMI ̳ˋˑ͟ȱʭ୅Ռɍʱ᷷ɀʲɰʫʮᬓᇊᓑɸࢵួญɮ UML ͍̗͟ȱʭ̗ᷳ˴ˑ̫ͯ̇͹ͯ᧜ᅋ‫ث‬ᔥፚକʾቭ᠔ɨȴʱ᷷
܏ 9 ɰ᧜ᅋ‫ث‬ᔥፚକʾԀзȱʭ଻ȴՌɈ̗ᷳ˴ˑ̫ͯ̇͹ͯȳ᧜ᅋɨȴʱፚକɶʙ᝝ኊɈɧȣʱෲࡋʾኊɍ᷷
Ԁзɶ XMI ̳ˋˑ͟ɰɸᷳPackageAᷳBᷳC ɶ៥ᦗȳ‫ه‬ʗ

XMI ̳ˋˑ͟ɶ។ഐᷳѶ๪ยᔥɶࡵᱸࢧᢏɸ DigitalClock ͍̗͟ɪ˝͹˸˺ᐲቆȳᬓᇊɈə̳̘̂˔˗ˌɶ UML ͍̗͟ɨȞʱ᷷ʗɏ DigitalClock ͍̗͟ɨ᧜ᅋࡵᱸʾᝑȦ᷷DigitalClock ͍̗͟ɸ Observer ̫̇͹ͯʾᅋȣə̳͝ˋ˧̇ͯ͝˨ȳɨȴʱԋܽᇒɮ UML ͍̗͟ɪɈɧᏴϿɄʲɧȣʱ [10]᷷ɀɶ͍̗͟ɰࢧɈɧࡵ᝾Ɉə̑͹͟ʾ᧜ᅋɍʱɀɪɨᷳ̑͹͟ȳ̗˴ˑ̫ͯ̇͹ͯ᧜ᅋ‫ث‬ᔥፚକʾඬՌɍʱɀɪȳɨȴʱȱʾᠪʍʱ᷷๓ɰ˝͹˸˺ᐲቆ [8] ȳᬓᇊɈə̳̘̂˔˗ˌɶ UML ͍̗͟ɰࢧɈɧ᧜ᅋࡵᱸʾᝑȦ᷷ɀɶ̳̘̂˔˗ˌɸ޿࡚ɶఝ֪ᬝѢ෉֪˶˺͉̕ɨȞʱ᷷෉֪˶˺͉̕ɶ UML ͍̗͟ɰࢧɈɧࡵ᝾Ɉə̑͹͟ʾ᧜ᅋɍʱɀɪɨᷳ̑͹͟ȳࡵ‫ܤ‬ɍʱ޿ួญɮ៬ៜ͍̗͟ɰࢧɈɧ̗ᷳ˴ˑ̫ͯ̇͹ͯ᧜ᅋ‫ث‬ᔥፚକʾඬՌɨȴʱȱʾᠪʍʱ᷷

4. 2. 2 UML ͍̗͟ɰࢧɍʱ໳ᇼ̫̏˪͹˸៥ᦗɶ୅Ռยᔥʾ៼њ

XMI ̳ˋˑ͟Ԁзȱʭ໳ᇼ̫̏˪͹˸៥ᦗɶ୅ՌʾᝑȦยᔥɶࡵᱸࢧᢏɸ˝͹̷ͯ̂͹˺̳̘̂˔˗ˌɨȞʱ ANTLR ɶ̂͹˺ˮ͹̚ʾ JUDE ʾՠᅋɈɧ‫ޱ‬றɈɧਁə UML ͍̗͟ɨȞʱ᷷

ANTLR ɸ޺ȸɶ៙᠚ (JavaᷳC#ᷳC++ፅ) ɰࢧਚɈəˮʲɧȣə᷷Ѷ๪Ɉəፚକȳ PackageB ιɶԏࢂɨȞɠə‫طݪ‬ᷳ

PackageB ɶ៥ᦗɶʙʾԀзɶ៥ᦗȱʭ୅Ռɍʱ᷷

4. ᬠ ኏ হ ᶼ
4. 1 হ ᶼ ፀ ጖஭൙ଚ໩ɶ೎֜ਵʾቭȱʝʱəʝᷳ᧜ᅋࡵᱸʾᝑɠə᷷ࡵᱸ

᝝ 1 ࡵᱸࢧᢏɶ̗͹̇

UML ͍̗͟˧͛˺త

̫̏˪͹˸త

DigitalClock ͍̗͟7 ˧͛˺1 ̫̏˪͹˸ఝ֪ᬝѢ෉֪˶˺͉̕ɶ

104 ˧͛˺12 ̫̏˪͹˸

178 ˧͛˺12 ̫̏˪͹˸ǳUML ͍̗͟Antlr3.0 ɶ UML ͍̗͟—4—̫ͯˑ͛Ͷˮ̫ͯˑ͛ɨȞʱ᷷᧜ᅋࡵᱸɨɸ ANTLR3.0 ʾࢧᢏɪɈə᷷ࡵ‫ܤ‬ɍʱ̂͹˺ˮ͹̚ȱʭ JUDE ɶ̩͝͹˺˙ͯ˸̞ˌͯ͝˨ยᔥʾᅋȣɧᷳUML ͍̗͟ʾ‫ਁؙ‬Ɉᷳɕɶ UML͍̗͟Ԁзȱʭ୪ࡱɈə̫̏˪͹˸ʾ୅Ռɨȴʱȱʾᠪʍʱ᷷

4. 3 হ ᶼ ٓ ৆ʗɏ DigitalClock ͍̗͟ɰ̑͹͟ʾ᧜ᅋɈᷳObserver ̫̇͹ͯɶ᧜ᅋ‫ث‬ᔥፚକʾඬՌɍʱɀɪɨᷳɀɶ̑͹͟ȳࢵួญɮ͍̗͟ɰࢧɍʱ̗˴ˑ̫ͯ̇͹ͯ᧜ᅋ‫ث‬ᔥፚକɶඬՌɰщᅋɨȴ(a) ̑͹͟᧜ᅋձʱɀɪʾኊɍ᷷ɕɶৼᷳ෉֪ᬝѢ෉֪˶˺͉̕ɶ UML ͍̗͟ɰࢧɈɧ̑͹͟ʾ᧜ᅋɈᷳඬՌɈə Observer ̫̇͹ͯ᧜ᅋ‫ث‬ᔥፚକɰ Ob-server ̫̇͹ͯʾࡵ᭩ɰ᧜ᅋɍʍȴȱɪȣȦᡱᠳʾɍʱ᷷ɀʲɰʫʮо૾Ɉə̑͹͟ʾᷳ޿ួญɮ̳̘̂˔˗ˌɰࢧɈɧ᧜ᅋɍʱɀɪɨᬓᇊᓑȳࢵួญɮ፱܎ɨ̳͝ˋ˧̇ͯ͝˨҉ងɶඬ៟ȳᝑȫʱȱʾኊɍ᷷
ೋৼɰᷳANTLR ɶ UML ͍̗͟ȱʭᬝᦶ̫̏˪͹˸ɶ୅Ռʾࡵᝑɍʱ᷷test ̫̏˪͹˸ʾ᭎ȣə 11 ɶ̫̏˪͹˸ȱʭstringtemplate ɪ analysis ɶϝɢɶ̫̏˪͹˸ɶ୅ՌʾᝑȦ᷷ɀ(b) ̑͹͟᧜ᅋৼʲɰʫʮо૾Ɉə̑͹͟ȳᷳUML ͍̗͟Ԁзȱʭɶᬝᦶ̫̏܏ 10DigitalClock ͍̗͟ɰࢧɈ̑͹͟ʾ᧜ᅋ˪͹˸୅Ռɰщᅋɨȴʱɀɪʾኊɍ᷷

4. 4 হ ᶼ ᕅ ๘
4. 4. 1 ̗˴ˑ̫ͯ̇͹ͯ᧜ᅋ‫ث‬ᔥፚକɶඬՌ
܏ 10 ɰ DigitalClock ͍̗͟ɰࢧɈᷳ̑͹͟ʾ᧜ᅋɍʱɀɪɨᷳObserver ̫̇͹ͯɶ᧜ᅋ‫ث‬ᔥፚକʾඬՌɨȴəෲࡋʾኊɍ᷷̑͹͟᧜ᅋձɶ܏ɨɸᷳჹ‫ܤ‬ɶ౾ժɶ̗͹̇ʾ୨ɢ TimeSource˧͛˺ɪɕɶ౾ժʾ̗˸̇͟ɨ᝝ჹɍʱ DigitalClockDriver ˧͛˺ȳᇿϠɰᬝᦶɈɧȣʱ᷷̑͹͟᧜ᅋৼɶ܏ɨɸᷳObserver˧͛˺ʾࢴӿɍʱɀɪɨᷳTimeSource ˧͛˺ɪ DigitalClock-Driver ˧͛˺ɶᇿϠᬝᦶȳ᭎؎Ʉʲɧȣʱ᷷ɀʲɰʫʮᷳюȫɺჹ‫ܤ‬ɶ౾ժʾˌ̝͢˨ɨ᝝ჹɍʱ AnalogClockDriver ȳᦝ֐ɍʱ౾ʟ Observer ˧͛˺ʾᐖଫɍʱɀɪɨ‫ث‬ᔥɰɮʱ᷷
๓ɰఝ֪ᬝѢ෉֪˶˺͉̕ɶ UML ͍̗͟ɰࢧɈɧ̑͹͟ʾ᧜ᅋɈᷳObserver ̫̇͹ͯɶ᧜ᅋ‫ث‬ᔥፚକʾඬՌɈə᷷ඬՌɄ

܏ 11JugyouKamoku ˧͛˺ɪ Gakusei ˧͛˺ᷳɕʲɰᬝᦶɍʱ˧
͛˺ʾኊɍ UML ͍̗͟ǳʲəᇿϠјࡑፚକɸḂ᦯ʮɨȞɠə᷷ɕɶȦɝɶ΢ɢɨȞʱ JugyouKamoku ˧͛˺ɪ Gakusei ˧͛˺ᬗɶјࡑᬝѢɰɢȣɧᡱᠳʾᝑɠə᷷܏ 11 ɰ JugyouKamoku˧͛˺ɪ Gakusei ˧͛˺ɰᬝᦶɈɧȣʱ˧͛˺ʟ‫ه‬ʝə UML͍̗͟ʾኊɍ᷷Єෲ‫ޱ‬ೀɶ˶̝͝˝ɪɈɧɸюȫɺᅢ࡚ᅇɶ̗͹̇ʾ୨ɢ

Ryugakusei ˧͛˺ɮɭȳᦝ֐Ʉʲʱᷳɮɭȳ୯Ⱦʭʲʱ᷷ɀɶ‫ طݪ‬JugyouKamoku ˧͛˺ȳ Gakusei ˧͛˺ɰјࡑɈɧȣʱəʝᷳRyugakusei ˧͛˺ȳ JugyouKamoku ˧͛˺ʾՠᅋɨȴɮȣ᷷ʫɠɧ JugyouKamoku ˧͛˺ɶ៬ៜʾ‫ޱ‬ೀɍʱਓាȳȞʱ᷷ɈȱɈᷳЄෲೃʾូɮȳʭɄʭɰᏰȱȸ˧͛˺ᬝѢʾቭ᠔ɈəɪɀʴᷳRishuuService ˧͛˺ȳȞʱɀɪɰʫɠɧᷳΨɨ୯Ⱦə៬ៜɶ‫ޱ‬ೀʾᝑȦჼᅐȳဳȸɮʱɀɪȳʸȱɠə᷷܏ 12 ɰᷳ

RishuuService ˧͛˺ᷳJugyouKamoku ˧͛˺ɪ Gakusei ˧͛˺ɶ᠋Ᏸɮ UML ͍̗͟ʾኊɍ᷷

RishuuService ˧͛˺ȳ JugyouKamoku ˧͛˺ɪ Gakusei ˧͛˺ᬗɶ̗͹̇ɶʣʮ‫ؙ‬ʮʾᝑɠɧȣʱəʝᷳюȫ Ryugaku-sei ˧͛˺ȳᦝ֐ɄʲɧʟᷳRishuuService ˧͛˺ʾ‫ޱ‬ೀɍʲɺʫȣ᷷ʫɠɧ JugyouKamoku ˧͛˺ɪ Gakusei ˧͛˺ɶᬗɰObserver ̫̇͹ͯʾ᧜ᅋɍʱਓាɸဳȣ᷷Ѕɶ Observer ̫̇͹ͯ᧜ᅋ‫ث‬ᔥፚକɰɢȣɧʟᠪʍəɪɀʴᷳ‫ػ‬ɋʫȦɰᇿϠјࡑɰȞʱ˧͛˺ɶᬗɰɕʲʭɶ̗͹̇ʾ፩ჼɍʱ Service ˧͛˺ȳȞʱɀɪȳʸȱɠə᷷

4. 4. 2 ᬝᦶ̫̏˪͹˸ɶ୅ՌANTLR ɶ̂͹˺ˮ͹̚ȱʭ‫ؙ‬ʮՌɈə UML ͍̗͟ɰࢧɈɧᷳ̑͹͟ʾ᧜ᅋɈᷳᬝᦶ̫̏˪͹˸ɶ୅Ռʾ᠂ʙə᷷ANTLRɰɸ̕˺̘˪͹˺ɨщᅋɍʱ˧͛˺ȳ‫ه‬ʗʲʱ᷷ɈȱɈϾ‫܉‬ɸ̳͝ˋ˧̇ͯ͝˨ఉஶʾᝑȦ̑͹͟ɮɶɨ̕˺̘ɰщᅋɍʱ˧͛˺ɸԀɧ᭎ȣə᷷ANTLR ɸ̕˺̘˧͛˺ʾ᭎ȣɧᐲ̫̏˪͹˸త 11ᷳ˧͛˺త 148 ɨȞʱ᷷

ANTLR Ԁзȱʭ stringtemplate ̫̏˪͹˸ɪ analysis ̫̏˪͹˸ʾ୪ࡱɈᷳ୅Ռɍʱ᷷᝝ 2 ɰᷳ୅ՌɈə̫̏˪͹˸ɪɕ

—5—̇ʾᮀʝʱɶɨɸɮȸᷳዘᰓຕɰ̗͹̇ʾᮀʝɧ፩ჼɈɧȣə᷷

5. ͫ ˶ ̈́ೠዠɨɸ̗ᷳ˴ˑ̫ͯ̇͹ͯ᧜ᅋ‫ث‬ᔥፚକʾ୪ோɍʱɀɪɨᷳ

UML ͍̗͟ɰࢧɍʱ̳͝ˋ˧̇ͯ͝˨҉ងඬՌʾఉஶɍʱଚ
໩ɶ஭൙ʾᝑɠə᷷ʗɏᷳUML ͍̗͟ʾ។ഐɈ̗ᷳ˴ˑ̫ͯ̇͹ͯ᧜ᅋ೹Еɰ‫ط‬ᕶɍʱፚକʾඬՌɈ̗ᷳ˴ˑ̫ͯ̇͹ͯ᧜
ᅋৼɶ UML ͍̗͟ɰ‫ޱ‬ೀɍʱ᷷๓ɰᷳᬓᇊᓑȳ໳ᇼɈəȣፚକʾ UML ͍̗͟Ԁзȱʭ୅Ռɍʱଚ໩ʾ஭൙Ɉə̳᷷͝ˋ˧
܏ 12 JugyouKamoku ˧͛˺ɪ Gakusei ˧͛˺ᷳRishuuService ˧͛˺ʾ‫ه‬ʝə᠋Ᏸɮ UML ͍̗͟ǳ̇ͯ͝˨ʾᝑȦᬓᇊᓑɸ஭ኊɄʲə̳͝ˋ˧̇ͯ͝˨҉ងɰɢȣɧᷳɕɶ˧͛˺܏ʾЄෲೃɮɭʾᅋȣɧඬ៟ɍʱɀɪɨࡵ᭩ɰ̳͝ˋ˧̇ͯ͝˨ʾᝑȦȱɶ՝ాʾɍʱɀɪȳɨȴʱ᷷஭൙ଚ໩ɶ߶ড়ਵʾቭ᠔ɍʱəʝɶ᧜ᅋࡵᱸʾᝑɠə᷷ࡵᱸʲɰ‫ه‬ʗʲʱ˧͛˺తʾኊɍ᷷tool ̫̏˪͹˸ᷳcodegen ̫̏ɨɸʗɏᷳࢵួญɮ UML ͍̗͟ɰ̑͹͟ʾ᧜ᅋɍʱɀɪɨᷳ˪͹˸ᷳmisc ̫̏˪͹˸ɸ୪ࡱɈə̫̏˪͹˸ɰᬝᦶɶȞʱ̗˴ˑ̫ͯ̇͹ͯ᧜ᅋ‫ث‬ᔥፚକɶඬՌȳɨȴʱɀɪʾቭ᠔Ɉə̫᷷̏˪͹˸ɪɈɧ‫ػ‬ෲɰ୅ՌɄʲə᷷๓ɰ˝͹˸˺ᐲቆȳᬓᇊɈəఝ֪ᬝѢ෉֪˶˺͉̕ɶ UML ͍

stiringtemplate ̫̏˪͹˸ɰᬝᦶɈɧȣʱ tool ̫̏˪͹˸̗͟ɰ̑͹͟ʾ᧜ᅋɈᷳ޿ួญɮ̳̘̂˔˗ˌɶ̳͝ˋ˧̇͝

ɪᷳanalysis ̫̏˪͹˸ɰᬝᦶɈɧȣʱ codegen ̫̏˪͹˸ᷳͯ˨҉ងʾඬՌɨȴʱɀɪʾቭ᠔Ɉə᷷ʗə˝͹̷ͯ̂͹˺̂

misc ̫̏˪͹˸ȳᦝ֐Ʉʲəɀɪɰʫʮᷳ୪ࡱɈə̫̏˪͹˸̳̘˔˗ˌɨȞʱ ANTLR ɰ̑͹͟ʾ᧜ᅋɍʱɀɪɨᷳ̑͹ɶ੸‫ݩ‬ʾ஻ɮɠɧȣɮȣ᷷͟ʾᅋȣɧඬՌɈə̳͝ˋ˧̇ͯ͝˨ፚକȳᬓᇊᓑɰʸȱʮʣ

4. 5 ᘓɍȣʫȦɰᷳࢵួญɮ UML ͍̗͟ɰᭆࡱɨȴʱɀɪȳቭ᠔ɨ৙˝͹˸˺ᐲቆȳᬓᇊɈəఝ֪ᬝѢ෉֪˶˺͉̕ɶ UML ͍̗ȴə᷷͟ɰࢧɈɧɶ᧜ᅋࡵᱸɨɸ̳ᷳ͝ˋ˧̇ͯ͝˨ʾɍʍȴፚକɸϾৼɶᠦᰊɪɈɧᷳෲǻɮ̗˴ˑ̫ͯ̇͹ͯɨʫʮ޺ȸɶю႒ɰូɢȱʭɮȱɠə᷷ɈȱɈᷳ̑͹͟ʾщᅋɈɧ Observerᰊɰ᧜ᅋɈᷳଚ໩ɶ೎ᅋਵʾࡱᩁᇒɰ៼њɍʱɀɪɮɭȳ୯Ⱦ̫̇͹ͯȳ᧜ᅋ‫ث‬ᔥɮፚକʾඬՌɍʱɀɪɰʫʮᷳඬՌɈəፚ

ʭʲʱ᷷କɶ˧͛˺ᬝѢʾᡱᠳɈɧ̳ᷳ͝ˋ˧̇ͯ͝˨ɶਓាɶဳȣഭᦛ᪼᥆ɮ៬ៜʾ୨ɢɀɪȳʸȱɠə᷷ʫɠɧᷳ̑͹͟ʾщᅋɍʱɀೠቆዲɸ΢ᨃᷳబᨃኽ࡚ሂ “๓ΰЎ IT ‫ݙ‬ᇸ෬፴ɶəʝɶቆɪɨ̳͝ˋ˧̇ͯ͝˨ʾᝑȦ᭩ɶఉஶȳɨȴəɪਰʸʲʱ᷷ʗዲᬓᇊ”ɶࠄ៤ɰ‫ݙ‬ɤȣɧᝑʸʲə᷷ʗəᷳ౔ೠ࡚᝔୴ᕿУ ኽə ANTLR ɰࢧɈɧ໳ᇼɈəȣ̫̏˪͹˸ɶʙʾ୅Ռɍʱɀɪ࡚ቆዲᢶង֓ᩃ ႒՞ቆዲ‫֙ߠڇ‬ᢶ (ᠦᰊᅮ‫ر‬:20Ͷ1964) ɶ֓૾ȳɨȴə᷷ɀʲȳɨȴʱɀɪɰʫʮ̑͹͟ʾщᅋɈɧ޿ួญɮʾਁə᷷

̳̘̂˔˗ˌɶ UML ͍̗͟ȱʭ̳ᷳ͝ˋ˧̇ͯ͝˨҉ងʾඬՌɈᷳᬓᇊᓑȳࢵួญɮ፱܎ɨ៬ៜʾቭ᠔ɍʱɀɪʟ‫ث‬ᔥɪɮʱɪਰʸʲʱ᷷̑͹͟ʾо૾ɍʱɰড়əɠɧʟɠɪʟ໳ચɍʍȴဠɸᷳJUDEȳՌ֍ɍʱ XMI ̳ˋˑ͟ɶబ໩ɰɢȣɧɶɀɪɨȞɠə᷷юȫɺ̫̏˪͹˸ᬗɰʗəȳʱ˧͛˺ᬗɶᬝᦶʣᬝᦶጦɶ៥ᦗȳɭɝʭɶ̫̏˪͹˸̗͹̇ɶιɰ៥ᦗɄʲɧȣʱȱɸḃ᦯ʮɰՒȱʲɧȣʱ᷷ʫɠɧࡵ᝾Ɉə̑͹͟ɨɸ̫̏˪͹˸ຕɰ̗͹
᝝ 2 ANTLR ȱʭ stringtemplate ̫̏˪͹˸ɪ analysis ̫̏˪͹˸ʾ୅Ռ୅Ռ̫̏˪͹˸‫ؼ‬˧͛˺తstringtemplate3analysis17ᦝ֐̫̏˪͹˸‫ؼ‬

˧͛˺త

tool

37

codegen12

misc8

̫̏˪͹˸త

‫ط‬ៜ˧͛˺త

577൰

ሊ[1] D᷷Astels᷷Refactoring with UML᷷Proc᷷of International
Conference on eXtreme Programming and Flexible Processin Software Engineering 2002ᷳpp.67-70ᷳ2002᷷
[2] eXtensible Markup Language (XML)᷷http://www.w3c.
org/XML᷷
[3] M᷷Bogerᷳand T᷷Sturm᷷Refactoring Browser for UML᷷
Proc᷷of NetObjectDays 2002ᷳpp.366-377ᷳ2002᷷
[4] M᷷Fowler᷷RefactoringḏImproving the Design of Existing
Code᷷Addision Wesleyᷳ1999᷷
[5] E᷷GammaᷳR᷷HelmᷳR᷷Johnsonᷳand J᷷Vlissides᷷Design Patterns Elements of Reusable Object-Oriented Software᷷Addison Wesleyᷳ1999᷷
[6] JUDE᷷http://jude.change-vision.com/jude-web/index.html ᷷ChangeVision᷷
[7] J᷷Kerievsky᷷Refactoring to Patterns᷷Addition Wesleyᷳ
2006᷷
[8] ˝͹˸˺ᐲቆ᷷http://www.ogis-ri.jp/᷷
[9] P᷷Kruchten᷷The Rational Uniﬁed Process᷷Addison Wesleyᷳ2000᷷
[10] R᷷C᷷Martin᷷Agile Software Development᷷ Pearson Educationᷳ 2004᷷
[11] T᷷MensᷳG᷷Taentzerᷳand D᷷Muller᷷Challenges inModel Refactoring᷷Technical Report from University ofMons-HainautᷳBelgiumᷳ2005᷷
[12] Object Management Group᷷http://www.omg.org/᷷

—6—