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

ASF GitHub Bot commented on PROTON-964:
---------------------------------------

Github user bozzzzo commented on the pull request:

    https://github.com/apache/qpid-proton/pull/48#issuecomment-127597879
  
    > Could we use generics to enforce the correct type of handler is supplied 
for dispatch and avoid some instanceof checks? (e.g BuiltinEventTypeImpl.java)
    
    I'm not sure how this would work, because it's easy (and I think necessary) 
to mix and create a tangle of handlers of different descent in a tree (or even 
DAG) of handlers with Handler#add(Handler).
    
    So an Event instance will get dispatched to many handlers, and necessarily 
only some will be of an assignable type. I'm not sure how to express that with 
generics.
    
    The core can afford the luxury of declaring 'everybody extend me' but that 
is not viable for a library that sits on top of proton.
    



> Proton-J extensible event types
> -------------------------------
>
>                 Key: PROTON-964
>                 URL: https://issues.apache.org/jira/browse/PROTON-964
>             Project: Qpid Proton
>          Issue Type: Improvement
>          Components: proton-j
>    Affects Versions: 0.10
>            Reporter: Bozo Dragojevic
>            Assignee: Bozo Dragojevic
>             Fix For: 0.11
>
>
> Event.Type is an enum which makes it impossible to extend.
> Introduce a separate interface EventType and make Event.Type implement it.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to