SAService Architect Open designer
SAService ArchitectDocumentation
Python API reference service.component(name, *, description=None)

Component

A service-owned definition of repeated graph fragments. Register each concrete repetition using existing Stream objects.

When to use

Declare the graph normally, then annotate identical connected fragments for the Designer.

Behavior

  • service.component(name, description=...) registers and returns a Component with an identity derived from its name. Do not supply UUIDs or a separate key.
  • component.fragment(*streams, appearance=None) registers one concrete repetition. Pass the actual Stream objects after creating their connections. The method does not connect streams or copy their functions.
  • Pipelines remain independent: create them through service.pipeline(name). There is no component.pipeline(...) or pipeline component= ownership parameter.
  • Put optional collapsed-card coordinates on each fragment(...) through Appearance(x=..., y=...), not on the component definition. Either coordinate may be omitted; fragment color is not supported.
  • YAML-to-Python generation emits a named Component and its fragment registrations. Serialized membership references existing pipeline/stream keys rather than runtime numeric IDs or occurrence identifiers.
  • Python membership checks reject foreign or unregistered streams and overlapping fragments. Use the Designer's semantic matching/rebuild to inspect whether repeated fragments still have equivalent functions, types and connections.

Component definition properties

Shared visual identity, not a runtime wrapper.

PropertyTypeDescription
namestr

Non-empty display name. The component key is derived from this name.

Required
descriptionstr | None

Optional description of the repeated business logic.

Default: None

fragment(*streams, appearance=None) properties

One concrete repetition of the definition.

PropertyTypeDescription
streamsStream...

Existing stream objects from this service. Membership does not create graph connections.

Required
appearanceAppearance | None

Optional position of this repetition when collapsed; x and y are optional.

Default: None

Annotate repeated business logic

# Declare each pipeline and its concrete streams normally.
# Connect the streams before registering their repeated fragments.
load_create >> price_create
load_update >> price_update

pricing = service.component(
    "Customer Pricing",
    description="Load customer data and calculate the effective price.",
)
pricing.fragment(load_create, price_create)
pricing.fragment(
    load_update, price_update,
    appearance=Appearance(x=400, y=200),
)

# load_create/load_update use the same function identity.
# price_create/price_update use the same function identity.
# The four streams remain separate runtime nodes.