Data Structures   3.  Sorts of Domain Definitions 4.  Manipulations of Domain Definitions 5.  Translating Domain Definitions 6.  Dialogue Sessions 7.  Example of Concentric Circles 8.  Example of Domain Substitution applied to Concentric Circles 9.  Example of an Order Processing Application 10.Example of an Airport Information System 11.Example of a Rental Boat Business 12.Benefits of Domain Definitions

8.  Example of Domain Substitution applied to concentric circles

Our next example illustrates domain substitution as discussed in “4.1 Substitution of Domain Definitions”.  As a starting point we use the domain definitions of the preceding example and we substitute the Center point by its coordinates X and Y. The result is a reduced set of domain definitions (Figure 7).

<< Concentric Circles Version 2 >>

Circle = X + Y + Radius;

X = Number; Y = Number;

Number = integer;

integer = predefined;

ConcentricCircles = collection (Circle);

Figure 7: Domain substitution applied to Concentric Circles

These domain definitions will be input for the metaprocessor. The result is a skeleton file, called "ConcCirclesV2.txt". A session shows  the data of  3 concentric circles based on Center point substitution (Figure 8).

include "ConcCirclesV2.txt";

ConcCircles(X, Y, Number) -> multi(Circle);

ConcCircles(x, y, n) = newCircle(x, y, 1 .. n);

{ConcCircles(1, 1, 3)}?

{ Circle:[X = 1;

Y = 1;

Circle:[X = 1;

Y = 1;

Circle:[X = 1;

Y = 1;

Figure 8: Example of domain substitution of concentric circles

 Part 6: Metaprogramming Example of Domain Substitution

 Introduction: Home | Highlights of Elisa | Integrating Different Paradigms | Getting Started with Elisa | Demo's  | What is Domain Orientation | Bibliography | Copyright | News | Contact Language Description: Lexical Elements | Basic Data Types and Expressions | Definitions | Streams | Backtracking | Statements and Special Expressions | Arrays | Lists | Descriptors | Components | Collections | Generic Components | Terms | Categories | Types | Built-in Definitions | Higher-order Definitions | External Interfaces | Index Data Structures: Sequences | Examples involving Lists | Trees | Graphs | Searching State Spaces | Language Processing | Knowledge Representations Domain Modeling: Design Patterns: Introduction | Abstract Factory | Builder | Factory Method | Prototype | Singleton | Adapter | Bridge | Composite | Decorator | Facade | Flyweight | Proxy | Chain of Responsibility | Command | Interpreter | Iterator | Mediator | Memento | Observer | State | Strategy | Template Method | Visitor