Re: Callback pattern

2014-01-29 Thread Kelven Yang
a >>>string >>> >> >>that >>> >> >> >represents the method name. >>> >> >> > >>> >> >> >What I was actually wondering about, though, is why we surround >>> >> >> >caller.g

Re: Callback pattern

2014-01-28 Thread Mike Tutkowski
;> >> >Wouldn't caller.getTarget().createVolumeFromBaseImageCallBack(null, >> >> >>null); >> >> >> >by itself work exactly the same way? >> >> >> > >> >> >> > >&g

Re: Callback pattern

2014-01-28 Thread Mike Tutkowski
t; >On Tue, Jan 28, 2014 at 11:57 AM, Kelven Yang > >> >> >wrote: > >> >> > > >> >> >> Mike, > >> >> >> > >> >> >> This is a very dirty hack that I personally hate it. This is the > >

Re: Callback pattern

2014-01-28 Thread Kelven Yang
to >> >> >> utilize Eclipse¹s (or other smart IDE) to do auto-completion for >>you >> >>to >> >> >> find the right callback method. >> >> >> >> >> >> if you write >> >> >> >> >> &

Re: Callback pattern

2014-01-28 Thread Mike Tutkowski
andalone method call, > >> >> > >> >> > >> >> If you write as below, it tries to tell that this is to setup a > >> >>callback, > >> >> to return this in caller.setCallback is to let you continue to use > >>

Re: Callback pattern

2014-01-28 Thread Kelven Yang
t;> >> caller.setCallback( >> >> caller.getTarget().createVolumeFromBaseImageCallBack(null, null) );, >> >> >> >> Behind scene, it uses CGLIB for dispatcher to figure out which >>method is >> >> the callback without requiring developer to give it a

Re: Callback pattern

2014-01-28 Thread Mike Tutkowski
; > >> Behind scene, it uses CGLIB for dispatcher to figure out which method is > >> the callback without requiring developer to give it as literal string > >> > >> > >> AsyncMethod pattern is used commonly in parallel algorithms to &g

Re: Callback pattern

2014-01-28 Thread Kelven Yang
pattern is used commonly in parallel algorithms to >>dynamically >> branch out sub-calculations, I think it does not fit well in CloudStack, >> and also due to the lack of language feature in Java, this hacking >> technique makes the code really hard to read &g

Re: Callback pattern

2014-01-28 Thread Mike Tutkowski
ons, I think it does not fit well in CloudStack, > and also due to the lack of language feature in Java, this hacking > technique makes the code really hard to read > > Kelven > > On 1/27/14, 6:55 PM, "Mike Tutkowski" > wrote: > > >Hi, > > >

Re: Callback pattern

2014-01-28 Thread Kelven Yang
due to the lack of language feature in Java, this hacking technique makes the code really hard to read Kelven On 1/27/14, 6:55 PM, "Mike Tutkowski" wrote: >Hi, > >I've been looking at our callback pattern. > >Can someone explain why we always seem to d

Callback pattern

2014-01-27 Thread Mike Tutkowski
Hi, I've been looking at our callback pattern. Can someone explain why we always seem to do this?: caller.setCallback(caller.getTarget().createVolumeFromBaseImageCallBack(null, null)); When setCallback is implemented like this: public AsyncCallbackDispatcher setCallback(Object us