Skip to content

Document the advanced public API and extension points of the .NET SDK #754

Description

@Seddryck

Context

Expressif exposes a number of public .NET APIs intended for advanced users and extension scenarios, but the documentation website does not currently explain this part of the public API as a coherent SDK surface.

In particular, the parse/bind/observe pipeline is public:

source text
    ↓
IExpressionParser
    ↓
RootExpressionSyntax
    ↓
IExpressionBinder
    ↓
IExpression

ExpressionFactory composes those extension points and can additionally receive an IExpressionObserver.

The APIs are public and therefore discoverable from IntelliSense/reflection, but a user currently has little guidance on why or when to use them instead of the primary Expression.Create(...) API.

APIs to document

At minimum, document:

  • ExpressionFactory as the advanced expression-construction entry point
  • IExpressionParser as the parsing extension point
  • IExpressionBinder as the binding extension point
  • IExpressionObserver / IExpressionObservation and the observation stages as the lifecycle-observability extension point
  • the relationship between these APIs and the simpler Expression.Create(...) front-door API
  • creation from RootExpressionSyntax for callers that already own syntax trees
  • open versus closed binding where relevant

The documentation should make clear which APIs are:

  • primary consumer API;
  • advanced API;
  • extension points intended to be implemented/replaced by consumers.

Current documentation gap

Repository search currently finds these APIs in implementation and tests, but not a documentation section explaining them as part of the public .NET SDK.

This is important because public API exists today without corresponding conceptual documentation.

XML documentation

Also improve the XML documentation of this public API.

The main types already have useful type-level summaries, for example:

  • ExpressionFactory: “Composes parsing and binding into executable expression creation.”
  • IExpressionParser: “Parses Expressif source text into its syntax representation.”
  • IExpressionBinder: “Binds syntax to an executable expression.”
  • IExpressionObserver: describes lifecycle observation and includes useful concurrency remarks.
  • IExpressionObservation: has a type-level summary.

However, important public members currently have no XML documentation of their own, including examples such as:

  • ExpressionFactory constructor and its parser, binder, and observer arguments;
  • ExpressionFactory.Create(...) / CreateClosed(...) overloads;
  • IExpressionParser.Parse(...);
  • IExpressionBinder.Bind(...) / BindClosed(...);
  • IExpressionObserver.Begin(...).

Add useful <summary>, <param>, <returns>, and where appropriate <remarks> documentation so IntelliSense is sufficient to understand the contract of each extension point.

The XML documentation should explain semantics rather than merely restating the member name.

Acceptance criteria

  • Add a .NET SDK documentation section for advanced expression construction and extension points.
  • Explain when ExpressionFactory is useful compared with Expression.Create(...).
  • Explain the parser → syntax → binder → executable-expression pipeline.
  • Explain how to inject/implement IExpressionParser, IExpressionBinder, and IExpressionObserver.
  • Explain open vs closed binding in the relevant place.
  • Include concise code examples for the main advanced scenarios.
  • Review all public members involved in these APIs and add meaningful XML documentation where currently missing or insufficient.
  • Keep the distinction between primary consumer API and extension/advanced API explicit.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsRelated to the documentation on the website or in the readmeenhancementEnhancement to an existing feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions