-
Notifications
You must be signed in to change notification settings - Fork 104
Contributing: Structuring a Component
Jonathan Niles edited this page Mar 23, 2016
·
2 revisions
NOTE: This document is a work-in-progress. Please check back frequently for updates.
The core of bhima-2.X development are small, modular components that have well-defined inputs and outputs. Using components has many advantages, some listed below:
- Testability - writing small unit tests for components is easier and faster than large end-to-end tests.
- Modularity/Reusability - once tested, a component can be used anywhere with confidence.
- Maintainability - by removing view or validation logic from controllers, they can focus on implementing logic specific to their function.
In general, you should use always create a component if you have to write specific view logic three or more times.
When writing a component, the first thing you must define is the inputs and outputs. What should the component receive and what should it return? These will be the bindings
for the component.
TODO