UTAH STATE UNIVERSITY COMPUTER SCIENCE CS-7350 Reading Assignment GoF Patterns: Interpreter, Iterator Jorge Edison Lascano Spring 2012 01-27-2012INTERPRETER, ITERATORGoFPATTERNSInterpreter, its main intent is interpreting well-structured sentences based on grammars, lookingfor sequence of actions that make sense syntactically. One constraint is that it only serves forsimple grammars, then the question is How to measure the complexity of the grammar?. Otherdifficulty is the representation of the tree structure (solved in certain way by composite). TheInterpret method represents the main behavior, but it needs help to traverse the structure.Concluding, this pattern by itself does not solve all the proposed problems by GoF.The consideration of a complex grammar is still present. It is said that it is helpful for regularexpressions, but not for parsers. So, the complexity could be measured by the level of(de)composition, or the complexity in the grammatical structure of the sentences.Iterator, also known as cursor, it´s intent is to allow access to elements sequentially withoutexposing their representation. The main use is mentioned as data structure traverse, but, thisfeature is already implemented by almost every modern language, namely:Java, C#, Smalltalk intheir Collections. Now, the question is: Is it really necessary to implement an iterator? And theanswer is YES, if we need to implement a different way (than traditional data structures) totraverse the elements and also if we need to implement multiple traversal ways at the same time.As this is a behavior pattern, the main concern should be oriented to decide the place where thetraversal algorithm should be implemented. Maybe using a Bridge between the ConcreteIteratorand the ConcreteAggregate could solve this problem.