On 12/2/05, Mike Kienenberger <[EMAIL PROTECTED]> wrote:
Why not? If the converter implementations have a public zero-args constructor, you could use a DI framework to create them, and configure their properties appropriately.
The hard part for this use case is that the method parameters of the actual conversion calls take a FacesContext and a UIComponent, so you'd have to mock that sort of stuff up somehow if it's really a non-JSF use case.
Craig
Well, the problem with JSF converters is that there's no way to do
dependency injection on them. So it'd be very difficult to assign a
delegate to them.
Why not? If the converter implementations have a public zero-args constructor, you could use a DI framework to create them, and configure their properties appropriately.
I also don't see anything wrong with tight
coupling in this case. It's unlikely that you'll want to change the
conversion rules dynamically by changing delegates instead of just
changing the converter used.
The hard part for this use case is that the method parameters of the actual conversion calls take a FacesContext and a UIComponent, so you'd have to mock that sort of stuff up somehow if it's really a non-JSF use case.
Craig

