View Full Version : DataCallback vs. AsyncCallback?

29 Apr 2008, 2:25 PM
I'm wondering if someone could shed some light on this question for me... Why does ext GWT (and MyGWT before it) define this DataCallback interface, rather than leveraging the "standard" AsyncCallback defined in GWT itself?

I can see the obvious differences...only have to implement 1 method instead of 2, and check a flag for success or failure. I'm looking more fundamentally...what problem does this new interface solve, that can't be solved (or is kinda hard to solve) with just an AsyncCallback?

Please don't take this question the wrong way... I'm just trying to wrap my head around some more of this library, and want to make sure I understand as best I can how to leverage the library.



29 Apr 2008, 7:11 PM
Prior to GWT 1.5, AsyncCallback was not generic and onSuccess was passed an Object. DataCallback uses a LoadResult.

If we were designing from scratch, this would probably make more sense:

public interface DataCallback<R extends LoadResult> extends AsyncCallback<R> {