Component:
- Functionality that has been made modular/resuable that can be implemented at a higher level interface
- Software Objects that interface with other components
- Can be deployed independently
- Can be one of three views:
- Object-oriented, component is built from a class
- Conventional, component is a functional element or module
- Process-related, system building from a library
Component Characteristics:
- Reusable, often components are designed to be reused
- Replaceable, can be swapped with other similar components
- Not context specific, see Resuable, they are designed be reused in different contexts
- Extensible, new behaviors can be added
- Encapsulated, internal processes, variables, or states cannot be accessed where called
- Independent, minimal dependencies on other components
Advantages:
- Ease of Deployment, easy to update and deploy similar components as new versions are made available
- Reduced Cost, cost and development time is reduced using 3rd party components
- Ease of Development, introduce well defined functionality without impacting other parts of the system
- Reuseable, can be reused
- Reliable, as components are made more reliable the reliability of the whole system that relies on these compoents is improved
- Independent, can be worked on independently from the system in which they are used
- Maintenance and Evolution, easy to update without affecting the broader system
Props:
Propsis a keyword used in React libraries to send data between two components when they need to communicate- Note:
- this data is passed in ONE direction, from parent to child
- this data is READ ONLY, which means child components should not modify it
- Props AKA (properties) are the arguements passed into a React component similar to how an argument can be passed into a function
- Props are passed into childcomponents as objects