Japan Advanced Institute of Science and Technology
JAIST Repository
https://dspace.jaist.ac.jp/
Title
オブジェクト指向設計におけるデザインパターンの特定分野への適用に関する研究
Author(s)
清水, 裕光Citation
Issue Date
1997‑03Type
Thesis or DissertationText version
authorURL
http://hdl.handle.net/10119/1056Rights
Description
Supervisor:片山 卓也, 情報科学研究科, 修士domain
Hiromitsu Shimizu
Scho ol of Information Science,
Japan Advanced Institute of Science and Technology
Februaly 14, 1997
Keywords: object-oriented design, reuse, designpatterns, frameworks.
The advantage ofobject-orienteddesign,whichmakesabstractiontoreal worldusing
objects and designs software, is reusability. Though there is reusable, designing object-
orientedsoftwareishard,becauseyoumustndpertinentobjects,factorthemintoclasses
at the right granularity,dene class interfaces and inheritance hierarchies, and establish
key relationshipsamong them.
Design patterns are reusable and systematically explains reccurring design inobject-
oriented design. Each design pattern systematically names, explains and evaluates an
importantand recurring design in object-oriented systems. Design patternsmakeit eas-
ier to reuse successful designs and architectures. Design patterns can even improve the
documentation and maintenance of existing systems by furnishing an explicit specica-
tion of class and object interactions and their underlying intent. It is a partially proved
that each of design patternsfor general purpose isuseful. But, designpatterns are more
abstract, and howthose apply specicdomain isn't studied enough. So, this paper show
a case study for building framework, which is a set of co operating classes that make up
a reusabledesign for aspecicclass of software are discussed. Applying design patterns,
and guess problems with reusabledesigning. A frameworkis a setof cooperatingclasses
that make up a reusable design for a specic class of software, and most reusable in
object-oriented component.
We apply the approachto designing programming language pro cessor. Programming
language processor established in its design and apply various area. A target systems
consist of the sub-systems including scannar (lexical analyser), parser, evaluator and
viewer.
Wediscussthat the essentialp ointindesigning frameworkforprogramming language
processor are as follows: (1) extendability of grammar: Grammar symb ol incontext-free
Copyright c
1997byHiromitsuShimizu
some property. Sogrammar mustbe able to change. (2) exibility inoutput: Outputof
parser area parse tree andanabstract syntax tree. Nodeof themvarysinlanguage, but
a way of building parse tree is xed. And a way of building abstract syntax tree mayb e
changedthat is not changing a kind of node handled in language. Therefore framework
must be able to easily change a way of building abstract syntax tree. (3) Use semantic
rule: To describe attribute grammar in used of static semantics which is dicult that
prove in context-free grammar. Generally, attribute grammar may have a various typ e.
Soframework mustbe able to handleexible typ e of attributes.
Theresultofanalysingrequireforprogramminglanguageprocessor,aboutstructureof
framework,designpatternsisusableasfollows: (1) Using Interpreterpattern, framework
declared a property of eachexpression of terminal symb ol and non-terminalsymb ol,and
grammar symb ol expression is inheriting them. So this pattern allows to change gram-
mar, can output a parse tree after parsing and provide a way of semantic analysis. (2)
Builder pattern separates abstractsyntax tree builderfrom grammar symbol expression,
so framework allows to change to a way of building abstract syntax tree. And making
abstraction of a class required in semantic analysis, framework allowsto change to typ e
of attribute. (3) Iterator pattern take the responsibility for access and traversal out of
anaggregateobjectwhichislistexpressedattributeorparse treeorabstractsyntaxtree,
make traverse without exposing its internal structure, and allows to change to a way of
traversal.
After abstract classes structured framework prop osed in this paper inherits and im-
plements application of programming language processor, for testingframework that it's
design isreasonable,we giveanexample ofsimple programming language processor, and
application which applied framework designed and implemented. The result shows that
frameworkmakeiteasytoimplementit. Especially,weshowthattheparsercan b ebuilt
by the grammar automatically. Therefore, we show that framework captures almost of
the designdecisions thatrequired inbuilding applications ofprogramming language pro-
cessor. If we use design patternsand building systems with them, design patternswhich
cansolvethedesignproblem intargetsystems. Wemustevaluatethe resultofusingthat
pattern, whether itis applicable under condition of it. Soin applyingdesign patterns to
specic domain, precise documentation isuseful to build similarsystems. And therefore,
application of design patternsto problems which itgives nodirect supports for is future
work.