Kenneth Knowles commented on BEAM-2754:

We used to automate this via FooCoder.of(Class). This was lost when we added 
support for generics, when I think we switched to reflectively invoking 
getCoderProvider(). To this provider, we can pass both the type and subcoders, 
supporting strictly more use cases by merging the prior concepts of 
CoderFactory and CoderProvider as we had planned for some time.

I like the idea of adding back very simple cases. We should switch all of this 
to use an annotation-driven interface rather than magic methods.

> Simplify DefaultCoder
> ---------------------
>                 Key: BEAM-2754
>                 URL: https://issues.apache.org/jira/browse/BEAM-2754
>             Project: Beam
>          Issue Type: Bug
>          Components: sdk-java-core
>            Reporter: Eugene Kirpichov
>            Assignee: Eugene Kirpichov
>            Priority: Minor
> DefaultCoder is too hard to use - it requires having a CoderProvider class 
> and a bunch of other boilerplate. It should have simpler usage modes, e.g. 
> @DefaultCoder(FooCoder.class) class Foo should simply work if FooCoder only 
> has a "static FooCoder of()" method, or "of(TypeDescriptor)" for more complex 
> use cases (eg generics).

This message was sent by Atlassian JIRA

Reply via email to