PicoContainer

generic signature of ComponentAdapter#getComponentImplementation

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.9
  • Fix Version/s: 2.10.1
  • Component/s: PicoContainer (Java)
  • Labels:
    None
  • Number of attachments :
    0

Description

The signature of method ComponentAdapter#getComponentImplementation is currently

Class<T> getComponentImplementation();

To me it feels like

Class<? extends T> getComponentImplementation();

should be used instead, in order to allow (eg) for

public class MyAdapter implements ComponentAdapter<List> {

private Class<? extends List> implementationclass = ArrayList.class;

public Class<? extends List> getComponentImplementation() { return implementationclass; }

// ...
}

(the above is adapted from a real case I got into while integrating pico with stripes - I want to implement an adapter which resolves to whatever ActionBeanContext class is configured in web.xml and so there is no way I can statically type the T of ComponentAdapter)

Activity

Hide
Paul Hammant added a comment -

Tell me if 2.11-SNAPSHOT works for Giorgio.

Where are you working on the Stripes binding - waay cool!!

Show
Paul Hammant added a comment - Tell me if 2.11-SNAPSHOT works for Giorgio. Where are you working on the Stripes binding - waay cool!!
Hide
Giorgio Gallo added a comment -

Thanks Paul!! That's perfect (for me)

Honestly I didn't think someone would have worked on this any soon, since it breaks source compatibility - well, I think it does at least

As for the Stripes+Pico thing - that will take a bit of a long time...
Stripes does its initialization in a Filter, while the pico-web classes do it in a Listener (meaning stripes is not ready when the listener gets executed)... on the other end, Stripe's filter wraps both request and response and other Stripes classes complain if it finds a "naked" request/response (meaning one can't use much of the functionality of pico-web).
It will be a long time until I can release anything and probably a longer one to get my patches accepted by the stripes guys...

Show
Giorgio Gallo added a comment - Thanks Paul!! That's perfect (for me) Honestly I didn't think someone would have worked on this any soon, since it breaks source compatibility - well, I think it does at least As for the Stripes+Pico thing - that will take a bit of a long time... Stripes does its initialization in a Filter, while the pico-web classes do it in a Listener (meaning stripes is not ready when the listener gets executed)... on the other end, Stripe's filter wraps both request and response and other Stripes classes complain if it finds a "naked" request/response (meaning one can't use much of the functionality of pico-web). It will be a long time until I can release anything and probably a longer one to get my patches accepted by the stripes guys...

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: