Multiple choice technology architecture

Which Behavioral Pattern would help in parsing and translate a Specific Expression?

  1. Command

  2. Interpreter

  3. Observer

  4. Iterator.

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The Interpreter Pattern is designed to parse and evaluate sentences in a language according to a grammar. It defines a representation for the grammar and an interpreter that uses that representation to interpret sentences. Command encapsulates requests, Observer defines notification updates, and Iterator traverses collections - none handle parsing and translation like Interpreter.