课程: Python: Advanced Design Patterns (2018)
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Interpreter
- [Narrator] Experts in a particular field often develop their own language called a domain-specific language. They use special terms to refer to certain concepts. This jargon allows them to quickly convey what needs to be communicated without needing to explain the details every time. The interpreter pattern makes it possible to use this kind of a domain-specific language to perform a task on your computer. To make this happen, your computer needs an interpreter program that translates an expression into something it can understand. The interpreter pattern provides clever design guidance on how to go about doing this. Here the focus is not too much on building a comprehensive and huge computer language like Python. The pattern is more about a small, custom language you need to create to avoid writing different code repeatedly to conduct similar tasks. A good example is a problem of searching particular patterns in a text. We already have a well-developed language for conducting these…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。