Upload
valikos-ostakh
View
109
Download
0
Embed Size (px)
Citation preview
What frameworks give us from the box
• view rendering
• partial rendering
• support of helper methods
Disadvantages of helpers
• do not allow inheritance
• methods are calling without a receiver
• collision between helpers with similar methods
Advantages of decorators
• allow inheritance
• allow encapsulation
• friendly for unit testing
• does not mutate decorated object
• does not change the behavior of decorated object
Advantages of ‘cells’
• basically a small MVC stack
• own render engine
• OOP features
• separate presentation from the view logic
Typical situation
• duplicated views for some UI part
• each view can render specific partials
• each partial can build specific content
Conclusions
• separated from presentation logic
• easy maintenance
• test coverage
• isolated dependencies