<?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>Jim Cassidy &#187; Languages</title>
	<atom:link href="http://jimcassidy.ca/category/tech/languages/feed/" rel="self" type="application/rss+xml" />
	<link>http://jimcassidy.ca</link>
	<description>Programming for fun and profit since 1989</description>
	<lastBuildDate>Mon, 02 Jan 2012 18:52:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Node.js: My New Preoccupation</title>
		<link>http://jimcassidy.ca/2012/01/02/node-js-my-new-preoccupation/</link>
		<comments>http://jimcassidy.ca/2012/01/02/node-js-my-new-preoccupation/#comments</comments>
		<pubDate>Mon, 02 Jan 2012 18:52:49 +0000</pubDate>
		<dc:creator>Jim Cassidy</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://jimcassidy.ca/?p=1098</guid>
		<description><![CDATA[So, it&#8217;s is 2012! What is a new year without a new preoccupation? I have been working on a .NET based application using MVVM. All I can say is:  .NET seems like a very uncomfortable straitjacket to me. So, in my spare time, I dream of making my escape. This time, I am playing with [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jimcassidy.ca/wp-content/uploads/2012/01/nodejs-light.png"><img class="alignleft size-full wp-image-1099" title="nodejs-light" src="http://jimcassidy.ca/wp-content/uploads/2012/01/nodejs-light.png" alt="" width="260" height="71" /></a>So, it&#8217;s is 2012! What is a new year without a new preoccupation?</p>
<p>I have been working on a .NET based application using MVVM. All I can say is:  .NET seems like a very uncomfortable straitjacket to me.</p>
<p>So, in my spare time, I dream of making my escape. This time, I am playing with <a title="Node" href="http://nodejs.org/" target="_blank">Node.js</a>.  I won&#8217;t say much about it right now, except to say that I am playing with the idea of developing my own little library to make node code easier to write and maintain.</p>
<p>Code readability has become a big commitment for me. I work with so much code that is virtually unmaintainable and unreadable. It offends me. I do not mean to offend or unfairly criticize anybody that I have worked with, but I have grown frustrated by the fact that programmers do not know how to write clean, beautiful and elegant code. Bad names, bad functions, and poor architecture abound.</p>
<p>I like node, but the first thing I notice is that the code can get ugly pretty fast. Today, I am playing with <a title="Tamejs" href="http://tamejs.org/" target="_blank">tamejs</a>, which makes it easier to write clean asynchronous code.  For now, I am calling my library GumMachine. More about that later.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimcassidy.ca/2012/01/02/node-js-my-new-preoccupation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.NET Productivity Sucks</title>
		<link>http://jimcassidy.ca/2010/12/27/net-productivity-sucks/</link>
		<comments>http://jimcassidy.ca/2010/12/27/net-productivity-sucks/#comments</comments>
		<pubDate>Tue, 28 Dec 2010 02:15:44 +0000</pubDate>
		<dc:creator>Jim Cassidy</dc:creator>
				<category><![CDATA[Change]]></category>
		<category><![CDATA[Cranky Rants]]></category>
		<category><![CDATA[Python/Jython]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Productivity]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://jimcassidy.ca/?p=1067</guid>
		<description><![CDATA[I am being deliberately provocative in my headline, but a co-worker and I were commenting to each other that we felt that we were becoming less productive in .NET. On the whole, we do not think it is our fault. Our current project uses the Prism framework. Only one member of our team can claim [...]]]></description>
			<content:encoded><![CDATA[<p>I am being deliberately provocative in my headline, but a co-worker and I were commenting to each other that we felt that we were becoming less productive in .NET. On the whole, we do not think it is our fault. </p>
<p>Our current project uses the <a href="http://compositewpf.codeplex.com/" target="_blank">Prism</a> framework. Only one member of our team can claim to be extremely versatile using this framework &#8211; the promise is that it allows developers to build applications that are easier to maintain. </p>
<p>Some members of the team are on a learning curve, but it seems to be a challenge for them. I experience the same thing a year ago on another project that was using Model-View-Presenter. In theory, the benefits are clear. In practice, not so clear yet. I find that I spend a lot of time learning and/or teaching, and I wonder what it will be like when we add new or different developers to the team.</p>
<p>I get tired of type errors in .NET &#8211; I have felt for a long time that the compiler is trying to protect me from making errors I would never make. But, I do not have have anything coherent to say about that right now. I just want to cite an <a href="http://kurtgrandis.com/blog/2010/02/24/python-django-vs-c-asp-net-productivity-showdown/">interesting article</a> that states that developers are more productive using Django than they are using .NET.</p>
<p>I have nothing to add &#8211; just want to say: I am feeling less productive in .NET than I used to. I like Python &#8211; I used it on a project over the summer. It felt great to deliver working code every day. Is it just me? </p>
]]></content:encoded>
			<wfw:commentRss>http://jimcassidy.ca/2010/12/27/net-productivity-sucks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript is Not A Computer Language?</title>
		<link>http://jimcassidy.ca/2009/05/28/javascript-is-not-a-computer-language/</link>
		<comments>http://jimcassidy.ca/2009/05/28/javascript-is-not-a-computer-language/#comments</comments>
		<pubDate>Fri, 29 May 2009 01:37:44 +0000</pubDate>
		<dc:creator>Jim Cassidy</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.jimcassidy.ca/?p=499</guid>
		<description><![CDATA[Several years ago, I had the pleasure of working on a contract at Canadian Forest Products. I worked with a great group of people who had worked together for years, on a good project with clear requirements. While I was there, I used the remote scripting toolkit from Microsoft, which allowed me to communicate with [...]]]></description>
			<content:encoded><![CDATA[<p>Several years ago, I had the pleasure of working on a contract at Canadian Forest Products. I worked with a great group of people who had worked together for years, on a good project with clear requirements. While I was there, I used the remote scripting toolkit from Microsoft, which allowed me to communicate with the server without reloading the web page: we now call this technique AJAX. I wrote a lot of JavaScript.</p>
<p>While I was there, Terry French, team leader of Canfor’s e-business effort,  expressed an opinion. I am paraphrasing after years have passed &#8211; if I do not get it right, I hope Terry will forgive me: &#8220;You code as if JavaScript were a programming language.  It is not. It&#8217;s a scripting language. It&#8217;s great for providing simple form interactions, and validating fields on submit. That&#8217;s it.&#8221;</p>
<p>If this blog were a trashy daytime TV talkshow, it would be one of those look-at-me-now shows. You know the kind: people who were unpopular in high school, but who have made good, confront their tormentors. Terry was a great guy to work with, but on behalf of the much maligned computer language, JavaScript, I say: look at me now!</p>
<p><a title="server side JavaScript" href="https://wiki.mozilla.org/ServerJS/Introduction" target="_blank">Server side JavaScript</a> is making a comeback.  But, wait, there&#8217;s more.  JavaScript programmers now get to deal with sophisticated concepts such as <a title="currying" href="http://www.dustindiaz.com/javascript-curry/" target="_blank">currying</a>, callbacks, <a title="closures" href="http://www.jibbering.com/faq/faq_notes/closures.html" target="_blank">closures</a>, <a title="array comprehensions" href="https://developer.mozilla.org/en/New_in_JavaScript_1.7" target="_blank">array comprehensions</a>, and <a title="TDD" href="http://www.eviltester.com/index.php/2008/06/08/test-driven-javascript-code-coverage-using-jscoverage/" target="_blank">test driven development</a> in JavaScript.</p>
<p>And then there are those lovely libraries: <a title="jquery" href="http://jquery.com/" target="_blank">JQuery</a>, <a title="mootools" href="http://mootools.net/" target="_blank">Mootools</a>, and <a title="yui" href="http://developer.yahoo.com/yui/" target="_blank">YUI</a>, just to name a few. JavaScript has come a long way. What do you think of JavaScript now, Terry.</p>
<p>If you are interested in Javascript, check out Douglas Crockford&#8217;s videos on JavaScript at <a title="crockford" href="http://video.yahoo.com/watch/111585/1027823" target="_blank">Yahoo Video</a>.</p>
<div><object width="500" height="322" data="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.40" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="AllowScriptAccess" value="always" /><param name="bgcolor" value="#000000" /><param name="flashVars" value="id=1027823&amp;vid=111585&amp;lang=en-us&amp;intl=us&amp;thumbUrl=http%3A//l.yimg.com/a/i/us/sch/cn/v/v0/w327/111585_320_240.jpeg&amp;embed=1" /><param name="src" value="http://d.yimg.com/static.video.yahoo.com/yep/YV_YEP.swf?ver=2.2.40" /><param name="flashvars" value="id=1027823&amp;vid=111585&amp;lang=en-us&amp;intl=us&amp;thumbUrl=http%3A//l.yimg.com/a/i/us/sch/cn/v/v0/w327/111585_320_240.jpeg&amp;embed=1" /><param name="allowfullscreen" value="true" /></object><br />
<a href="http://video.yahoo.com/watch/111585/1027823">Douglas Crockford: &#8220;Advanced JavaScript&#8221; (1 of  3)</a> @ <a href="http://video.yahoo.com">Yahoo! Video</a></div>
]]></content:encoded>
			<wfw:commentRss>http://jimcassidy.ca/2009/05/28/javascript-is-not-a-computer-language/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Persisting Jython Objects Using DB4O</title>
		<link>http://jimcassidy.ca/2009/01/05/persisting-jython-objects-using-db4o/</link>
		<comments>http://jimcassidy.ca/2009/01/05/persisting-jython-objects-using-db4o/#comments</comments>
		<pubDate>Mon, 05 Jan 2009 17:10:11 +0000</pubDate>
		<dc:creator>Jim Cassidy</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Python/Jython]]></category>
		<category><![CDATA[DB4O]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[Jython]]></category>

		<guid isPermaLink="false">http://www.jimcassidy.ca/?p=472</guid>
		<description><![CDATA[If you have been following my blog, you will know that I have been playing with the following technologies: DB4O (an open source object database), Jython (Python 2.5, implemented on the JVM), and Django (A python based MVC-style web application framework in the same class as Ruby on Rails). So far, in tutorials I wrote [...]]]></description>
			<content:encoded><![CDATA[<p>If you have been following my blog, you will know that I have been playing with the following technologies: <a title="db4o" href="http://db4o.com" target="_blank">DB4O</a> (an open source object database), <a title="jython" href="http://www.jython.org/Project/" target="_blank">Jython</a> (<a title="python" href="http://python.org" target="_blank">Python</a> 2.5, implemented on the <a title="JVM" href="http://en.wikipedia.org/wiki/Java_Virtual_Machine" target="_blank">JVM</a>), and <a title="Django" href="http://www.djangoproject.com/" target="_blank">Django</a> (A python based <a title="MVC" href="http://en.wikipedia.org/wiki/Model-view-controller" target="_blank">MVC</a>-style web application framework in the same class as <a title="RoR" href="http://rubyonrails.org/" target="_blank">Ruby on Rails</a>).</p>
<p>So far, in <a title="Tutorials" href="http://www.jimcassidy.ca/2008/10/28/jython-formula-one-tutorial/" target="_blank">tutorials</a> I wrote in November of last year, we have seen that Jython allows us to write Python code that uses Java libraries, such as DB40. I altered the standard <a title="Formula One Tutorial" href="http://developer.db4o.com/Resources/view.aspx/Formula_One_Tutorial" target="_blank">DB4O Formula One tutorial</a> using Jython instead of Java, and showed that we can persist and retrieve objects using this technology.</p>
<p>I also mentioned that Django, a Python based web application framework, also runs on Jython.</p>
<p>Which leads us to this entry, where I will start thinking and tinkering to find a way to use DB4O with Django/Jython rather than a relational database.</p>
<p>I am doing this for fun, not for profit. I am not an expert with any of the technologies I am using. I stand in awe of the very talented open source programmers who precede me. I hope to learn as much as I hope to teach and share what I know, or think I know.</p>
<p><strong>Persisting Objects:</strong></p>
<p>In my previous <a title="Formula One Tutorial" href="http://www.jimcassidy.ca/2008/10/28/jython-formula-one-tutorial/" target="_blank">example</a>, I created Plain Old Java Objects (Pojos), and created a <a title="JAR" href="http://java.sun.com/developer/Books/javaprogramming/JAR/basics/" target="_blank">JAR</a>. I used the classes in the JAR to create the objects I persisted using DB4O. I have since decided that this is not desirable. I think this creates a barrier to Python programmers who want to use Django, Python and DB4O togther.</p>
<p>Therefore, I have resolved to persist Python classes by providing the means to automagically inspect these classes and generate the JAR files. I shared <a title="Plug into Django" href="http://www.jimcassidy.ca/2008/11/20/plug-db4o-into-django/" target="_blank">these thoughts</a> over a month ago.</p>
<p>Before writing any code, I just want to reflect on the task at hand. Let&#8217;s gather our assumptions.</p>
<ul style="list-style-type: square;padding-left: 30px">
<li>For every Python data type, there is a corresponding Java data type.</li>
<li>A &#8220;simple&#8221; object is based on a class that contains primitive types only.</li>
<li>A complex object contains other objects, or collections of objects.</li>
<li>We may need to make two passes to persist objects &#8211; first simple objects, and then complex.</li>
<li>A class contains an implementation as well as data, and we want to persist both.</li>
<li>If we change the definition of a class in our project, we need to think about what happens to our previously stored objects.</li>
<li>Our Jython classes must inherit from a single class only, or we will not be able to produce an equivalent Java class.</li>
</ul>
<p>In Django, we define models, and then use a command (python manage.py syncdb) to generate the corresponding database. The database is created automagically, based on the settings in the settings file (settings.py). The model is able to perform basic operations to create, read, update and delete objects (CRUD).</p>
<p>We want our DB4O objects to behave in the same way &#8211; as much as possible, we do not want to violate the expectations of Django programmers who have used Django with relational databases.</p>
<p>In my next entry, I will try to write code that creates a Java class based on a Jython class and saves it in a file. I will keep it simple to start, and the code will evolve as we go.</p>
<p>Our first model will be simple &#8211; a class with a few attributes of various types. The output will be a class files &#8211; we will not worry about creating the JAR just yet.</p>
<p>Once we have produced a simple class file, we will produce class that make two passes and resolve inheritance issues as well as contained objects that inherit from previously defined classes.</p>
<p>Code to come in a day or two.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimcassidy.ca/2009/01/05/persisting-jython-objects-using-db4o/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Learn Python, Why Don&#8217;t You?</title>
		<link>http://jimcassidy.ca/2008/12/03/learn-python-why-dont-you/</link>
		<comments>http://jimcassidy.ca/2008/12/03/learn-python-why-dont-you/#comments</comments>
		<pubDate>Wed, 03 Dec 2008 16:13:34 +0000</pubDate>
		<dc:creator>Jim Cassidy</dc:creator>
				<category><![CDATA[Cranky Rants]]></category>
		<category><![CDATA[Python/Jython]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[DB4O]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[Jython]]></category>

		<guid isPermaLink="false">http://www.jimcassidy.ca/?p=448</guid>
		<description><![CDATA[Since I have been writing about Jython, a version of Python implemented on the JVM, I thought I would provide a link to some Python resources for Java programmers who are using DB4O: Learn Python, why don&#8217;t you? If you like what Java has to offer in terms of class libraries, but you like the [...]]]></description>
			<content:encoded><![CDATA[<p>Since I have been writing about <a title="Jython" href="http://www.jython.org/Project/" target="_blank">Jython</a>, a version of Python implemented on the JVM, I thought I would provide a link to some Python resources for Java programmers who are using DB4O: <a title="Learn Python" href="http://arstechnica.com/news.ars/post/20081202-getting-a-grip-on-python-six-ways-to-learn-online.html" target="_blank">Learn Python, why don&#8217;t you?</a></p>
<p>If you like what Java has to offer in terms of class libraries, but you like the Python language and its <a title="idioms" href="http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html" target="_blank">idioms</a>, then Jython is the best of both worlds.</p>
<p>To prepare for my next installments on Jython, <a title="Django" href="http://www.djangoproject.com/" target="_blank">Django </a>and <a title="db4o" href="http://db4o.com" target="_blank">DB4O</a>, read about <a title="introspection" href="http://diveintopython.org/power_of_introspection/index.html" target="_blank">introspection</a> in Python.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimcassidy.ca/2008/12/03/learn-python-why-dont-you/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Good Advice For Any Developer</title>
		<link>http://jimcassidy.ca/2008/11/24/good-advice-for-any-developer/</link>
		<comments>http://jimcassidy.ca/2008/11/24/good-advice-for-any-developer/#comments</comments>
		<pubDate>Mon, 24 Nov 2008 16:10:09 +0000</pubDate>
		<dc:creator>Jim Cassidy</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Python/Jython]]></category>
		<category><![CDATA[Ruby/JRuby]]></category>

		<guid isPermaLink="false">http://www.jimcassidy.ca/?p=404</guid>
		<description><![CDATA[I am working to use reflection to generate a POJO from data models defined in Jython &#8211; DB4O can only persist Java ojects. However, as I sort that out and  prepare for my next DB4O/Jython/Django post, let me share this good advice for any developer who builds any sort of web application in any language. [...]]]></description>
			<content:encoded><![CDATA[<p>I am working to use reflection to generate a POJO from data models defined in Jython &#8211; DB4O can only persist Java ojects. However, as I sort that out and  prepare for my next DB4O/Jython/Django post, let me share this good advice for any developer who builds any sort of web application in any language.</p>
<p>These <a title="seven good habits" href="http://www.ibm.com/developerworks/opensource/library/os-php-secure-apps/?S_TACT=105AGY46&amp;S_CMP=PCTAB" target="_blank">seven habits</a> for developing secure applications target PHP developers, but they constitute good advice for you, even if you are working in another language. Take heed.</p>
]]></content:encoded>
			<wfw:commentRss>http://jimcassidy.ca/2008/11/24/good-advice-for-any-developer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Plug DB4O Into Django</title>
		<link>http://jimcassidy.ca/2008/11/20/plug-db4o-into-django/</link>
		<comments>http://jimcassidy.ca/2008/11/20/plug-db4o-into-django/#comments</comments>
		<pubDate>Fri, 21 Nov 2008 03:03:10 +0000</pubDate>
		<dc:creator>Jim Cassidy</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Python/Jython]]></category>
		<category><![CDATA[DB4O]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[Jython]]></category>

		<guid isPermaLink="false">http://www.jimcassidy.ca/?p=360</guid>
		<description><![CDATA[As I continue to work with Django, I am coming to appreciate the elegance and simplicity of its design. Less Ruby on Rails style &#8220;magic&#8221; gives us more flexibility. You can store your models any way you like. Last weekend, I played with the possibility of using Couchdb, and I found an example that seemed [...]]]></description>
			<content:encoded><![CDATA[<p>As I continue to work with Django, I am coming to appreciate the elegance and simplicity of its design. Less Ruby on Rails style &#8220;magic&#8221; gives us more flexibility. You can store your models any way you like. Last weekend, I played with the possibility of using <a title="Couchdb" href="http://incubator.apache.org/couchdb/" target="_blank">Couchdb</a>, and I found an<a title="couch on django" href="http://lethain.com/entry/2008/aug/18/an-introduction-to-using-couchdb-with-django/" target="_blank"> example</a> that seemed easy to understand. (Couchdb is another open source project that I may write about later.)</p>
<p>There should be two steps to plugging DB4O into Django. First, we should be able to store settings in the settings.py file to specify where and how we will be storing our objects. The second step should be to create and use our models almost exactly as we would in a regular Django application. It should be that easy.</p>
<p><strong>Editing Settings</strong></p>
<p>It is not my goal to duplicate information you can get elsewhere. To find out how to set up a Django project, and to understand the files that are created for you, see the following <a title="Django Tutorials" href="http://docs.djangoproject.com/en/dev/" target="_blank">tutorials</a>.</p>
<p>In this entry, we are going to look at how to use the <a title="settings" href="http://docs.djangoproject.com/en/dev/topics/settings/#topics-settings" target="_blank">setting file</a> in Django to store settings for DB4O. You can store anything in the settings file you like, and you can store these settings in separate settings files named prodsettings.py, devsettings.py etc. These settings are easy to retrieve from views and models.</p>
<p>We are going to make the following assumptions in our example: we only have one settings file, and it is called settings.py. Also, we are persisting objects to a file, and we are not using an object server.</p>
<p>A cllient/server mode is available in DB4O, and we will have to provide for it later. (DB4O client/server mode is covered in Chapter 8 of the book, <strong>The Definitive Guide to db4o</strong>. The chapter about client/server mode is <a title="chapter eight" href="http://www.springerlink.com/content/h204p31282862143/" target="_blank">available for free</a>, if you are curious.)</p>
<p>To create settings, find your settings file, called settings.py, and add values. To see what entries look like, see below:</p>
<pre>	# Django settings for mysite project.

	DEBUG = True
	TEMPLATE_DEBUG = DEBUG

	ADMINS = (
	    # ('Your Name', 'your_email@domain.com'),
	)

	MANAGERS = ADMINS

	DATABASE_ENGINE = ''
	DATABASE_NAME = '/path/to/file.db4o'
	DATABASE_USER = ''     # Not used with db4o in file mode.
	DATABASE_PASSWORD = '' # Not used with db4o in file mode.
	DATABASE_HOST = ''     # Not used with db4o in file mode.

	# Local time zone for this installation. Choices can be found here:
	# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
	# although not all choices may be available on all operating systems.
	# If running in a Windows environment this must be set to the same as your
	# system time zone.
	TIME_ZONE = 'America/Chicago'

	# Language code for this installation. All choices can be found here:
	# http://www.i18nguy.com/unicode/language-identifiers.html
	LANGUAGE_CODE = 'en-us'

        .  .  .  .  .  .  .</pre>
<p>For our purposes, DATABASE_NAME will be the name of the file used by DB4O to persist objects. If you have read the DB4O documentation, you will know that you also have the option of running a server, in which case we could also use the DATABASE_HOST and DATABASE_PORT settings.</p>
<p>We also have the option of creating any settings we want to help us manage our application&#8217;s behavior. Django&#8217;s convention is to use capital letters for settings and to separate words with underscores.</p>
<p>At this point, we have enough information to find and connect to our DB4O file and we have stored it in the settings file. These settings will be used by our models to create objects and manage them. Our models will be written in such a way as to hide DB4O specific details from programmers. In my next installment, I will think about how to create a model for us to use with DB4O running in Django/Jython.</p>
<p>My thinking is that I will create my models in Jython, but I will create a command line script to create plain old Java objects (POJOs) and place them in a jar for us. I am lazy, and I always use Eclipse to create my jars for me. I expect to face some challenges at the command line, but I am up for it.</p>
<p>Therefore, the steps will be:</p>
<ol>
<li>Create models in a file called models.py.</li>
<li> Run a command line command to generate a jar that contains classes for the the Java objects we want to persist. This jar will need to be in Jython&#8217;s classpath when the application runs. Corresponds to python manage.py syncdb for regular Django models.</li>
<li> Build views, and use Django just as you would to create any other Django application.</li>
</ol>
<p>The only difference will be in the behavior of the models, but our goal will be not to violate too many expectations. Regular Django models subclass <em>django.db.models.Model</em>, but ours will subclass <em>DB4OModel</em>, a class we will create. Our DB4O should resemble Django models as much as possible.</p>
<p>In my next installment, let&#8217;s look at <em>DB4OModel</em>. What does it need to look like?</p>
]]></content:encoded>
			<wfw:commentRss>http://jimcassidy.ca/2008/11/20/plug-db4o-into-django/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pythonic DB4O</title>
		<link>http://jimcassidy.ca/2008/11/17/pythonic-db4o/</link>
		<comments>http://jimcassidy.ca/2008/11/17/pythonic-db4o/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 14:37:41 +0000</pubDate>
		<dc:creator>Jim Cassidy</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[Python/Jython]]></category>
		<category><![CDATA[DB4O]]></category>
		<category><![CDATA[django]]></category>

		<guid isPermaLink="false">http://www.jimcassidy.ca/?p=341</guid>
		<description><![CDATA[Jim Huginin, the founder the Jython project, is credited with having said: &#8220;The purpose of a programming language is to let software developers express their intentions as simply and directly as possible.&#8221; Unfortunately, we computer programmers are cursed by their own understanding of complexity. In fact, non-programmers often think complexity is a fundamental measure of [...]]]></description>
			<content:encoded><![CDATA[<p>Jim Huginin, the founder the Jython project, is credited with having said: &#8220;<em>The purpose of a programming language is to let software developers express their intentions as simply and directly as possible.&#8221;</em></p>
<p>Unfortunately, we computer programmers are cursed by their own understanding of complexity. In fact, non-programmers often think complexity is a fundamental measure of our skill. The truth is that complexity is easier to achieve than simplicity. Simplicity is the Holy Grail of any framework or programming language.</p>
<p>I aspire to developing code that clearly and simply expresses my intentions. Simplicity is in the eye of the beholder, of course. Often, one paints oneself into a corner and then simplicity goes out the window. However, we am starting from scratch here, so let&#8217;s be hopeful.</p>
<p>My site stats indicate that few people have paid attention to the articles I posted by <a title="Nene" href="http://blog.dhananjaynene.com/2008/09/commentary-on-python-from-a-java-programming-perspective/" target="_blank">Dhananjay Nene</a>. As I continue working with DB4O, I hope you get a chance to read these articles, especially <a title="Nene2" href="http://blog.dhananjaynene.com/2008/09/python-from-java-how-duck-typing-influences-class-design-and-design-principles/" target="_blank">the code examples</a>.</p>
<p><strong>The Project</strong></p>
<p>For anyone who is jumping in late, the latest version of <a title="Jython" href="http://www.jython.org/Project/" target="_blank">Jython</a>, a version of <a title="python" href="http://python.org" target="_blank">Python </a>that has been implement on the JVM, supports <a title="django" href="http://www.djangoproject.com/" target="_blank">Django</a>, a framework similar to Ruby on Rails. I want to demonstrate how to build a website, using Django to manage controllers and views, but I want to manage my models using DB4O.</p>
<p>Since I started writing about <a title="db4o" href="http://db4o.com" target="_blank">DB4O</a>, my site has been getting visitors from about 50 different countries. But, there are few visitors from my own country, Canada. I find that interesting.</p>
<p><strong>This Week</strong></p>
<p>Django lets you replace parts of the framework very easily. In fact, I am quickly coming to appreciate this flexibility when I compare Django to other frameworks. Django does not force you to use its templating system, nor does it for you to use its data models. This is the flexibility we want to exploit to get DB4O working happily with Dajngo running on Jython.</p>
<p>This week, I want to concentrate on hiding DB40 from programmers who want to use DB4O to persist objects while using Django/Jython. The objects should save themselves, and the details should be administered from a central file. This is where I hope to get the most help from Jython as opposed to Java.</p>
<p><strong>A Small Task</strong></p>
<p>While I do this work, if anybody is interested in helping out, here is a task. I have managed to install <a title="NGINX" href="http://wiki.codemongers.com/Main" target="_blank">Nginx</a> on a server, and I have Django under Nginx running using FastCGI and regular Python, not Jython. To do this, I had to install <a title="flup" href="http://trac.saddi.com/flup" target="_blank">Flup.</a> My question is: can we install Flup under Jython? I would be happy to chat with anybody who either knows the answer, or is willing to investigate.</p>
<p>Otherwise, we will have to find another way &#8211; we could run Django in a servlet, and we could perhaps use <a title="Jetty" href="http://www.mortbay.org/jetty/" target="_blank">Jetty</a>. Any other options?</p>
]]></content:encoded>
			<wfw:commentRss>http://jimcassidy.ca/2008/11/17/pythonic-db4o/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python vs Java</title>
		<link>http://jimcassidy.ca/2008/11/12/python-vs-java/</link>
		<comments>http://jimcassidy.ca/2008/11/12/python-vs-java/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 14:24:37 +0000</pubDate>
		<dc:creator>Jim Cassidy</dc:creator>
				<category><![CDATA[Python/Jython]]></category>
		<category><![CDATA[DB4O]]></category>

		<guid isPermaLink="false">http://www.jimcassidy.ca/?p=345</guid>
		<description><![CDATA[Hi Folks. I have been fighting a cold, and taking care of kids who are fighting colds. Therefore, my work with Jython and DB4O has been held up. However, I notice a fair degree of traffic &#8211; people are waiting for the work to continue. Please accept this link as my next installment. Dhananjay Nene [...]]]></description>
			<content:encoded><![CDATA[<p>Hi Folks. I have been fighting a cold, and taking care of kids who are fighting colds. Therefore, my work with Jython and DB4O has been held up. However, I notice a fair degree of traffic &#8211; people are waiting for the work to continue.</p>
<p>Please accept this link as my next installment. <a title="Java vs python" href="http://blog.dhananjaynene.com/2008/09/commentary-on-python-from-a-java-programming-perspective/" target="_blank">Dhananjay Nene</a> reflects on the differences between Java and Python, and how he feels more productive using Python. He also reflects on how duck <a title="duck typing" href="http://blog.dhananjaynene.com/2008/09/python-from-java-how-duck-typing-influences-class-design-and-design-principles/" target="_blank">typing affects design</a>. </p>
<p>Dhananjay says nothing I would not have said, and his statements have more authority than mine: he has definitely spent more time writing Java than I have. In my day job, I write C#. My current project requires me to write VB using version 1.1 of the .NET framework &#8211; yuck! (Oh well, as my wife says, momma needs a new pair of shoes.)</p>
]]></content:encoded>
			<wfw:commentRss>http://jimcassidy.ca/2008/11/12/python-vs-java/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Background: Python Virtual Machines etc.</title>
		<link>http://jimcassidy.ca/2008/11/07/background-python-virtual-machines-etc/</link>
		<comments>http://jimcassidy.ca/2008/11/07/background-python-virtual-machines-etc/#comments</comments>
		<pubDate>Fri, 07 Nov 2008 13:14:02 +0000</pubDate>
		<dc:creator>Jim Cassidy</dc:creator>
				<category><![CDATA[Python/Jython]]></category>
		<category><![CDATA[Ruby/JRuby]]></category>
		<category><![CDATA[Jython]]></category>

		<guid isPermaLink="false">http://www.jimcassidy.ca/?p=337</guid>
		<description><![CDATA[Since my last few entries have covered Jython, I thought it would be useful to provide information about the various flavors of Python that can be found in the wild. There is an excellent article at Polishlinux. Give it a read to get the lay of the land. Also, some of you will be think [...]]]></description>
			<content:encoded><![CDATA[<p>Since my last few entries have covered <a title="Jython" href="http://www.jython.org/Project/" target="_blank">Jython</a>, I thought it would be useful to provide information about the various flavors of Python that can be found in the wild. There is an excellent article at <a title="python" href="http://polishlinux.org/apps/cli/comparison-of-python-virtual-machines/" target="_blank">Polishlinux</a>. Give it a read to get the lay of the land.</p>
<p>Also, some of you will be think about Jython performance. Performance is not everything, but if that is what you care about, then Dhananjay Nene has written this <a title="performance" href="http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/" target="_blank">excellent article</a> to help you understand where Jython stands compared to other languages and implementations, including <a title="Ruby" href="http://www.ruby-lang.org/en/" target="_blank">Ruby</a>. (Be sure to note that Python produces the fewest lines of code.)</p>
]]></content:encoded>
			<wfw:commentRss>http://jimcassidy.ca/2008/11/07/background-python-virtual-machines-etc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

