This article describes the Interpreter design pattern. This is a behavioral design pattern, a category of design pattern used by software engineers, when writing computer programs.
The Interpreter pattern is a design pattern, used in software engineering, to identify meaning to symbols, words or sentances in a language. Computer languages use interpreters and databases use them to evaluate database queries. each symbol or token represents a class, and the relationship between these classes defines the syntax of the language. The Interpreter uses the syntax and grammar to interpret the language. It is defined as a behavioral design pattern, because program execution can be affected by what is interpreted.
The obvious benefit is a unified language that separate systems can share, or a human interface that performs complex operations based on simple keywords. The logic that constrains an application is exposed through the language, and provides a testable interface of input parameters.
In it's simplest form, an interpreter can be the processor for a naming convention. For example, knowing how to split a filename into chunks and acting on the file depending on the parts of the filename, like storing into a "Sales" database, or processing the file as an ".xml" file. Another example would be a function to translate of decimal to hex. It takes in the decimal value, then looks up the literal representation of the value and returns the hex equivalent. To do this, it must know the sequence of characters that represent each value, and how they build up from bits to bytes. These rules are the grammar behind the language.
↑ Return to Top
Abhishek.Sur edited Revision 3. Comment: let me know if you dont want these updates. If you dont want me to change, my email id is abhi2434@hotmail.com. I am new to Wiki section and learning how to write cool wiki stuffs. I like this feature though.
XAML guy edited Revision 2. Comment: tweak
XAML guy edited Revision 1. Comment: tidied sections
XAML guy edited Original. Comment: speling