From the course: Spring: Design Patterns

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

The Interpreter pattern

The Interpreter pattern

From the course: Spring: Design Patterns

Start my 1-month free trial

The Interpreter pattern

- [Instructor] In the final behavior pattern that we're going to talk about, is one that has a very specific use case in Spring, but it's not one that I've even ever implemented myself. It's very, very seldom that you would use this. So the interpreter pattern's primary use case in the Spring framework, is through the Spring Expression Language, and this might allude to what this pattern is used for. This pattern's use cases are as I mentioned, limited, but most often if not always are used with user input. The input is parsed and converted into specific commands, or functions, and that parsing behavior is what the interpreter is providing. Expressions are deemed terminal or non-terminal to determine if you need to do future parsing. So it gives you this sort of tree structure where you're parsing commands until you get to the end. And if you've ever looked at how program languages are parsed, this is sort of the same pattern, only applied to a system instead of a programming…

Contents