<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>class BrianYamabe extends Journeyman implements SoftwareDeveloper { &#187; Google App Engine</title>
	<atom:link href="http://brianyamabe.com/category/google-app-engine/feed/" rel="self" type="application/rss+xml" />
	<link>http://brianyamabe.com</link>
	<description>public Blog documentDevelopment(Passion passion) {</description>
	<lastBuildDate>Fri, 30 Jul 2010 13:55:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Just Trying to Test Leads to Cleaner Code</title>
		<link>http://brianyamabe.com/2009/10/27/just-trying-to-test-leads-to-cleaner-code/</link>
		<comments>http://brianyamabe.com/2009/10/27/just-trying-to-test-leads-to-cleaner-code/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 16:45:01 +0000</pubDate>
		<dc:creator>byamabe</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Law And Gospel]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://brianyamabe.com/?p=34</guid>
		<description><![CDATA[As I mentioned in my last post, I&#8217;ve been trying to get some unit testing going so that I can keep focused and gain a higher level of comfort with the code I&#8217;m writing. I started by trying move a business method that had crept into the model and put it in its own business [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>As I mentioned in my last post, I&#8217;ve been trying to get some unit testing going so that I can keep focused and gain a higher level of comfort with the code I&#8217;m writing. I started by trying move a business method that had crept into the model and put it in its own business class. To test the new business class I tried to use <a href="http://www.voidspace.org.uk/python/mock/">Mock</a> to imitate the behavior of the data model, but I couldn&#8217;t find a way to get it to mimic the behavior of a Query object which is both indexed and has methods on it. I did learn that Django fixtures were supported by app-engine-patch. In fact, I learned that most of the ./manage.py functionality works. I had incorrectly assumed that app-engine-patch only allowed you run a Django app on App Engine server, not that it could be used like standard Django. After writing a test for the new business class, I created a fixture to support the test. Well, the test kept failing even though it should have passed. I did some digging, and it seems that the models in the fixture that have relationships aren&#8217;t getting loaded. I&#8217;ve got a question out to the list to see if this is actually the case, but I can&#8217;t think of another explanation.</p>
<p>So, I didn&#8217;t actually get any unit tests working, but while writing the test I noticed that there were model classes in my view as well as the database classes in my controller and business logic in my models. So now I&#8217;ve got it all cleaned up and the code appears to be working (no tests though). I keep seeing what kind of tests I can write and maybe someone will fix the problem with models with relationships in fixtures.</p>
]]></content:encoded>
			<wfw:commentRss>http://brianyamabe.com/2009/10/27/just-trying-to-test-leads-to-cleaner-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Refatoring for Unit Testing</title>
		<link>http://brianyamabe.com/2009/10/17/refatoring-for-unit-testing/</link>
		<comments>http://brianyamabe.com/2009/10/17/refatoring-for-unit-testing/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 17:44:43 +0000</pubDate>
		<dc:creator>byamabe</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Google App Engine]]></category>

		<guid isPermaLink="false">http://brianyamabe.com/?p=32</guid>
		<description><![CDATA[I&#8217;ve been working on LaG for a month or so. Progress has been slow, because I haven&#8217;t set enough short term goals. I really need to get back to my GTD weekly review to prioritize and get to a list of actions for the project. Most of the work I have done has been to [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;ve been working on LaG for a month or so. Progress has been slow, because I haven&#8217;t set enough short term goals. I really need to get back to my GTD weekly review to prioritize and get to a list of actions for the project.</p>
<p>Most of the work I have done has been to flesh out the data model. I had some basic functionality that I wanted to implement, and then I fleshed out the data model and functionality to support it. The one thing that was nagging me was that there weren&#8217;t any unit tests. I know that unit tests are a good thing. I&#8217;ve even done some TDD/BDD and have been very happy with the results. I&#8217;ve also had the experience where TDD/BDD has made me feel like I wasn&#8217;t actually moving closer to delivering anything of value. I was writing good (in my mind at least) code, but wasn&#8217;t getting closer to end user functionality. I decided that I needed to get some tests written and that it would also help me by focusing me on a task that would move LaG forward.</p>
<p>Part of the reason I had avoided writing tests was that I assumed that <a href="http://code.google.com/p/app-engine-patch/">app-engine-patch</a> didn&#8217;t support the same unit testing that is available in standard Django. Of course it took me all of one Google search to find that I was wrong. So, I fired up ./manage.py test and 26 tests ran and passed . Cool, now I had to add my tests.</p>
<p><b>No Business Logic in model.py</b></p>
<p>I recently read a tweet from UncleBob about isolating 3rd party API&#8217;s. For Django/app-engine-patch, I consider model.py to be owned by the API. It will be very different for each of the implementations and I would like to be able to port the app to a standard Django deployment if GAE is no longer appropriate. I found that some business logic has crept into model.py. The first thing I need to do is to write a test and pull this functionality out of model.py.</p>
<p><b>No db in the Business Layer</b></p>
<p>I also found that some google.appengine.ext.db calls had crept into my business layer. So my next task will be to write a test and remove any db calls from my business layer.</p>
<p>I think my decision to focus on just getting some functionality and database modeling done without testing was appropriate. I wanted to get a feel for what I would be able to do and what the application would feel like. But now, it&#8217;s time for me to clean up the code and get to TDDing. Sometimes l need to just write code to keep myself motivated, and other times I need to be more disciplined and follow a process to gain focus. I&#8217;m not sure the Agile term &#8216;spike&#8217; is exactly write, but that what it feel like to me. A short interval where you experiment and just code, then go back to disciplined development.</p>
]]></content:encoded>
			<wfw:commentRss>http://brianyamabe.com/2009/10/17/refatoring-for-unit-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Setup</title>
		<link>http://brianyamabe.com/2009/09/11/project-setup/</link>
		<comments>http://brianyamabe.com/2009/09/11/project-setup/#comments</comments>
		<pubDate>Sat, 12 Sep 2009 05:27:05 +0000</pubDate>
		<dc:creator>byamabe</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Law And Gospel]]></category>

		<guid isPermaLink="false">http://brianyamabe.com/?p=26</guid>
		<description><![CDATA[app-engine-patch Let&#8217;s get down to some programming. First, I downloaded app-engine-patch 1.1RC. This gives me Django 1.1 with Google&#8217;s model classes instead of Django&#8217;s own Model. For those who don&#8217;t know, Google App Engine (GAE) uses BigTable instead of a relational database like SQL Server or MySQL. With BigTable you trade the data integrity of [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><b>app-engine-patch</b></p>
<p>Let&#8217;s get down to some programming. First, I downloaded <a href="http://code.google.com/p/app-engine-patch/">app-engine-patch</a> 1.1RC. This gives me Django 1.1 with Google&#8217;s model classes instead of Django&#8217;s own Model. For those who don&#8217;t know, Google App Engine (GAE) uses <a href="http://labs.google.com/papers/bigtable.html">BigTable</a> instead of a relational database like SQL Server or MySQL. With BigTable you trade the data integrity of a relational database for performance and scalability. Because I&#8217;m using app-engine-switch, I&#8217;ve assumed that django-admin.py wouldn&#8217;t be of any use so my development cycle has been all manual. If anyone has used django-admin.py with app-engine-patch, please let me know. It certainly would be more convenient.</p>
<p><b>Changes</b></p>
<p>After downloading and unzipping the file, you are left with a directory name &#8216;app-engine-patch-sample&#8217; which will be the basis for my application. I renamed it &#8216;law-and-gospel&#8217;. Then I deleted the &#8216;blueprintcss&#8217; directory and renamed &#8216;myapp&#8217; to &#8216;lawandgospel&#8217;. In app.yaml I changed the application attribute from &#8216;aep-sample&#8217; to &#8216;law-and-gospel&#8217;. In settings.py I changed the DEFAULT_FROM_EMAIL attribute to use my email address. And in urls.py, I added (r&#8217;^lawandgospel/&#8217;, include(&#8216;lawandgospel.urls&#8217;)) as the first of the urlpatterns after &#8221;.</p>
<p><b>pyfacebook</b></p>
<p>Next, since I know I&#8217;m going to use <a href="http://github.com/sciyoshi/pyfacebook/tree/master">pyfacebook</a> so after I downloaded and unzipped the files. Then I copied the &#8216;facebook&#8217; directory into the root of &#8216;law-and-gospel&#8217;.</p>
<p><b>changes</b></p>
<p>in settings.py I added &#8216;facebook.djangofb.FacebookMiddleware&#8217; to the MIDDLEWARE_CLASSES attribute and added the FACEBOOK_API_KEY and FACEBOOK_SECRET_KEY attributes with the appropriate values from the Facebook application I registered.</p>
<p><b>LaG Changes</b></p>
<p>I started removing the models, forms, and view that came with the default app-engine-patch application and replaced them with some of the models, forms, and views that I will need for LaG. At this point, documenting every change would be excessive so from now on I will be documenting the more interesting aspects of the development.</p>
]]></content:encoded>
			<wfw:commentRss>http://brianyamabe.com/2009/09/11/project-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Facebook Game with Django on Google App Engine &#8211; Setup</title>
		<link>http://brianyamabe.com/2009/09/07/facebook-game-with-django-on-google-app-engine-setup/</link>
		<comments>http://brianyamabe.com/2009/09/07/facebook-game-with-django-on-google-app-engine-setup/#comments</comments>
		<pubDate>Mon, 07 Sep 2009 21:55:35 +0000</pubDate>
		<dc:creator>byamabe</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Law And Gospel]]></category>
		<category><![CDATA[Status]]></category>

		<guid isPermaLink="false">http://brianyamabe.com/?p=16</guid>
		<description><![CDATA[Now that I&#8217;ve decided to write a Facebook app using Django on Google App Engine I plan to document as much of the development process as possible. The first steps were purely administrative. I registered a Google App Engine application called &#8220;law-and-gospel&#8221; (lawandgospel was taken). I then registered a Facebook application called &#8220;LawAndGospel.&#8221; Nothing complicated [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Now that I&#8217;ve decided to write a Facebook app using Django on Google App Engine I plan to document as much of the development process as possible. The first steps were purely administrative. I registered a Google App Engine application called &#8220;law-and-gospel&#8221; (lawandgospel was taken). I then registered a Facebook application called &#8220;LawAndGospel.&#8221; Nothing complicated about either of those things so I won&#8217;t bother doing a walk through of those processes.</p>
]]></content:encoded>
			<wfw:commentRss>http://brianyamabe.com/2009/09/07/facebook-game-with-django-on-google-app-engine-setup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>That Was Short Lived</title>
		<link>http://brianyamabe.com/2009/09/04/that-was-short-lived/</link>
		<comments>http://brianyamabe.com/2009/09/04/that-was-short-lived/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 19:03:32 +0000</pubDate>
		<dc:creator>byamabe</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Lift]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Scala]]></category>

		<guid isPermaLink="false">http://brianyamabe.com/?p=14</guid>
		<description><![CDATA[I started working through the Lift getting started guide and other documentation and I&#8217;ve come to the conclusion that a lot of the benefits of using Lift aren&#8217;t applicable to the project. The project is a Facebook app and I have a little experience writing those with Django and Google App Engine. All the nice [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I started working through the Lift getting started guide and other documentation and I&#8217;ve come to the conclusion that a lot of the benefits of using Lift aren&#8217;t applicable to the project. The project is a Facebook app and I have a little experience writing those with Django and Google App Engine. All the nice CRUD, AJAX, JSON, Comet, etc. integration isn&#8217;t going to help me. Also, there aren&#8217;t a whole lot of examples of using Lift with Facebook. In fact, my biggest concern with using Lift would be the lack of documentation. There is &#8220;<a href="http://groups.google.com/group/the-lift-book">The Lift Book</a>&#8221; but this is more a guide to what Lift can do and how to do it. There are a few tutorial floating around, but the ones I found were out of date and incomplete. I&#8217;ve come to realize that I learn best by working through examples and there just aren&#8217;t enough of those to make me want to move forward with Lift.</p>
<p>I&#8217;ve decided to go with Django on Google App Engine for this project. It&#8217;s somewhat familiar ground and will allow me to focus more on building the app rather than learning a framework and language. Although I&#8217;m not well versed enough in Django, Python, Google App Engine, and Facebook to believe I won&#8217;t learn a whole lot.</p>
]]></content:encoded>
			<wfw:commentRss>http://brianyamabe.com/2009/09/04/that-was-short-lived/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
