Java Reference
In-Depth Information
CHAPTER 4
Developing a DSL
Graphical Notation
In many cases, a domain-specific language (DSL) can be represented using graphical nota-
tion. Of course, not every DSL has such an application, nor is it the case that all aspects
of a single DSL can be sensibly represented in a graphical manner; a combination of
graphical and textual could be the best solution. This chapter explores the capabilities of
the Graphical Modeling Framework (GMF) project, first covering some basics of design-
ing a graphical notation.
4.1 Design Considerations
You must consider many things when selecting a graphical concrete syntax (nota-
tion) for a DSL, including scalability, information density, and semantic inter-
pretation of your notation. You can find many examples, both good and bad,
from existing notations to use as a guide, although some of the best notations
might not yet have been realized, given the restriction that we typically work in
just two dimensions. This section gives you some idea of how to best represent
your DSL using a graphical notation.
RECOMMENDATION
Leverage known notations where possible. With the popularity of several
modeling notations, certain shapes and figures already have meaning to
many people.Also, try not to provide a diagram element when it serves no
purpose in recognition or semantic meaning for the model. Textual ele-
ments (external labels) might be the best way to provide the required
information—and you don't always have to surround them by a border or
even include an associated graphic.
55
 
 
 
 
Search WWH ::




Custom Search