All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Components

In Legato, a component is a collection of code and other files that are functionally related, along with one or more licenses that apply to the components' files.

Components can be "built" generating output like object code libraries and other files. These files can be incorporated into applications and run on a target device.

Legato components can also have language-independent interfaces and configuration data.

Component-based Approach

It's important to manage complexity. The more complex a system becomes, the harder it is to ensure required behaviour without unwanted effects. The more complex the problem, the more complex the software, and there's no avoiding this necessary complexity. If complexity is carefully compartmentalized (broken into smaller pieces with like behaviour requirements), complexity can be reduced.

Many approaches have been devised to reduce complexity like 'divide-and-conquer' where the system is broken down into small, manageable parts that together provide the complete system behaviour. t's proven that decoupling parts from each other (minimizing interconnectedness) can dramatically reduce the overall system complexity and improve maintainability. Modularization and packaging support this.

Component-based software development separates implementation from interface. That lets software components be swapped out similar to hardware components (e.g., client components can be written to access a standard telephony interface without knowing the implementation of the interface).

Legato is designed to make it easier to build systems using a component-based model.

Decoupling components and hiding implementation details within components (behind their interfaces) has a major impact on maintainability:

  • Clearly defining interface and components' roles and responsibilities allow defect sources to be isolated more easily.
  • Components can be swapped out with stubs, and interfaces can be instrumented to gather more troubleshooting information.
  • Component changes that don't affect its interfaces are constrained to that component. This supports refactoring.
  • Test suites can be applied to components implementing the same interface so test reuse is also supported.

A promise of component-based software development is to enable creative interconnection of components in previously unimagined ways to discover unique new solutions.

Components designed for reuse with simple, clean interfaces using standard data types and methods can be recombined into different arrangements that exhibit different overall system behaviours. Web mashups combine previously-constructed web services into completely new applications because those web services provide well-defined interfaces using standard access mechanisms and data formats. The mashup doesn't care about how the web services are implemented; the mashup only cares about what the interfaces provide, adding the 'glue' code, and testing the new creation.

Further potential of component-based development is the ease of sharing (for free or for pay) of these reusable components. If a component is very useful to others, it can be shared and reused in accordance with the license that the author has chosen to release it under.

Component Programming Model

Legato components generally follow an event-driven model. Callback functions are attached to specific events, and when events occur, a thread's event loop triggers the appropriate callbacks.

After initialization functions run, Legato's event processing reacts to configured event handlers and registered callbacks. This approach allows multiple components to be deployed to the same process, reduces the risk of multi-threaded race conditions, and saves stack memory space. Legato uses the term handler for an event handler, which is essentially a callback function.

See Event-driven Programming for more info.


Copyright (C) Sierra Wireless, Inc. 2014. Use of this work is subject to license.