Replies: 1 comment
In summary platformKit separates a module’s capability from its implementation.A module advertises a capability using a typed Go interface:
While a consumer declares what it needs: The composition layer then validates and orders the graph before starting the application. It checks that:
This avoids coupling a consumer to another module’s database, constructors, handlers, or private types. A different provider can satisfy the same contract without changing the consumer. Required and optional ports also have distinct meanings. i.e. a missing required port prevents the application from booting. A missing optional port allows the module to operate with reduced functionality—for example, without an admin-page or health For synchronous behavior, use a narrow typed port. For asynchronous facts that several consumers may observe, use events or a transactional outbox. Product-specific workflows that coordinate several capabilities generally belong in the downstream application rather than inside a reusable module.
Relevant code: pk-core/pkg/module |
Uh oh!
There was an error while loading. Please reload this page.
Why does PlatformKit declare module dependencies through typed ports instead of importing and constructing another module’s concrete implementation directly? How does that work during composition?
All reactions