Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdi-dev] Extend lookup by method types and annotations?



On Fri, Sep 10, 2021 at 5:27 PM Ladislav Thon <lthon@xxxxxxxxxx> wrote:
The idea to lookup beans by presence of methods seems weird to me 

Yet that's essentially what happens in Jakarta REST. Leaving path combining out, you essentially get a request for path "/foo/bar", so you look up a bean declaring to handle "/foo/bar".

Now declaring this can be done in two ways; in pseudo code:

1.
@Path("/foo/bar")
class Resource{

}

2.
class Resource{ 
   
    @Path("/foo/bar")
    void myMethod() {}

}

So working on a prototype implementation for this, I just wondered; why can we query beans based on qualifiers at the class-level only. Why don't we include qualifiers on methods as well?

Note that more powerful bean queries are also related to my other proposal for being able to provide a synthetic injection point for a bean lookup.

Kind regards,
Arjan

 

Back to the top