For the complete documentation index, see llms.txt. This page is also available as Markdown.

Zongsoft.Components

Responsibilities of the Zongsoft.Components namespace and its subnamespaces.

Zongsoft.Components is the component model namespace in the core class library, covering basic builtins such as commands, execution pipelines, handlers, filters, converters, supervised objects, workers, identifiers, and event exchanges. Its goal is not to provide a specific business capability, but to provide a set of runtime abstractions for business objects in different fields that are composable, extensible, and reusable by the host.

Main Responsibilities

  • Define component identities, aliases, weights, named objects, and service descriptions so components can be discovered, described, and selected.

  • Provides command mode, command tree, command expression parsing, command exit and parameter binding to trigger business actions across domains and with low coupling.

  • Provides execution pipelines, handlers, and filters to organize context, execution logic, and cross-cutting features into scalable execution units.

  • Provides runtime component modes such as worker, monitor, weighted selector, and attempt tracker for background tasks, status observation, and failure control.

  • Provide common converters, state machines and component feature extensions to reduce repeated implementation of infrastructure code.

Command Mode

The command pattern is one of the most commonly reused component models across modules in Zongsoft.Components. It describes an operation as a command expression, and CommandExecutor locates CommandNode in the command tree, creates CommandContext, and calls the ICommand instance. Commands are not tied to a specific container or host: the same set of commands can be called directly by a background service or web program, or loaded as interactive commands by a terminal host.

This mode is particularly suitable for cross-domain calls. The caller only needs to know "what action to perform" and "which parameters to pass", and does not need to refer to the specific service interface. For example, SMS sending, queue subscription, file operation, configuration reading and other capabilities can all be entered into the unified execution pipeline through command expressions. The specific implementation of general commands is mainly located in the Zongsoft.Commands project, and the command interaction in the terminal program is implemented by Zongsoft.Terminals based on the same set of models.

Commands

Sub Namespace

namespace
Description

Zongsoft.Components

Core types of command models, such as ICommand, CommandBase, CommandContext, CommandNode, CommandLine, and CommandExecutor.

Zongsoft.Components.Commands

Built-in component commands implemented based on the command model, such as worker start, stop, pause, resume and status query commands.

Zongsoft.Components.Converters

Common converters for Boolean, enum, version, schema, etc.

Zongsoft.Components.Features

Retry, Fallback, Breaker, Throttle, Timeout and other execution feature models.

Zongsoft.Components.States

State machine, state diagram, state context, state handler and state flow.

Type

Last updated