<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><title>smalltalk @ www.talios.com</title><link>http://www.talios.com/</link><description>(smalltalk) </description><copyright>Copyright 2008 www.talios.com</copyright><generator>Mark Derricutt</generator><lastBuildDate>Wed, 19 Nov 2008 08:35:00 GMT</lastBuildDate><image><title>smalltalk @ www.talios.com</title><url>http://server1.blog-city.com/images/bc_v5_logo_small.gif</url><link>http://www.talios.com/</link></image><ttl>360</ttl><docs>http://backend.userland.com/rss</docs><item><title>How I Got Started in Software Development</title><guid isPermaLink="true">http://www.talios.com/how_i_got_started_in_software_development.htm</guid><link>http://www.talios.com/how_i_got_started_in_software_development.htm</link><pubDate>Sun, 20 Jul 2008 11:11:00 GMT</pubDate><comments>http://www.talios.com/console/comments/popup/?f=how%5Fi%5Fgot%5Fstarted%5Fin%5Fsoftware%5Fdevelopment</comments><dc:creator>Mark Derricutt</dc:creator><description><![CDATA[<p>Earlier in the week <a href="http://www.fastchicken.co.nz/" title="Nic Wise">Nic Wise</a> pinged me on the <a href="http://www.fastchicken.co.nz/index.php/2008/07/11/how-i-got-started-in-software-development/">How I got started in software development</a> meme, I'd been meaning to post my entry sooner but ended up getting sidetracked.</p>

<p>
<strong>How old were you when you started programming?</strong></p>
<p>Way way way back in the day my parents purchased me and my brother a Fountain Video Games unit when I was around 11-12, later we got a Commodore Vic 20 and the discovery of BASIC soon followed, later that year I won a Commodore C=16 at the opening of Smith and Smiths in Napier simply by standing in the right spot and the right time.</P>

<p><strong>How did you get started in programming?</strong></P>
<p>By now I was well and truly the outcast as all my friends now had C64's, still - I continued to mess with BASIC and making my own games and programs and eventually began to hit the limits of the machine, eventually we upgraded to the Plus/4 (the C64 was considered, but given we already had a wealth of games for the C16 the +4 was a better option at the time) and I started dabbling with 6502 assembler after my 3rd form computer studies teacher gave me a photocopied assembly language guide.</P>
<p>A few years later my friends and I all upgraded to Amigas and thats where the fun began - AMOS game creator, Devpac Macro Assembler, the DEMO scene, and the best text editor ever written: Cygnus Ed.</P>

<p>Rolling on a few more years and I "upgraded" to a PC-XT when I went 'tech and started learning about databases and the "real" world of computing.</p>

<p><strong>What was your first language?</strong></p>
<p>As mentioned above, my first language was BASIC on the Commodore Vic 20, followed by 6502 assembler.</p>

<p><strong>What was the first real program you wrote?</strong></p>
<p>What defines a "real" program? If I discount the various programs and databases I wrote as part of school or tech projects, the first "programs" would have been a simple games I wrote on the C16/Plus4 (simple sprite based shoot'em'up games) and the Amiga (scrolling text demos/intro's for our local warez group, and later simple database apps with Superbase).</p>

<p><strong>What was your first professional programming gig?</strong></p>
<p>Discounting the programs I worked on at my first job, the first commercial program "I" wrote would have been the Food Bank database system for the local community food bank; a Delphi 1 application which tracked food parcel requests and the phone number/address of the requestees - the applications main purpose was to match reused phone numbers and/or addresses for potential 'food request fraud'. The project was fun, but as a voluntary community service they could only pay in petrol and food vouchers.</p>

<p><strong>What languages have you used since you started programming?</strong></p>
<p>BASIC, 6502 assembler, 68000 assembler, Superbase, Turbo C, Turbo Pascal, Quick Basic 7 (woo compiled BASIC!), Visual Basic, Delphi, Python, Java, Dolphin Smalltalk, Javascript, HTML, CSS, XML, XSL.</p>


<p><strong>If you knew then what you know now, would you have started programming?</strong></p>
<p>Most definitely, but I would taken more of an interest in non-code areas of development such as project management, requirements gathering and people mongering.</p>

<p><strong>If there is one thing you learned along the way that you would tell new developers, what would it be?</strong></p>
<p>Experiment, and don't be afraid to break shit along the way - learning to fix things is often the best way to learn.</p>

<p><strong>What&#8217;s the most fun you&#8217;ve ever had&#8230; programming?</strong></p>
<p>There's three distinct "fun" moments stuck in my memory, the first was spending time with dad and my brother typing in line after line of HEX code from magazines to get new games on the machine. I remember dad spending night after night typing in a new game for me for my birthday, only to find that the game didn't work and that the next months magazine had a "FIX" for the typo's in the previous issue (my first patch - I remember it well).</p>

<p>The next chapter in "fun" was back in the days of the Amiga scene, all night coding sessions messing with graphics and sound - Paula, Agnus, Denise, and The Copper - the fact that Agnus was replaced by the Fat Agnus was prophetic of a lot of <a href="http://www.talios.com/the_downside_of_a_career_in_computing.htm">'people' in computing</a>'.</p>
<p>Most recently that fun returned with the discovery <a href="http://www.talios.com/index.cfm?search=smalltalk">Smalltalk</a> - not so much the language itself, but the environment as a whole - the ability to change code on the fly and re-run live code opened my eyes to an entirely new way of coding. Sadly, it's now spoilt me in my day job :(</p>

<p><strong>Now, let&#8217;s tag someone else:</strong></p>

<p>So lets tag some folk: <a href="http://phirate.com/">Richard Clark</a>, <a href="http://www.cincomsmalltalk.com/userblogs/mls/blogView">Michael Lucas-Smith</a>, <a href="http://beust.com/weblog/">Cedric Beust</a></p>

<div class="posttagsblock"><a href="http://technorati.com/tag/development" rel="tag">development</a>, <a href="http://technorati.com/tag/smalltalk" rel="tag">smalltalk</a></div><p><a href='http://www.talios.com/console/comments/popup/?f=how%5Fi%5Fgot%5Fstarted%5Fin%5Fsoftware%5Fdevelopment'>Leave Comment</a></p>]]></description></item><item><title>If Smalltalk is dead - why is it my most read post?</title><guid isPermaLink="true">http://www.talios.com/if_smalltalk_is_dead__why_is_it_my_most_read_post.htm</guid><link>http://www.talios.com/if_smalltalk_is_dead__why_is_it_my_most_read_post.htm</link><pubDate>Mon, 30 Jun 2008 12:38:00 GMT</pubDate><comments>http://www.talios.com/console/comments/popup/?f=if%5Fsmalltalk%5Fis%5Fdead%5F%5Fwhy%5Fis%5Fit%5Fmy%5Fmost%5Fread%5Fpost</comments><dc:creator>Mark Derricutt</dc:creator><description><![CDATA[<p>Somehow I topped 2gb of traffic on the blog this month so I went in search of my stats, unfortunately I found nothing which highlighted any untoward usage, but I did find that my most read blog post is for that <a href="http://www.talios.com/small_sockets__posting_to_usenet_in_dolphin_smalltalk.htm">dead language Smalltalk</a>:</p>
<p style="text-align: center;"><a href="http://www.flickr.com/photos/talios/2624724320/" title="Small talk - big stats by talios, on Flickr"><img src="http://farm4.static.flickr.com/3273/2624724320_80dffe96ff_o.png" width="399" height="411" alt="Small talk - big stats" /></a></p>
<p>If Smalltalk is dead, why is it so popular?</p>

