Skip to content

[Design/RFC]: Support for annotation such as @Step #66

Description

@phipag

What would you like?

Similar to the Python SDK's decorators we can offer annotations in Java for customers who prefer an annotation-driven programming style rather than imperative/functional programming style when implementing durable operations.

For example, @durable_step from Python can become @DurableStep in Java. The customer would be able to annotate an arbitrary method with such a (configurable) annotation and call it. The SDK will take care of the internal wiring to wrap the method logic in a context.step(...).

This issue tracks the creation of a design document for such an annotation processors.

Some technical implementation options include:

  • Using reflection at runtime and proxies to implement annotation.
  • Using annotation processors (similar to Dagger). Technical feasibility unclear.
  • Using maven/gradle plugins at build time to manipulate bytecode weaving in the logic of the processed annotation
    • Some libraries in the bytecode manipulation space include ASM, ByteBuddy, Gizmo, Java 24+ Classfile API

Possible Implementation

No response

Is this a breaking change?

No

Does this require an RFC?

Yes

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions