[ 
https://issues.apache.org/jira/browse/KAFKA-18697?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17923650#comment-17923650
 ] 

Chia-Ping Tsai commented on KAFKA-18697:
----------------------------------------

[~ijuma] Would you recommend applying the record pattern to the connect-api if 
there are no apparent compatibility limitations with the record class?

The downside of using record in public APIs is we can't use the inheritance 
which make us find another way to rename API or change the package.

case0: we want to rename the `DeprecatedObject` to `NewObject`

 
{code:java}
DeprecatedObject getObject(); {code}
{code:java}
@Deprecated
public class DeprecatedObject extends NewObject{code}
case1: we want to move `MyObject` to new package

 
{code:java}
MyObject getObject(); {code}
{code:java}
@Deprecated
public class MyObject extends anotehr.package.MyObject{code}
It's possible that such cases are non-existent. Alternatively, we could 
deprecate the getter instead. Therefore, this concern does not constitute a 
strong objection to using records in the connect-api.

Another concern is the `equals` and `hashCode` generated by Record class - do 
we want to expose them as public APIs?

> Migrate suitable classes to records in connect module
> -----------------------------------------------------
>
>                 Key: KAFKA-18697
>                 URL: https://issues.apache.org/jira/browse/KAFKA-18697
>             Project: Kafka
>          Issue Type: Sub-task
>            Reporter: 黃竣陽
>            Assignee: Mingdao Yang
>            Priority: Minor
>
> We should change these class to Record
> OffsetSync, PluginSource, ConnectClusterDetailsImpl, TaskInfo, Message, 
> LoggerLevel, ErrorMessage, CreateConnectorRequest, ConnectorStateInfo, 
> ConnectorOffsets, ConnectorOffset, ConnectorInfo, ConfigValueInfo, 
> ConfigKeyInfo, ConfigInfo, ActiveTopicsInfo, ConnectRestExtensionContextImpl, 
> RestartRequest, ConnectorTaskId



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to