<#3332 [flytekit-java] Introduce abstraction for ...
# flyte-github
a
#3332 [flytekit-java] Introduce abstraction for a value type Issue created by narape Describe the issue In the Sdk there is a
SdkType
that represent an abstraction for the type of a task or workflow and its multiple variables. However we are missing an equivalent to represent the type of a single value. This causes that we were leaking internal classes of the api module into the users code. For example, to create a SdkBindingData for a list of bindings, the user needs to:
Copy code
SdkBindingData.ofBindingCollection(
            LiteralType.ofCollectionType(LiteralType.ofSimpleType(SimpleType.INTEGER)),
            List.of(sum1.getOutputs().o(), sum2.getOutputs().o()));
The api module was designed to be stable a follow closely the proto classes, that is the reason of why is so verbosed Instead with the proper abstraction we could write this instead:
Copy code
SdkBindingDatas.ofBindingCollection(
            SdkLiteralTypes.integers(), List.of(sum1.getOutputs().o(), sum2.getOutputs().o()));
What if we do not do this? We would had a worse user experience because of the verbosity of the api Related component(s) flytekit-java Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte