smjn commented on PR #19057:
URL: https://github.com/apache/kafka/pull/19057#issuecomment-2697630616

   > > Could we use "composite" instead of "inheritance"?
   > > 
   > > 1. move `DeleteGroupsResult` into internal package
   > > 2. add `delegate: DeleteGroupsResult` to `DeleteConsumerGroupsResult` 
and `DeleteShareGroupsResult`
   > > 
   > > ```java
   > >     private final DeleteGroupsResult delegate;
   > >     public DeleteConsumerGroupsResult(final Map<String, 
KafkaFuture<Void>> futures) {
   > >         this.delegate = new DeleteGroupsResult(futures);
   > >     }
   > > ```
   > > 
   > > 
   > >     
   > >       
   > >     
   > > 
   > >       
   > >     
   > > 
   > >     
   > >   
   > > With this approach, we can remove `DeleteGroupsResult` from public APIs 
and maximize its internal reuse.
   > 
   > Good idea, @chia7712. We can move this forwards like this, and the 
potential rationalisation step can be separate. @smjn, seems good to you?
   
   Hi,
   Thanks @chia7712 and @AndrewJSchofield.
   
   Composition will definitely be better (low coupling) but in this specific 
case the methods being identical, I do not see it adding value. We will be 
copying the methods and have a single impl line with `super.method`. It would 
have been worthwhile if we had a couple of specialized methods in each class.
   
   I would rather go with copying the methods over this and eliminate 
`DeleteGroupsResult`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to