FAQ =================== # What are the difficulties involved in creating „reusable“ widgets when building an app? As a developer one needs to make the choice between building a "reusable" UI component versus a widget that is tightly coupled with an app - there most certainly is a tradeoff between reusability and simplicity. A reusable UI widget would need to emit generic events while a tightly coupled widget would directly talk to the app instance to control the app. Therefore, a reusable widget introduces complexity because it then becomes the responsibility of the parent widget to handle the events. A tightly coupled widget, in comparison, avoids the middleman and goes straight to the app. As the decision is centered around individual situations, an application developer has to decide if a certain component would benefit to be reusable. # Is there a difference between reuse and preserve in the context of Marko Widgets? DOM nodes can be preserved during a rerender and widget instances can be reused during a rerender (to have the same widget instance even after a rerender). A preserved DOM node is left completely in its previous state (other than being reinserted into the DOM with a new parent). A preserved DOM nodes is detached from the DOM and reinserted into the updated DOM in its proper place. Reusing the same widget instance ensures that any references to the old widget instance will still be correct. # How far should a UI be "componentized"? There is no right answer for how far a page should be decomposed into individual UI components. The goal should be for each UI component to be Focused, Independent, Reusable, Small & Testable ([FIRST](http://addyosmani.com/first/)). If you feel like a UI component does not meet these requirements then break it up into smaller UI components. # When should the body of a custom component be used? There are multiple ways to express the same thing using HTML. For example, an HTML button can be defined in two different ways: ```html ``` In the above example, the exact same button is produced, but when using the `` tag the label of the button is provided in the `value` _attribute_ and when using the `