<div class="posttagsblock"><a href="http://technorati.com/tag/development" rel="tag">development</a>, <a href="http://technorati.com/tag/smalltalk" rel="tag">smalltalk</a></div><p><a href='http://www.talios.com/console/comments/popup/?f=if%5Fsmalltalk%5Fis%5Fdead%5F%5Fwhy%5Fis%5Fit%5Fmy%5Fmost%5Fread%5Fpost'>Leave Comment</a></p><p>Related Entries:</p><ul><li><a href='http://www.talios.com/a_little_head_trauma_returning_none_is_evil.htm'>A Little Head Trauma...: Returning None is Evil</a></li><li><a href='http://www.talios.com/xml_withstyle_is_no_more.htm'>XML WithStyle is no more...</a></li><li><a href='http://www.talios.com/java_can_be_agile_but.htm'>Java can be agile, but...</a></li><li><a href='http://www.talios.com/the_power_of_smalltalk_ides.htm'>The Power of Smalltalk IDE's</a></li><li><a href='http://www.talios.com/dolphin_smalltalk_6_now_available.htm'>Dolphin Smalltalk 6 now available!</a></li><li><a href='http://www.talios.com/dynamicjava.htm'>Sick of the caught/uncaught exception arguments?  Try caught/uncauch casting with RuntimeObject's for a change...</a></li><li><a href='http://www.talios.com/a_ruby_rule_engine.htm'>A Ruby rule engine</a></li><li><a href='http://www.talios.com/a_squeaky_rule_engine.htm'>A squeaky rule engine</a></li></ul>]]></description><category>smalltalk</category></item><item><title>A Little Head Trauma...: Returning None is Evil</title><guid isPermaLink="true">http://www.talios.com/a_little_head_trauma_returning_none_is_evil.htm</guid><link>http://www.talios.com/a_little_head_trauma_returning_none_is_evil.htm</link><pubDate>Thu, 22 Nov 2007 02:59:00 GMT</pubDate><comments>http://www.talios.com/console/comments/popup/?f=a%5Flittle%5Fhead%5Ftrauma%5Freturning%5Fnone%5Fis%5Fevil</comments><dc:creator>Mark Derricutt</dc:creator><description><![CDATA[<p>Via <a href="http://beust.com/weblog/archives/000470.html">Cedric's blog</a> I came upon Marty Alchin's post on the perils of returning None or Null from your methods:</p>
<blockquote cite="http://gulopine.gamemusic.org/2007/11/returning-none-is-evil.html">
  That is, of course, until you try to use your shiny, newly-retrieved object. Java then falls over itself and dies a horrifically painful death upon realizing that you dared try to do anything with null. This is the NullPointerException, and it's exceptionally (pun intended) difficult to track down. You see, the traceback only tells you where your code tried to reference some property or method of null. What you really want to find out is where did that null come from? [From <a href="http://gulopine.gamemusic.org/2007/11/returning-none-is-evil.html"><cite>A Little Head Trauma...: Returning None is Evil</cite></a>]
</blockquote>
<p>As I was reading through the post, its comments, Cedric's rebuttal and its own series of comments I was reminded of how Smalltalk deals with this - closures.</p>
<pre>
(self doSomethingThatMightReturnNil)
  ifNotNil: [val | val doSomethingWithNoHassle].
