Next: Component Declarative Statements, Previous: Component Behavior, Up: Components [Contents][Index]
There are tree types of component:
component, regular component, or leaf
A component that defines its implementation in its behavior
,
foreign
A component that defines only ports. Its behavior is said to be defined
elsewhere. This is a placeholder for a component that is implemented by
some other means, like another programming language (e.g. C++
),
system
A component that comprises other components in its system
specification, See Systems.
Every component in Dezyne is a leaf component, unless it is a system component. The following component implements one interface and a straightforward behavior section:
component hello { provides ihello p; requires ihello r; requires itimer t; behavior { on p.hello (): t.create (); on t.timeout (): r.hello (); on r.world (): p.world (); } }
This component does not reveal its implementation in Dezyne under this name. It represents a component implemented elsewhere. It may be implemented in another programming language, or it is implemented in Dezyne without exposing any of its implementation details.
component timer { provides itimer t; }
A component timer_system
decomposed into two components
ihello
and timer
where these components are connected via
their ports.
component timer_system { provides ihello p; requires ihello r; system { hello h; timer t; p <=> h.p; h.t <=> t.t; h.r <=> r; } }
Next: Component Declarative Statements, Previous: Component Behavior, Up: Components [Contents][Index]