Tag Archives: documentation

A Git Workflow for Agile Teams

18 Jun

I’ve been using git for all my new software development and have been converting my old Subversion (and *gasp* CVS) repositories over. Throughout this process I keep learning more and more about git, and my love story with it continues every day. Thanks to my friend Chris, he sent along this blog posting that really describes how you can do hardcore agile software development in teams with git. This really is helping me solidify in my head what it is I want to do, but have just never had the tools or know-how to put into practice.

At Hashrocket we use git both internally and in our Agile mentoring and training. Git gives us the flexibility to design a version control workflow that meets the needs of either a fully Agile team or a team that is transitioning towards an Agile process.

via ReinH | A Git Workflow for Agile Teams.

Minor PhoneGap Alert updates

27 May

Last night, and on my commute in to work this morning, I made some updates to my UIControls branch on Github, largely around adding callback and event support to the Alert notification code.

I’ve been working on providing more feedback into JavaScript from the commands run inside of Objective-C.  So far PhoneGap has been largely one-way, you push actions into PhoneGap and maybe you get some sort of response out in some general sort of way, but most of it has involved polling mechanisms.  Well the DOM and JavaScript in general has a native facility for dispatching ad-hoc events.  And it’s super easy to call from Objective-C, if only a little bit verbose:
[webView stringByEvaluatingJavaScriptFromString:
@"(function(){ "
"var e = document.createEvent('Events'); "
"e.initEvent('alertClosed', 'false', 'false'); "
"e.buttonIndex = %d; "
"document.dispatchEvent(e); "
"})()",
buttonIndex
];
It looks a little complicated, but it really isn’t.  It’s calling some code in an anonymous function closure so this doesn’t leak any references or variables into the global scope, creates a DOM event, sets it with a custom event name, adds some arbitrary properties to it, and dispatches it against the document element.
This same pattern applies everywhere some event occurs, and something in the JavaScript side of the gap:// barrier might be interested in it.  Listening to this event is as simple as doing:
document.addEventListener(‘alertClosed’, function(e) {
debug.log(“Alert box with button ” + e.buttonIndex);
}, false);
Pretty simple, and super flexible.  If you’re interested in an event, you bind an event listener to it.  If you’re not, you simply ignore it.  I’m pretty excited about this design pattern since it reduces the complexity of having to loop and wait for something that might never happen.
Update: Oh, I almost forgot.  The main reason for doing all this is I added the capability to add a second button to the Alert popup.  So you can do “OK / Cancel”, or whatever else you want.  But doing so necessitated adding callback support so you could tell not only when the user closed the alert, but so you could tell which button they pressed.

So much to do, so little time

7 May

I think work wrecked my brain a bit today. I have so many ideas running through my head, and just not enough time to catch up to them all. It happens to all of us from time to time, but the thing is I have so much fun with work, that it’s hard to moderate myself. I think I’m going to head home, listen to some Bob Marley, and when I meet up with my wife and her parents at the pub, I’m going to watch the hockey game, drink some beer, and enjoy my evening without technology.

That being said, I’ve recently made some great updates to PhoneGap, and have added some docs. Check out the generated JavaScript documentation and iPhone documentation from my personal branch at Github. I’m sure we’ll get the docs pushed up to the main PhoneGap website soon.