</pre>
<p>Here, the message doSomethingThatMightReturnNil will return either a valid object instance, or an singleton instance of the Nil class. Under Smalltalk, every object has the messages ifNil: and ifNotNil: which will execute the provide block/closure if the instance is, or isn't nil (the Nil object simply does the opposite).</p>
<p>One of the best things I love about this approach is that the ifNotNil: message passes the instance into the block as a variable which saves having to a store any temporary variables, or simply repeating the call or a variation of it. Using this method also leaves exceptions to do what exceptions are meant for: exceptional problems.</p><p><a href='http://www.talios.com/console/comments/popup/?f=a%5Flittle%5Fhead%5Ftrauma%5Freturning%5Fnone%5Fis%5Fevil'>Leave Comment</a></p><p>Related Entries:</p><ul><li><a href='http://www.talios.com/database_migrations_with_maven.htm'>Database Migrations with Maven</a></li><li><a href='http://www.talios.com/google_xml_pages.htm'>Google XML Pages</a></li><li><a href='http://www.talios.com/if_smalltalk_is_dead__why_is_it_my_most_read_post.htm'>If Smalltalk is dead - why is it my most read post?</a></li><li><a href='http://www.talios.com/osgi_based_integration_testing_with_testng_and_apache_felix.htm'>OSGi based Integration testing with TestNG and Apache Felix</a></li><li><a href='http://www.talios.com/osgi_is_shiny.htm'>OSGi is Shiny</a></li><li><a href='http://www.talios.com/java_6_now_available_for_apple_macs.htm'>Java 6 now available for Apple Mac's</a></li><li><a href='http://www.talios.com/wanted_more_control_over_jdk_annotation_targets.htm'>WANTED: More control over JDK Annotation Targets</a></li><li><a href='http://www.talios.com/envy_code_r_pr7_vs_pr6__preview_thoughts.htm'>Envy Code R PR7 vs PR6 - Preview thoughts</a></li><li><a href='http://www.talios.com/job_search_20.htm'>Job Search 2.0</a></li><li><a href='http://www.talios.com/java_se_6_developer_preview_9_release_notes.htm'>Java SE 6 Developer Preview 9 Release Notes</a></li></ul>]]></description><category>java</category><category>smalltalk</category><category>closures</category></item><item><title>The Power of Smalltalk IDE&apos;s</title><guid isPermaLink="true">http://www.talios.com/the_power_of_smalltalk_ides.htm</guid><link>http://www.talios.com/the_power_of_smalltalk_ides.htm</link><pubDate>Sun, 11 Dec 2005 05:46:00 GMT</pubDate><comments>http://www.talios.com/console/comments/popup/?f=the%5Fpower%5Fof%5Fsmalltalk%5Fides</comments><dc:creator>Mark Derricutt</dc:creator><description><![CDATA[So it seems that <a href="http://wilkes.blogspot.com/2005/12/power-of-smalltalk-ides.html">every</a> <a href="http://www.cincomsmalltalk.com/blog/blogView?showComments=true&amp;entry=3311489337">man</a> <a href="http://www.cdegroot.com/blog/2005/12/08/cedric-who/">and</a> <a href="http://astares.blogspot.com/2005/12/todays-smalltalk-ides.html">his</a> <a href="http://www.blainebuxton.com/weblog/2005/12/live-vs-dead.html">dog</a> is <a href="http://www.cincomsmalltalk.com/blog/blogView?showComments=true&amp;entry=3311577763">commenting</a> on the power of Smalltalk IDEs in response to Cedric's <a href="http://www.vanwardtechnologies.com/cedricb03.php">interview</a> with Vanguard Technologies.<br /><br />Now I'll admit that Cedric is partially wrong, and that all the Smalltalkers are right, Blaine Buxton writes:<br /> <blockquote>I generally look at Smalltalk's IDE as playing with a live patient. You are in the middle of a living and breathing system that reacts immediately to you. There's no shutdown, compile, restart, and retry. It's all happening right here and now. It's an incredibly cool experience especially when you realize that you can execute any code and inspect the state of the system.</blockquote>Sure, alot of the time Smalltalk gives you this &quot;everything is live&quot; scenario, the problem I have is when Blaine (and others) say &quot;there's no shutdown, compile, restart, and retry&quot; which goes all out the window when you start asking them about deploying an application.<br /><br />I've been using Dolphin Smalltalk from Object Arts off and on for the last year for a small windows project, to get an executable you strip the running image down to the executable you ship to clients.&nbsp; As part of this &quot;stripping&quot; process, all the classes and methods that are unused in your application are (as they process implies) stripped/removed leaving you with a nice small redistributable application.<br /><br />A problem I've often encountered with this is that often methods or classes that I'm using, but don't reference directly in code (class names set in config files etc.) also get stripped causing a problem that only occurs at &quot;run time&quot; - a state of the application where all the wonderfull &quot;everything is live&quot; functionality of the image isn't available.<br /><br />There's no means to update classes on the fly because the compilers been stripped out, I could include it - but then I'd be violating Object Arts licence aggreement.&nbsp; My only hope of debugging any problems is to take a generated .ERRORS file (stack trace, thankfully one that includes all local variables at each point in the stack), load up the image, load the strack trace into <a href="http://www.metagnostic.org/DolphinSmalltalk/Ghoul.html">Ghoul</a> and hope I've not changed the source too much.<br /><br />To say that Smalltalk is the holy grail is somewhat misleading.&nbsp; Sure the IDE's are functionally the same, if not superior IN SOME AREAS - they also leave ALOT to be desired.<br /><br />I upgraded to <a href="http://www.object-arts.com/">Dolphin 6</a> shortly after it was released, but must confess to not having had much time to experiment with it yet, thou I did check out the newly implemented intellisense completion.&nbsp; One of the biggest reasons why people say they like intellisense is that it lets them explore a class's methods without moving their concentation away from the code block there writing, however a minor stumbling block is when it offers me methods that don't exist...<br /><br />In a workspace I entered the following:<br />
<pre>#('1' '2' '3' '4') p</pre>
and was offered a method called print.  But when executing that I get an error saying the method doesn't exist on an Array....<br /><br />
<div align="center"><img alt="" src="http://files.blog-city.com/files/aa/16275/b/dolphin.png" /><br /></div>
<br />DOH!&nbsp; When your autocompletion gives you the wrong information it makes it more than worthless, I hope I don't get people saying 'oh but its because the IDE doesn't know what object you're wanting to complete...' cause that'll be playing right into the arms of pro-static-typing....<br /><br />Smalltalk IDEs may have provided all these wonderfull features for the last 20 years or so, but they also seem to have sat stagnant with the thought that they don't need to improve.<p><a href='http://www.talios.com/console/comments/popup/?f=the%5Fpower%5Fof%5Fsmalltalk%5Fides'>Leave Comment</a></p><p>Related Entries:</p><ul><li><a href='http://www.talios.com/database_migrations_with_maven.htm'>Database Migrations with Maven</a></li><li><a href='http://www.talios.com/does_your_team_have_stds.htm'>Does Your Team Have STDs?</a></li><li><a href='http://www.talios.com/google_xml_pages.htm'>Google XML Pages</a></li><li><a href='http://www.talios.com/if_smalltalk_is_dead__why_is_it_my_most_read_post.htm'>If Smalltalk is dead - why is it my most read post?</a></li><li><a href='http://www.talios.com/osgi_based_integration_testing_with_testng_and_apache_felix.htm'>OSGi based Integration testing with TestNG and Apache Felix</a></li><li><a href='http://www.talios.com/osgi_is_shiny.htm'>OSGi is Shiny</a></li><li><a href='http://www.talios.com/java_6_now_available_for_apple_macs.htm'>Java 6 now available for Apple Mac's</a></li><li><a href='http://www.talios.com/wanted_more_control_over_jdk_annotation_targets.htm'>WANTED: More control over JDK Annotation Targets</a></li><li><a href='http://www.talios.com/envy_code_r_pr7_vs_pr6__preview_thoughts.htm'>Envy Code R PR7 vs PR6 - Preview thoughts</a></li><li><a href='http://www.talios.com/job_search_20.htm'>Job Search 2.0</a></li></ul>]]></description><category>java</category><category>smalltalk</category><category>development</category></item><item><title>Dolphin Smalltalk 6 now available!</title><guid isPermaLink="true">http://www.talios.com/dolphin_smalltalk_6_now_available.htm</guid><link>http://www.talios.com/dolphin_smalltalk_6_now_available.htm</link><pubDate>Wed, 23 Nov 2005 00:41:00 GMT</pubDate><comments>http://www.talios.com/console/comments/popup/?f=dolphin%5Fsmalltalk%5F6%5Fnow%5Favailable</comments><dc:creator>Mark Derricutt</dc:creator><description><![CDATA[Congrats to the boys and girls at <a href="http://www.object-arts.com">Object Arts</a> for the release of Dolphin Smalltalk 6 - and special congratulations for a full swath of <a href="http://www.object-arts.com/docs/index.html">documentation</a>.<br /><br />Now where was that purchase request form?<br /><p><a href='http://www.talios.com/console/comments/popup/?f=dolphin%5Fsmalltalk%5F6%5Fnow%5Favailable'>Leave Comment</a></p><p>Related Entries:</p><ul><li><a href='http://www.talios.com/does_your_team_have_stds.htm'>Does Your Team Have STDs?</a></li><li><a href='http://www.talios.com/if_smalltalk_is_dead__why_is_it_my_most_read_post.htm'>If Smalltalk is dead - why is it my most read post?</a></li><li><a href='http://www.talios.com/a_little_head_trauma_returning_none_is_evil.htm'>A Little Head Trauma...: Returning None is Evil</a></li><li><a href='http://www.talios.com/leopard_and_pair_programming_for_the_win.htm'>Leopard and Pair Programming for the win...</a></li><li><a href='http://www.talios.com/otaku_cedrics_weblog_next_generation_testing_book_now_a.htm'>Otaku, Cedric's weblog: "Next Generation Testing" book now available for preorder</a></li><li><a href='http://www.talios.com/xml_withstyle_is_no_more.htm'>XML WithStyle is no more...</a></li><li><a href='http://www.talios.com/java_can_be_agile_but.htm'>Java can be agile, but...</a></li><li><a href='http://www.talios.com/the_power_of_smalltalk_ides.htm'>The Power of Smalltalk IDE's</a></li><li><a href='http://www.talios.com/dynamicjava.htm'>Sick of the caught/uncaught exception arguments?  Try caught/uncauch casting with RuntimeObject's for a change...</a></li><li><a href='http://www.talios.com/a_ruby_rule_engine.htm'>A Ruby rule engine</a></li></ul>]]></description><category>smalltalk</category><category>development</category></item><item><title>Planet Smalltalk</title><guid isPermaLink="true">http://www.talios.com/planet_smalltalk.htm</guid><link>http://www.talios.com/planet_smalltalk.htm</link><pubDate>Mon, 07 Feb 2005 07:43:00 GMT</pubDate><comments>http://www.talios.com/console/comments/popup/?f=planet%5Fsmalltalk</comments><dc:creator>Mark Derricutt</dc:creator><description><![CDATA[Just came across <a href="http://prog.vub.ac.be/PlanetSmalltalk/">Planet Smalltalk</a> ( <a href="http://prog.vub.ac.be/PlanetSmalltalk/rss20.xml">rss feed</a> ) - a good common phone for all blogs Smalltalk ( which seem to be popping up all over the place now ).<p><a href='http://www.talios.com/console/comments/popup/?f=planet%5Fsmalltalk'>Leave Comment</a></p>]]></description></item><item><title>Smalltalk - Self Modifying code</title><guid isPermaLink="true">http://www.talios.com/smalltalk__self_modifying_code.htm</guid><link>http://www.talios.com/smalltalk__self_modifying_code.htm</link><pubDate>Fri, 03 Dec 2004 03:48:00 GMT</pubDate><comments>http://www.talios.com/console/comments/popup/?f=smalltalk%5F%5Fself%5Fmodifying%5Fcode</comments><dc:creator>Mark Derricutt</dc:creator><description><![CDATA[In this wee Smalltalk application I'm writing I'm pulling out the version number to use as a custom header in SMTP messages, it's a small thing, but the code I was using was:<br /><br /><div style="margin-left: 40px;"><span style="font-family: courier new,courier,monospace;">SessionManager current versionInfo productVersionString</span><br /></div><br />Which is all well and good, assuming I'm setting my version resource properly, at the time, my application was reporting &quot;1.0.0.0&quot; as the version and I got a query from one of the support engineers wondering why we has seeing &quot;2002.5.1.4&quot; being reported in the logs.  This was logical, as when running in development mode, the current SessionManager is Dolphin Smalltalk's, not my own.  So I changed my code to the following:<br /><br /><div style="margin-left: 40px;"><span style="font-family: courier new,courier,monospace;">(SessionManager current isKindOf: TXTMailSessionManager) </span><br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;">  ifTrue: [^SessionManager current versionInfo productVersionString]</span><br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;">  ifFalse: [^(PackageManager current packageNamed: 'SMSComposer') packageVersion]</span><br /></div><br />So here the code first checks if the SessionManager is mine, and if not, returns the version of the package.  All fine and dandy, yet the striped executable now includes PackageManager and any dependant classes, which increases the size of my executable.  Then I started to think &quot;hey, this is Smalltalk, I can get funky&quot;, a quick question to the guys on #smalltalk and I added the following line to my &quot;set version&quot; routine:<br /><br /><div style="margin-left: 40px;"><span style="font-family: courier new,courier,monospace;">SMSComposerSettings </span><br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;">  compile: 'applicationVersionString',<br />  String lineDelimiter,<br />  '^''' , aVersionNumber , ''''</span><br style="font-family: courier new,courier,monospace;" /></div><br />What this is doing is compiling a new function on my settings class, which simply returns a version string, now I just call #productVersionString on my settings class to get my version number, this works at runtime and development time, and doesn't introduce any new dependancies.  The entire code for my version update routine is:<br /><br /><div style="margin-left: 40px;"><span style="font-family: courier new,courier,monospace;">updateVersionNumber: aVersionNumber </span><br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;">    &quot;Update the class with a new version number method&quot;</span><br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;">    SMSComposerSettings </span><br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;">  compile: 'productVersionString',<br />        String lineDelimiter,<br />        '^''' , aVersionNumber , ''''.</span><br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;">  &quot;Update my packages with a new version number&quot;</span><br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;">  #('SMSComposer' 'SMSComposerOutlookAddin' 'addressbooks' 'doap-project') </span><br style="font-family: courier new,courier,monospace;" /><span style="font-family: courier new,courier,monospace;">      do: [:packageToUpdate |<br />          PackageTools updateVersionNumber: aVersionNumber for: packageToUpdate]</span><span style="font-family: courier new,courier,monospace;"><br /></span></div><br />Now, whenever I update the version of my application, I simply call in a workspace:<br /><br /><div style="margin-left: 40px;"><span style="font-family: courier new,courier,monospace;">PackageTools updateVersionNumber: '3.0.4.21'</span><br style="font-family: courier new,courier,monospace;" /></div><br />Some may argue I shouldn't set the same version number for all of the packages in this project, but for now, I can live with that.<br /><span style="font-family: courier new,courier,monospace;">&nbsp;</span>
<p><a href='http://www.talios.com/console/comments/popup/?f=smalltalk%5F%5Fself%5Fmodifying%5Fcode'>Leave Comment</a></p>]]></description></item><item><title>Dear Java, I need closure....</title><guid isPermaLink="true">http://www.talios.com/dear_java_i_need_closure.htm</guid><link>http://www.talios.com/dear_java_i_need_closure.htm</link><pubDate>Thu, 25 Nov 2004 11:59:00 GMT</pubDate><comments>http://www.talios.com/console/comments/popup/?f=dear%5Fjava%5Fi%5Fneed%5Fclosure</comments><dc:creator>Mark Derricutt</dc:creator><description><![CDATA[I'm sitting here having on of those &quot;enlightened&quot; moments when you suddenly grok the power of something, in this case its closures/blocks.  I've been loving the power and flexability Smalltalk's blocks provide for sometime now, and whilst Java's anonymous inner classes provide some similar functionality, there hardly as clean.<br /><br />I had some code which, when let loose to a customer suddenly started to crawl ( reading through large distributed global address lists from Outlook, via its (slow) object model ), the task was to add a progress display around the process - initially my mind went &quot;eeep&quot; and cowering in fear at having to grok Dolphin's threading models and how they intermix with Windows threads, but then I had a memory &quot;wait, I've seen funky progress bars here before, maybe someones already done the dirty for me&quot; - so I open the class browser and search for &quot;ProgressB&quot; and up pops the ProgressDialog class, a quick scan through the methods and I spot example1, example2, and example3 on the class side... *blink* - this looks easy....<br /><br />So I set about adding it to my code, and dayam - this is freaken easy!<br /><br /><div style="margin-left: 40px;"><span style="font-family: courier new,courier,monospace;">    (ProgressDialog operation: [ :progressHandler |</span><br /><span style="font-family: courier new,courier,monospace;">        &quot;My original long lasting looping code goes here.&quot;</span><br /><span style="font-family: courier new,courier,monospace;">        ......</span><br /><span style="font-family: courier new,courier,monospace;">        progressHandler value: somePercentageValue.</span><br /><span style="font-family: courier new,courier,monospace;">        ......</span><br /><span style="font-family: courier new,courier,monospace;">    ]) caption: 'Please wait whilst I do something really slow...'; show.</span><br /><span style="font-family: courier new,courier,monospace;"></span></div><span style="font-family: courier new,courier,monospace;"><br style="font-family: arial,helvetica,sans-serif;" /><span style="font-family: arial,helvetica,sans-serif;">The operation message takes a block, and also passes it a block.  The block thats passed to your block simply updates the display, no worrying about threads anywhere ( I'm guessing that's handled behind the scenes somewhere ).  The power here is that I'm not having to worry about nasty declared interfaces, methods, and final variables that Java would have to write, i.e.</span><br style="font-family: arial,helvetica,sans-serif;" /><br style="font-family: arial,helvetica,sans-serif;" /></span><div style="margin-left: 40px;"><span style="font-family: courier new,courier,monospace;"><span style="font-family: courier new,courier,monospace;">    ProgressDialog.operation( new Runnable() { public void run() {..... }});</span></span><br style="font-family: arial,helvetica,sans-serif;" /><span style="font-family: courier new,courier,monospace;"></span></div><span style="font-family: courier new,courier,monospace;"><br style="font-family: arial,helvetica,sans-serif;" /><span style="font-family: arial,helvetica,sans-serif;">Instead, I get code that looks, no - IS identical to my original code, only its indented, with 2 lines of extra code around it - I like that.</span><br style="font-family: arial,helvetica,sans-serif;" /><br style="font-family: arial,helvetica,sans-serif;" /><span style="font-family: arial,helvetica,sans-serif;">Ironically, it's also taken me 3-4 times longer to write this blog post than it was to find the class, read how ProgressDialog worked, implement it, and run my code...</span><br /></span>
<p><a href='http://www.talios.com/console/comments/popup/?f=dear%5Fjava%5Fi%5Fneed%5Fclosure'>Leave Comment</a></p>]]></description></item><item><title>Re: Unit tests, Refactoring not Edit and Continue</title><guid isPermaLink="true">http://www.talios.com/re_unit_tests_refactoring_not_edit_and_continue.htm</guid><link>http://www.talios.com/re_unit_tests_refactoring_not_edit_and_continue.htm</link><pubDate>Wed, 20 Oct 2004 03:36:00 GMT</pubDate><comments>http://www.talios.com/console/comments/popup/?f=re%5Funit%5Ftests%5Frefactoring%5Fnot%5Fedit%5Fand%5Fcontinue</comments><dc:creator>Mark Derricutt</dc:creator><description><![CDATA[As with everyone in the blogging world I noticed all the announcements over the new "Edit & Continue" functionality in C#, <a href="http://samgentile.com/blog/archive/2004/10/19/12240.aspx">Sam Gentile's</a> says:

<blockquote>As a C# MVP, I am obligated to tell you that Edit & Continue is in C# now in this build regardless of my feelings...</blockquote>

When I started reading about the new functionality, I was wondering ( and about to blog ) my concerns that C# E&C would suffer the same limitations that make <a href="http://java.sun.com">Java</a> "Hot Swap" functionality such a pain^h^h^h^hjoy to use, when I spotted <a href="http://www.cincomsmalltalk.com/userblogs/malby/blogView?showComments=true&entry=3275582904">Sean Malloy's</a> comments:

<blockquote>Check out the features that didn't make it:

<ul><li>Changing the name of a class
<li>Adding or removing method parameters
<li>Adding public fields to a class
<li>Adding or removing methods</ul></blockquote>

<p/>This pretty much matches the problems that plague <a href="http://forum.java.sun.com/thread.jsp?thread=531194&forum=37&message=2585336">Java's</a> Hot Swap functionality, you can't introduce updated classes that break the contract of the existing class imposed by the static nature of the language.  On some level I can understand this, you don't want to introduce something that would start breaking other classes, Smalltalk systems would just start throwing out #doesNotUnderstand in this instance, and the hacker can just "implement and continue", not just edit and continue.  Java already throws these sorts of errors when you've compiled against one version of a class, but run against another (with missing methods), I don't see what the problem of doing this during E&C is either.

<p/>On the other hand, the E&C feature could be implemented to impose contract checks, if you add a method, or change parameters as part of a refactoring, as part of injecting the new class into the running VM, also inject new copies of the dependent classes - this way the IDE "knows" all classes are valid before injecting them; although that being said - it should be the VM that handles the injecting, not the IDE.  This is one area that Java has up on C# I believe, any application that supports the JPDA debugging extensions can replace classes ( within these horrible limitations thou ).

<p/>E&C sure makes life easier, but it also comes with its own pain and frustrations.
<p><a href='http://www.talios.com/console/comments/popup/?f=re%5Funit%5Ftests%5Frefactoring%5Fnot%5Fedit%5Fand%5Fcontinue'>Leave Comment</a></p>]]></description></item><item><title>BottomFeeder withStyle</title><guid isPermaLink="true">http://www.talios.com/bottomfeeder_withstyle.htm</guid><link>http://www.talios.com/bottomfeeder_withstyle.htm</link><pubDate>Mon, 27 Sep 2004 02:25:00 GMT</pubDate><comments>http://www.talios.com/console/comments/popup/?f=bottomfeeder%5Fwithstyle</comments><dc:creator>Mark Derricutt</dc:creator><description><![CDATA[<a href="http://www.cincomsmalltalk.com/blog/blogView">James Robertson</a> recently updated the development versions of <a href="http://www.cincomsmalltalk.com/BottomFeeder">BottomFeeder</a> with <a href="http://www.softwarewithstyle.com/">WithStyle</a> as the browsing component - mixing this with a customized stylesheet and you've got a whole new blogging experience...

<p/><center><img src="http://files.blog-city.com/files/aa/16275/b/bottomFeederWithStyle.png"></center>

<p/>My hat goes off to James and Michael for all the work they've put into these tools...<p><a href='http://www.talios.com/console/comments/popup/?f=bottomfeeder%5Fwithstyle'>Leave Comment</a></p>]]></description></item><item><title>Dolphin XMPP Message Sending</title><guid isPermaLink="true">http://www.talios.com/dolphin_xmpp_message_sending.htm</guid><link>http://www.talios.com/dolphin_xmpp_message_sending.htm</link><pubDate>Sun, 26 Sep 2004 12:00:00 GMT</pubDate><comments>http://www.talios.com/console/comments/popup/?f=dolphin%5Fxmpp%5Fmessage%5Fsending</comments><dc:creator>Mark Derricutt</dc:creator><description><![CDATA[I'm starting to get something of a more working/functional set of classes to drive XMPP/Jabber from Dolphin Smalltalk.  Now at the point that I need to think about HOW I want to use XMPP from Dolphin; how the API should look and be used.

<p/>From a fresh workspace, the following code sends my main client instance a chat message after successfully binding and authenticating to the jabber server.

<p/><blockquote><pre>| xmpp |
xmpp := XMPPConnection new.
xmpp jid: 'talios@myjabber.net'.
xmpp password: '********'.
xmpp resource: 'Dolphin'.
xmpp bind ifTrue: 
  [xmpp login ifTrue:
    [ xmpp sendChatMessage: 'hello mark from dolphin smalltalk'
      to: 'talios@myjabber.net/Pandion'.]]</pre></blockquote>

<p/><center><img src="http://files.blog-city.com/files/aa/16275/b/dolphin-xmpp-chatmsg.png"></center>

<p/>The current library is quite flat with <i>everything</i> sitting on the XMPPConnection class, however I'm thinking of breaking things apart to allow something like the following:

<p/><blockquote><pre>chat := xmpp openChatTo: 'talios@myjabber.net/Pandion'.
chat onIncomingMessageDo: [ :message |
  message inspect.].
chat newMessage: 'Hello XMPP';
  send.</pre></blockquote>

This would open a new chat to the specified jid, setup a callback handler/block to respond to chat message replies from this jid with simply "inspects" the incoming message, then make an initial message to the user and send it.

<p/><a href="http://www.cincomsmalltalk.com/userblogs/mls/blogView">Michael Lucas-Smith</a> of <a href="http://www.softwarewithstyle.com">Software With Style</a> has expressed an interest in seeing my XMPP packages appearing for <a href="http://smalltalk.cincom.com/index.ssp">Cincom Visual Works Smalltalk</a>, which I'll definitely be looking into once I've got my head around this current <a href="http://www.object-arts.com">Dolphin</a> implemtation.<p><a href='http://www.talios.com/console/comments/popup/?f=dolphin%5Fxmpp%5Fmessage%5Fsending'>Leave Comment</a></p>]]></description></item><item><title>GNU Smalltalk gets a GTK Browser...</title><guid isPermaLink="true">http://www.talios.com/gnu_smalltalk_gets_a_gtk_browser.htm</guid><link>http://www.talios.com/gnu_smalltalk_gets_a_gtk_browser.htm</link><pubDate>Tue, 14 Sep 2004 04:13:00 GMT</pubDate><comments>http://www.talios.com/console/comments/popup/?f=gnu%5Fsmalltalk%5Fgets%5Fa%5Fgtk%5Fbrowser</comments><dc:creator>Mark Derricutt</dc:creator><description><![CDATA[Via <a href="http://www.cincomsmalltalk.com/userblogs/badger/blogView">Bruce Badger</a> in #smalltalk, I find a screenshot <a href="http://www.robertcollins.net/">Robert Collins</a> work on a GTK/Blox based browser for <a href="http://www.gnu.org/software/smalltalk/smalltalk.html">GNU Smalltalk</a>.<p/>

<center><a href="http://www.robertcollins.net/nb2.png"><img src="http://www.robertcollins.net/nb2.png" width="50%" height="50%" border="0"></a></center><p/>

Damm thats looking nice, I'll definitely keep an eye on this project...
<p><a href='http://www.talios.com/console/comments/popup/?f=gnu%5Fsmalltalk%5Fgets%5Fa%5Fgtk%5Fbrowser'>Leave Comment</a></p>]]></description></item><item><title>Small sockets - posting to usenet in Dolphin Smalltalk</title><guid isPermaLink="true">http://www.talios.com/small_sockets__posting_to_usenet_in_dolphin_smalltalk.htm</guid><link>http://www.talios.com/small_sockets__posting_to_usenet_in_dolphin_smalltalk.htm</link><pubDate>Mon, 06 Sep 2004 10:34:00 GMT</pubDate><comments>http://www.talios.com/console/comments/popup/?f=small%5Fsockets%5F%5Fposting%5Fto%5Fusenet%5Fin%5Fdolphin%5Fsmalltalk</comments><dc:creator>Mark Derricutt</dc:creator><description><![CDATA[The other day someone in <a href="http://groups.google.com/groups?q=Newsgroup+Posts+via+Dolphin&hl=en&lr=&ie=UTF-8&selm=41326949%40news.totallyobjects.com&rnum=1">comp.lang.smalltalk.dolphin</a> posted asking about sockets and "direct access to the internet" in Dolphin Smalltalk.

Frankly, I still have no idea exactly what he was asking, but the subject at least made sense: "Newsgroup posts via Dolphin".

Now, I'm somewhat new to Smalltalk, and Dolphin in particular, but I once said to James Robertson ages ago that I wanted a small project in Smalltalk to "give me something to learn by" and do, and so I decided I'd write a simple NNTP poster...

As always we start with an empty class and an SUnit testcase and add some tests:

<blockquote><pre>
testConnect
  | nntp |
  nntp := NNTPClient new.
  self assert: (nntp connect: 'library.airnews.net' port: 119)
</pre></blockquote>

<blockquote><pre>
testPost
  | nntp |
  nntp := NNTPClient new.
  nntp authenticate: 'talios' with: '****'.
  (nntp connect: 'library.airnews.net' port: 119) 
    ifTrue: 
      [self 
        assert: (nntp
          postTo: 'alt.test'
          from: 'talios@gmail.com'
          subject: 'Test'
          body: 'Test Post')]
</pre></blockquote>

So I save these methods, and instantly they fail.  For one, theres no #authenticate, #connect, or #postTo messages.  So lets start coding...

A quick Google of the relevant RFCs and I have some info on what I have to do to connect, so I write #connect:

<blockquote><pre>
connect: aHostName port: aPortNumber 
  "Connect to a server"

  host := aHostName.
  port := aPortNumber.
  socket := Socket port: port address: (InternetAddress host: host).
  socket connect.
  ^'200*' match: socket readStream readPage collection asString
</pre></blockquote>

Thats pretty straight forward, set some instance variables, open a socket, and check to see we get the expected 200 result code.  The original version of the code didn't check for any authentication of the user credentials, but as I use <a href="http://www.airnews.net/">Airnews</a> as my usenet source ( which requires authentication ) the tests pretty quickly failed on me, so along comes some authentication handling code...

<blockquote><pre>
authenticate: aUser with: aPassword 
  "Set Authenticatation credentials..."

  user := aUser.
  password := aPassword
</pre></blockquote>

The authenticate method doesn't actually <i>do</i> anything other than store some more instance variables for later use...

Now we come to the guts of the code...

<blockquote><pre>
postTo: aGroupName from: aSender subject: aSubject body: aBody 
  "Send the message..."

  | input |
  (socket writeStream)
    nextPutAll: 'POST' , String lineDelimiter;
      flush.
    input := socket readStream readPage collection asString.
  ('480*' match: input) ifTrue: [self sendAuthenticationCredentials].
  (socket writeStream)
    nextPutAll: 'Newsgroups: ' , aGroupName , String lineDelimiter;
    nextPutAll: 'From: ' , aSender , String lineDelimiter;
    nextPutAll: 'Subject: ' , aSubject , String lineDelimiter;
    nextPutAll: String lineDelimiter;
    nextPutAll: aBody , String lineDelimiter;
    nextPutAll: '.' , String lineDelimiter;
    flush.
  ^'240*' match: socket readStream readPage collection asString.
  Transcript show: 'NNTP post to ' , aGroupName , ' by ' , aSender , ' sent successfully.'
</pre></blockquote>

Here we write POST to the socket and check for a 480 ( authentication required ) result - if it exists #sendAuthenticationCredentials to the server and carry on.  I really should be checking for the 340 result code if we didn't receive the 480, but for now, I don't really care...

Continuing on we send the usenet posting out to the socket, terminate it with a . on a newline, and check for the 240 success result code.

But whats happening in #sendAuthenticationCredentials?

<blockquote><pre>
sendAuthenticationCredentials
  "Send the authentication credentials."

  | input |
  (socket writeStream)
    nextPutAll: 'AUTHINFO user ' , user , String lineDelimiter;
    flush.
  ('381*' match: socket readStream readPage collection asString) 
    ifTrue: 
      [(socket writeStream)
        nextPutAll: 'AUTHINFO pass ' , password , String lineDelimiter;
        flush.
      input := socket readStream readPage collection asString.
      ('281*' match: input) ifFalse: [^false]]
    ifFalse: [^false]
</pre></blockquote>

As I said above, I've very new to Smalltalk, and Dolphin, so I've probably done things here that could easily be tidied up or improved on, but the code does work, and passes the tests...  IMHO, thats the main thing...

If any seasoned Smalltalkers out there want to improve and optimize on this, tell me how I can improve on it....  ( of course, trapping the full RFC is a given there.... <g> ).

I'm starting to really like working in Dolphin Smalltalk, and hope to blog more of my adventures and experiments in this new world...<p><a href='http://www.talios.com/console/comments/popup/?f=small%5Fsockets%5F%5Fposting%5Fto%5Fusenet%5Fin%5Fdolphin%5Fsmalltalk'>Leave Comment</a></p>]]></description></item><item><title>Dolphin XMPP</title><guid isPermaLink="true">http://www.talios.com/dolphin_xmpp.htm</guid><link>http://www.talios.com/dolphin_xmpp.htm</link><pubDate>Wed, 18 Aug 2004 11:10:00 GMT</pubDate><comments>http://www.talios.com/console/comments/popup/?f=dolphin%5Fxmpp</comments><dc:creator>Mark Derricutt</dc:creator><description><![CDATA[So whats a self respecting jabber geek to do with a new development environment and language, and a desire to import his roster into a simple messaging application he's working on?  Write a library of course!<p/>

It was only a few years ago when every one's "first program" seemed to be an IRC client, and now it seems to be a <a href="http://www.jabberstudio.org">Jabber/XMPP client</a> ( or framework/library for the extra keen among you ); maybe that's why theres <a href="http://www.saint-andre.com/blog/2004-08.html#2004-08-10T17:01">so many low quality client applications out there</a>.<p/>

Anyway, so here I am with a language that I'm somewhat unfamiliar with; but also an entire way of thinking thats different; with a requirement/desire that on the surface doesn't seem that hard - so where does one start?<p/>

Maybe I'm growing as a developer, or maybe it's just cause I'm hanging out in a Smalltalk environment where it all began, but I started writing this thing test first, starting with a basic shell of a test case:

<blockquote><pre>TestCase subclass: #JabberXMPPTests
    instanceVariableNames: ''
    classVariableNames: ''
    poolDictionaries: ''
    classInstanceVariableNames: ''</blockquote><//pre>

My first test did absolutely nothing, all it does is create an instance of the class, nothing more, nothing less:

<blockquote><pre>testCreate
    "Test if we can even create an instance of the XMPP object."
    | xmpp |
    xmpp := XMPPConnection new.</blockquote></pre>

It may seem worthless, and it probably is, but even so - the test failed :(  Ok, so I create the container XMPPConnection class and the test passes, most excellent!  Lets set some connection properties as I would if I wanted to use it.

<blockquote><pre>testSetConnectionDetails
    "Test setting connection details, its a minor thing,
    but its a first step to a working system."

    | xmpp |
    xmpp := XMPPConnection new.
    xmpp jid: 'talios@myjabber.net'.
    xmpp password: 'XXXXXXX'.
    xmpp resource: 'Dolphin'</blockquote></pre>

It's here on this second test that I first started to notice something subtle about how I was starting to work.  Unlike other environments where you're entire source file is laid out infront of you, in Smalltalk systems you generally browse one method at a time - keeping your focus on the smallest thing possibler.  By simply changing the method name, adding a few lines for params and hitting CTRL-S I'd actually created a new method instead of renaming the old one as one may normally expect.  By changing the method name again and adding one further line to the code, I had yet another test case, which simply added further functionality to the code I would eventually write.<p/>

Following in this manner I soon had quite a collection of test methods, each testing a further level of the unwritten API, which I'm now in catch up mode for; each test method seems to be a versioning of my thoughts, it's nice to see red bars suddenly go green as those small steps get implented.  Sure, theres only 5 tests at the moment, but I think thats 5 more tests than I have in my day-job code (*hides from $employer).<p/>

I'm now about 2-3 hours into coding: figuring out how to drive Dolphin's Socket classes and refreshing my memory of some the XMPP specs and I have a simple client that connects to a server, initiates a stream, auths, but then fails.  Darn it.  Even thou I'm currently hardcoding certainly things at the moment I still can't log in due to some bogus data hitting the wire which I can't currently see.  80% of ethereal downloaded then I can sniff the traffic and see what I'm missing and then I'll be down to 1 failing test ( testReceiveRoster ).<p/>

I'm not sure if this Dolphin stuff will lead anywhere, whilst I'm enjoying the tool, and the refreshing change of server side Java, if I can't get my $EMPLOYER prototype application working suitably soon, we'll likely be contracting the job out do someone else who can stand C++ or Delphi ( coming from a guy who did Delphi for 9 years or so,  I'm not so sure I really want to go back.)  If things don't work out, my 30 day trial of Dolphin Smalltalk will expire and I'll be sitting here looking like someone who gave up book reading time for some wasted hacking...<p/>

Ah well, it was enlightening anyway.<p/>

So ethereal just finnished sniffing, it told me what my unit tests told me - I screwed up my auth code; but that can wait for another day.  It's time for this hacker to head to bed.
<p><a href='http://www.talios.com/console/comments/popup/?f=dolphin%5Fxmpp'>Leave Comment</a></p>]]></description></item><item><title>An Introduction to Smalltalk Syntax</title><guid isPermaLink="true">http://www.talios.com/an_introduction_to_smalltalk_syntax.htm</guid><link>http://www.talios.com/an_introduction_to_smalltalk_syntax.htm</link><pubDate>Sun, 01 Aug 2004 22:44:00 GMT</pubDate><comments>http://www.talios.com/console/comments/popup/?f=an%5Fintroduction%5Fto%5Fsmalltalk%5Fsyntax</comments><dc:creator>Mark Derricutt</dc:creator><description><![CDATA[<a href=" http://www.cincomsmalltalk.com/userblogs/mls/blogView?showComments=true&entry=3268677050">Spotted in Cincom Smalltalk Blogs </a>

<blockquote>
<p>I thought people might find it useful to have a random introduction to Smalltalk syntax. It's not as hard as it seems, but it does take a while to get your head around it. So, lets start with the basics.</p>
</blockquote>

Michael blogs a simple introduction to the Smalltalk syntax, which comes in handy as I'm planning on handing out copies of the latest release of Cincom Smalltalk at tonights <a href="http://www.linux.net.nz">NZLUG</a> meeting.<p><a href='http://www.talios.com/console/comments/popup/?f=an%5Fintroduction%5Fto%5Fsmalltalk%5Fsyntax'>Leave Comment</a></p>]]></description></item><item><title>Smalltalk: Agile yet Brittle</title><guid isPermaLink="true">http://www.talios.com/smalltalk_agile_yet_brittle.htm</guid><link>http://www.talios.com/smalltalk_agile_yet_brittle.htm</link><pubDate>Wed, 28 Jul 2004 11:59:00 GMT</pubDate><comments>http://www.talios.com/console/comments/popup/?f=smalltalk%5Fagile%5Fyet%5Fbrittle</comments><dc:creator>Mark Derricutt</dc:creator><description><![CDATA[So I was standing there in the shower and the thought struck me to give this Smalltalk thing another go, it was more the "damnit - I want to at least do SOMETHING in it before I write it off" so I sit down at the PC and load up Visual Works, check that I have the required WSDL parcels loaded up, find the email I had stored away for just such an event, opened up a workspace and through down the following:

<blockquote><pre>| builder |

builder := WsdlClassBuilder readFrom: 'http://service.bulletinconnect.net/services/BulletinServer?wsdl' asURI readStream.
builder package: 'BulletinWireless'.
builder createClientClasses.
</pre></blockquote>

Then I search for MyPacakge, only it's not found - hrmmph.  Now, if theres one neat thing I've learnt about VisualWorks is that everything's browsable, so back in the workspace I change my last line to:

<blockquote><pre>builder createClientClasses browse.</pre></blockquote>

Ok so this gives me an OrderedCollection, not quite what I want...

<blockquote><pre>builder createClientClasses first browse.</pre></blockquote>

Aha - here we are, I now have a browser pointing at my generated class, only its in the "Web Services" category ( package? category? ) instead of "BulletinWireless" as I expected, changing once again to:

<blockquote><pre>builder category: 'BulletinWireless'.</pre></blockquote>

did the trick.  So, looking in this category I see several classes generated ready for consumption with the following code in another workspace:

<blockquote><pre>| message client |

message := BulletinMessage new.
message to: '{phonenumber}'.
message body: 'Hello From SmallTalk'.
message messageId: '01'.

client := BulletinServerSoapClient new.
client send: 'myApp' environment: 1 message: message.</pre></blockquote>

Running the code however failed with #messageNotUnderstood on to: body: or messageId: - investigation finds me some interesting bugs in VisualWorks current ( 7.2 ) WSDL implementations.

My WSDL in question makes heavy use of complex types which I've seen cause problems for other non-Java languages in the past ( namely Perl ), in this instance, I have a class called BulletinMessage which extends Message, which happens to be defined in the WSDL, only VisualWorks hasn't generated this class for me, and instead made the class a subclass of #{Core.Message}.

Michael Lucas Smith tells me the WSDL code is in the public store so I'm now off to connect and update my local packages...

<blockquote><pre>&lt;michaell&gt; yep, it still has your bug
&lt;michaell&gt; good find</pre></blockquote>

or maybe not...  now to find a bug-submission form...

<p>
<b>Update: </b> The default behavior of VisualWorks WSDL class builder code is to NOT replace existing classes if they already exist, as my code wasn't setting any specific namespace, the default namespace was being used which already contains a Message class.  Under the VisualWorks settings is an option to generate unique classnames which gets around the problem ( setting namespace would be a better approach thou, and I've since discovered the class builder constructor can take an inNamespace message as well.

The last step to getting my SOAP service working is authenticating to the server, thanks to the guys in #smalltalk I got a quick response, and all I need to do is:

<blockquote><pre>client := BulletinServerSoapClient new.
client transportClient username: 'user' password: 'password'.
client send: 'myApp' environment: 1 message: message.</pre></blockquote>

<p><a href='http://www.talios.com/console/comments/popup/?f=smalltalk%5Fagile%5Fyet%5Fbrittle'>Leave Comment</a></p>]]></description></item></channel></rss>