@Jonas: As long as the self-promotion is on topic I don't think it is a problem, it's very welcome instead.
As for how I achieve the 90%.. You assumed right, I decouple the Wave code from the other code. How I see it, the difference between a JavaScript app and a Wave JavaScript app is that without Wave, everything happens instantly. In Wave, you have to send some data to Wave and wait for the callback from Wave before you let things happen. So what I do is I write a function that makes changes instantly. This is all that the gadget needs to work without Wave. Then I add a function that sends data to Wave. And finally, in the gadget state change callback function, the gadget calls the "original" function which does the actual work. So I would have a callback function gadgetCallback(), a function someTask() and a function someTaskWave(). someTaskWave() sends new data to Wave after a click on a button or something, then gadgetCallback() is called by Wave and calls the someTask() function with the received data. If I use the gadget without Wave, I would just call the someTask() function directly after the button click. Since the someTaskWave() function and the gadgetCallback() function are really tiny because they don't have to do much, combined they make up well under 10% of the whole code and I can test all the rest of the code locally or add another layer on top to add support for another Wave-like service. Having a mock framework is way better of course ^^, although the decoupling of the Wave code from the other code still has the bonus of making it easy to use the gadget for other services than Wave, so the best solution would be to combine both approaches. If you care about cross service compatibility that is :) And I have to say that this wasn't some crazy well thought through design decision on my part, it just happens that I always start to implement all the Wave stuff at the very end when the app is already working :) On Feb 11, 12:42 am, Jonas Huckestein <[email protected]> wrote: > Hi Everybody, > > I have just released WaveConnector - a turnkey solution for developing > wave gadgets using GWT and testing them in hosted mode. Please head > over to my blog athttp://thezukunft.comor the project page > athttp://code.google.com/p/waveconnector-gwt/for details. It's as easy > as downloading a zip archive :D > > Chris, how di you achieve the 90%? I assume you must also decouple the > GWT code from the Gadget/Wave API? I have simply implemented a mock > version of the wave API. That way I think I can do all testing > locally. > > Kayode, WaveConnector is exactly the mock framework (+ some > convenience functions) I was talking about :) > > Sorry for this shameless selfpromotion on this board but I think this > might actually help a lot of people or get them to develop for Wave in > the first place. > > What do all of you think of a dedicated Wave+GWT group? I asked that > question on the GWT groups earlier and people seemed to be interested. > > Cheers, Jonas > > This is my first ever open source contribution so please give me > comments and feedback on my blog or the project page. > > On Feb 10, 2:07 am, HaiColon <[email protected]> wrote: > > > > > What I do is I write the gadget in a way that makes it work both > > locally (or as a website on a remote server) and then I add a layer on > > top that makes it work with Google Wave. That way I can test 90% of > > the gadget locally, no problem. And for the other 10% I just use the > > debug features of the sandbox Wave client. That has worked good so far > > even for bigger/more involved gadgets and the bonus is that your > > gadget then doesn't need to be Wave exclusive. > > > If you'd want to use a test-driven development approach you could only > > test this 90% non-Wave part of the application but none of the Google > > Wave specific stuff in the other 10%, so this approach may not be good > > enough for everyone. > > > Cheers, > > Chris > > > On Feb 9, 6:52 am, Jonas Huckestein <[email protected]> wrote: > > > > Hi guys, > > > > so I just started developing Wave Gadgets and I'm currently using GWT. > > > While there are obvious benefits such as unit testability, cross- > > > browser support and code-splitting, there are also some downsides. For > > > instance I cannot easily test gadgets locally (not to mention testing > > > robots!). I had to create a local mock implementation of the wave API > > > for testing and every time I use a new API feature I have to add it to > > > my mock implementation. All in all it feels kind of clunky and > > > strange. > > > > Are there any easier ways to develop (possibly very complex) wave > > > gadgets? What do you guys use? > > > > In case you are interested, I wrote a tutorial in how to get started > > > developing gadgets with gwt. Also, I guess I will be uploading my > > > WaveMock framework to Google Cloud this week (if anybody is > > > interested): > > > >http://thezukunft.com/2010/02/08/a-wave-gadget-robot-using-gwt-2-0-an... > > > > Cheers, Jonas -- You received this message because you are subscribed to the Google Groups "Google Wave API" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-wave-api?hl=en.
