Skip to content

[FEATURE REQUEST] Make Java codegen more OO friendly by adding contract methods to empty contract Interface #13471

Closed
@TuranDev

Description

I confirm that, if this is a feature request that has security implications, I already contacted security@digitalasset.com and followed the responsible disclosure policy.

I confirm that this is not a question or a request for technical support by the community, for which the Daml forum is available.

What is the problem you want to solve?

When generating the Java bindings all generated Templates seem to contain a static inner Contract class which itself implements an empty contract interface. These static inner Contract classes are all generated with the methods fromIdAndRecord, fromIdAndRecord (deprecated) and fromCreatedEvent

What is the solution you would propose?

The addition of the methods fromIdAndRecord, fromIdAndRecord (deprecated) and fromCreatedEvent to the Contract interface would allow for derivative code to leverage generics better using the interface.

Describe alternatives you've considered

Similar consideration could also be given to the abstract Template class itself by moving the static Identifier variable onto the parent Template class (or exposing a getter for it)

Additional context

None for now

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions