This document discusses principles for template engine design. It covers separating logic from views using patterns like MVC, MVP and MVVM. It also discusses features template engines should provide like data bindings, formatting data, logic implementation through loops and conditionals, caching capabilities, and code reuse through includes and partials. The key points to consider for template engine design are the platform, architecture, data binding, functionality, available development resources, and resulting code style.
11. MVC
Application architecture
• Input is directed to controller
• Many-to-many relationship
between View and Controller
• View doesn’t have any
knowledge about Controller
• View is aware of the Model it is
expecting to pass on it
12. MVP
Application architecture
• Input is directed to View
• One-to-One relationship
between View and Presenter
• View holds the reference to it’s
Presenter and Presenter is aware
of this View
• View is not aware of the Model.
Presenter updates the Model
13. MVVM
Application architecture
• Input is directed to View
• One-to-Many relationship
between ViewModel and View
• ViewModel haven’t any
knowledge about View
• View is not aware of the Model.
ViewModel updates the View.
15. Data-bindings
• Variables from controller
• Custom variables
• Ierarchy variables (objects, associative arrays)
Features – Variables
16. Format Data (Modificators)
• Format numeric data
• Date format
• Client input filtering
• HTML encoding
• Static resources formating, placeholders
replacements
Features – Variables