<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-5841903314797592940</atom:id><lastBuildDate>Fri, 10 Jul 2026 23:13:16 +0000</lastBuildDate><category>.NET</category><category>Agile</category><category>IntelliJ</category><category>Java</category><category>JavaFX</category><category>Lean</category><category>SFTP</category><category>SSH</category><category>continous integration</category><category>junit</category><category>testing</category><title>On Software Development</title><description></description><link>http://sthen.blogspot.com/</link><managingEditor>noreply@blogger.com (Niels Sthen Hansen)</managingEditor><generator>Blogger</generator><openSearch:totalResults>9</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5841903314797592940.post-8403105505496300735</guid><pubDate>Fri, 13 Feb 2015 08:31:00 +0000</pubDate><atom:updated>2015-02-13T08:31:55.489+00:00</atom:updated><title>Calabash Android Command Line Options and Environment Variables</title><description>&lt;p&gt;&lt;a href=&quot;http://calaba.sh/&quot;&gt;Calabash&lt;/a&gt; is a really cool tool but I find the documentation for android is a bit scattered. Some general stuff is readily available &lt;a href=&quot;https://github.com/calabash/calabash-android/&quot;&gt;online&lt;/a&gt; but no links to docs about environment variables or command line options. In the following I have tried to put together a bit more info about command line options and environment variables based on version 0.5.4 of the source code.&lt;/p&gt;

&lt;h2&gt;Commands&lt;/h2&gt;

&lt;pre&gt;Usage: calabash-android &amp;lt;command-name&gt; [parameters] [options]&lt;/pre&gt;

&lt;b&gt;help&lt;/b&gt;&lt;br/&gt;
&lt;p&gt;prints very brief help information.&lt;/p&gt;

&lt;b&gt;build&lt;/b&gt;&lt;br/&gt;
&lt;p&gt;builds the test server that will be used when testing the app.&lt;/p&gt;

&lt;pre&gt;build &amp;lt;apk&gt;&lt;/pre&gt;

&lt;b&gt;run&lt;/b&gt;&lt;br/&gt;
&lt;pre&gt;run &amp;lt;apk&gt;&lt;/pre&gt;

&lt;p&gt;Uses &lt;i&gt;cucumber options&lt;/i&gt;, see below.&lt;/p&gt;

&lt;b&gt;gen&lt;/b&gt;&lt;br/&gt;
&lt;p&gt;Generate a features folder structure.&lt;/p&gt;

&lt;b&gt;console&lt;/b&gt;
&lt;p&gt;open calabash console&lt;/p&gt;

&lt;pre&gt;console &amp;lt;apk&gt;&lt;/pre&gt;

&lt;b&gt;setup&lt;/b&gt;&lt;br/&gt;
&lt;p&gt;Sets up a non-default keystore .calabash_settings to use with this test project.&lt;/p&gt;

&lt;b&gt;resign&lt;/b&gt;&lt;br/&gt;
&lt;p&gt;Re-signs the app with the currently configured keystore.&lt;/p&gt;

&lt;b&gt;version&lt;/b&gt;&lt;br/&gt;
&lt;p&gt;Prints the gem version&lt;/p&gt;

&lt;h2&gt;General options&lt;/h2&gt;

&lt;ul&gt;&lt;pre&gt;-v, --verbose&lt;/pre&gt;&lt;/ul&gt;

&lt;p&gt;Turns on verbose logging&lt;/p&gt;

&lt;h2&gt;Environment variables&lt;/h2&gt;
The environment variables used by &lt;b&gt;calabash-android&lt;/b&gt; are documented in a mark-down file in the source which can be found &lt;a href=&quot;https://github.com/calabash/calabash-android/blob/master/ruby-gem/ENVIRONMENT_VARIABLES.md&quot;&gt;here&lt;/a&gt;.

&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;Cucumber Options&lt;/h2&gt;

&lt;p&gt;The &lt;b&gt;run&lt;/b&gt; command forwards command line options to &lt;a href=&quot;https://www.blogger.com/blogger.g?blogID=5841903314797592940&quot;&gt;cucumber&lt;/a&gt;. The options are described by &lt;a href=&quot;https://github.com/cucumber/cucumber/blob/master/lib/cucumber/cli/options.rb&quot;&gt;options.rb&lt;/a&gt; in cucumber which is invoked by&lt;/p&gt;
&lt;br /&gt;
&lt;b&gt;cucumber --help&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
For cucumber 1.3.17:&lt;br /&gt;
&lt;pre&gt;Usage: cucumber [options] [ [FILE|DIR|URL][:LINE[:LINE]*] ]+

Examples:
cucumber examples/i18n/en/features
cucumber @rerun.txt (See --format rerun)
cucumber examples/i18n/it/features/somma.feature:6:98:113
cucumber -s -i http://rubyurl.com/eeCl

    -r, --require LIBRARY|DIR        Require files before executing the features. If this
                                     option is not specified, all *.rb files that are
                                     siblings or below the features will be loaded auto-
                                     matically. Automatic loading is disabled when this
                                     option is specified, and all loading becomes explicit.
                                     Files under directories named &quot;support&quot; are always
                                     loaded first.
                                     This option can be specified multiple times.
        --i18n LANG                  List keywords for in a particular language
                                     Run with &quot;--i18n help&quot; to see all languages
    -f, --format FORMAT              How to format features (Default: pretty). Available formats:
                                       debug       : For developing formatters - prints the calls made to the listeners.
                                       html        : Generates a nice looking HTML report.
                                       json        : Prints the feature as JSON
                                       json_pretty : Prints the feature as prettified JSON
                                       junit       : Generates a report similar to Ant+JUnit.
                                       pretty      : Prints the feature as is - in colours.
                                       progress    : Prints one character per scenario.
                                       rerun       : Prints failing files with line numbers.
                                       stepdefs    : Prints All step definitions with their locations. Same as
                                                     the usage formatter, except that steps are not printed.
                                       usage       : Prints where step definitions are used.
                                                     The slowest step definitions (with duration) are
                                                     listed first. If --dry-run is used the duration
                                                     is not shown, and step definitions are sorted by
                                                     filename instead.
                                     Use --format rerun --out features.txt to write out failing
                                     features. You can rerun them with cucumber @rerun.txt.
                                     FORMAT can also be the fully qualified class name of
                                     your own custom formatter. If the class isn&#39;t loaded,
                                     Cucumber will attempt to require a file with a relative
                                     file name that is the underscore name of the class name.
                                     Example: --format Foo::BarZap -&amp;gt; Cucumber will look for
                                     foo/bar_zap.rb. You can place the file with this relative
                                     path underneath your features/support directory or anywhere
                                     on Ruby&#39;s LOAD_PATH, for example in a Ruby gem.
    -o, --out [FILE|DIR]             Write output to a file/directory instead of STDOUT. This option
                                     applies to the previously specified --format, or the
                                     default format if no format is specified. Check the specific
                                     formatter&#39;s docs to see whether to pass a file or a dir.
    -t, --tags TAG_EXPRESSION        Only execute the features or scenarios with tags matching TAG_EXPRESSION.
                                     Scenarios inherit tags declared on the Feature level. The simplest
                                     TAG_EXPRESSION is simply a tag. Example: --tags @dev. When a tag in a tag
                                     expression starts with a ~, this represents boolean NOT. Example: --tags ~@dev.
                                     A tag expression can have several tags separated by a comma, which represents
                                     logical OR. Example: --tags @dev,@wip. The --tags option can be specified
                                     several times, and this represents logical AND. Example: --tags @foo,~@bar --tags @zap.
                                     This represents the boolean expression (@foo || !@bar) &amp;amp;&amp;amp; @zap.
                                     
                                     Beware that if you want to use several negative tags to exclude several tags
                                     you have to use logical AND: --tags ~@fixme --tags ~@buggy.
                                     
                                     Positive tags can be given a threshold to limit the number of occurrences.
                                     Example: --tags @qa:3 will fail if there are more than 3 occurrences of the @qa tag.
                                     This can be practical if you are practicing Kanban or CONWIP.
    -n, --name NAME                  Only execute the feature elements which match part of the given name.
                                     If this option is given more than once, it will match against all the
                                     given names.
    -e, --exclude PATTERN            Don&#39;t run feature files or require ruby files matching PATTERN
    -p, --profile PROFILE            Pull commandline arguments from cucumber.yml which can be defined as
                                     strings or arrays.  When a &#39;default&#39; profile is defined and no profile
                                     is specified it is always used. (Unless disabled, see -P below.)
                                     When feature files are defined in a profile and on the command line
                                     then only the ones from the command line are used.
    -P, --no-profile                 Disables all profile loading to avoid using the &#39;default&#39; profile.
    -c, --[no-]color                 Whether or not to use ANSI color in the output. Cucumber decides
                                     based on your platform and the output destination if not specified.
    -d, --dry-run                    Invokes formatters without executing the steps.
                                     This also omits the loading of your support/env.rb file if it exists.
    -a, --autoformat DIR             Reformats (pretty prints) feature files and write them to DIRECTORY.
                                     Be careful if you choose to overwrite the originals.
                                     Implies --dry-run --format pretty.
    -m, --no-multiline               Don&#39;t print multiline strings and tables under steps.
    -s, --no-source                  Don&#39;t print the file and line of the step definition with the steps.
    -i, --no-snippets                Don&#39;t print snippets for pending steps.
    -I, --snippet-type TYPE          Use different snippet type (Default: regexp). Available types:
                                     classic: Snippets without parentheses. Note that these cause a warning from modern versions of Ruby. e.g. Given /^missing step$/
                                     percent: Snippets with percent regexp e.g. Given %r{^missing step$}
                                     regexp : Snippets with parentheses    e.g. Given(/^missing step$/)
    -q, --quiet                      Alias for --no-snippets --no-source.
    -b, --backtrace                  Show full backtrace for all errors.
    -S, --strict                     Fail if there are any undefined or pending steps.
    -w, --wip                        Fail if there are any passing scenarios.
    -v, --verbose                    Show the files and features loaded.
    -g, --guess                      Guess best match for Ambiguous steps.
    -l, --lines LINES                Run given line numbers. Equivalent to FILE:LINE syntax
    -x, --expand                     Expand Scenario Outline Tables in output.
        --[no-]drb                   Run features against a DRb server. (i.e. with the spork gem)
        --port PORT                  Specify DRb port.  Ignored without --drb
        --dotcucumber DIR            Write metadata to DIR
        --version                    Show version.
    -h, --help                       You&#39;re looking at it.

&lt;/pre&gt;</description><link>http://sthen.blogspot.com/2015/02/calabash-android-command-line-options.html</link><author>noreply@blogger.com (Niels Sthen Hansen)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5841903314797592940.post-9081654341368830776</guid><pubDate>Wed, 12 Oct 2011 08:01:00 +0000</pubDate><atom:updated>2011-10-12T10:05:02.101+01:00</atom:updated><title>Lessor app is out</title><description>The&lt;a href=&quot;https://market.android.com/details?id=com.lessor.mobile.employee&amp;amp;feature=search_result&quot;&gt;&lt;/a&gt;&lt;span style=&quot;text-decoration: underline;&quot;&gt;&lt;/span&gt; &lt;a href=&quot;http://www.lessor.dk&quot;&gt;Lessor&lt;/a&gt; app just made it to the Android market. &lt;a href=&quot;https://market.android.com/details?id=com.lessor.mobile.employee&amp;amp;feature=search_result&quot;&gt;Check it out!&lt;/a&gt;&lt;div style=&#39;clear: both; text-align: center; font-size: xx-small;&#39;&gt;Published with Blogger-droid v1.7.4&lt;/div&gt;</description><link>http://sthen.blogspot.com/2011/10/lessor-app-just-made-it-to-android.html</link><author>noreply@blogger.com (Niels Sthen Hansen)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5841903314797592940.post-601763595834883260</guid><pubDate>Fri, 07 Oct 2011 14:26:00 +0000</pubDate><atom:updated>2011-10-09T14:14:00.441+01:00</atom:updated><title>Android Tutorial GOTO Århus</title><description>Link to files at the Android Tutorial, GOTO Århus 2011:&lt;br /&gt;&lt;br /&gt;&lt;span dir=&quot;ltr&quot; id=&quot;:wa&quot;&gt;&lt;a href=&quot;https://docs.google.com/#folders/0B_C0TFg2y2ezYTYyMTlmM2MtYzY0ZC00OGIwLWFlNTctYTFmMTJiYWQ5OTlk&quot;&gt;https://docs.go&lt;wbr&gt;ogle.com/#folde&lt;wbr&gt;rs/0B_C0TFg2y2e&lt;wbr&gt;zYTYyMTlmM2MtYz&lt;wbr&gt;Y0ZC00OGIwLWFlN&lt;wbr&gt;TctYTFmMTJiYWQ5&lt;wbr&gt;OTlk&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Or if you do not have a google account:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://dl.dropbox.com/u/20657490/androidtutorial.zip&quot;&gt;http://dl.dropbox.com/u/20657490/androidtutorial.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And the slides:&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://dl.dropbox.com/u/20657490/GOTO_android_tutorial_presentation.pdf&quot;&gt;http://dl.dropbox.com/u/20657490/GOTO_android_tutorial_presentation.pdf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;A solution for Hands-On 1-5 (minus extras):&lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://dl.dropbox.com/u/20657490/androidtutorialsolution.zip&quot;&gt;http://dl.dropbox.com/u/20657490/androidtutorialsolution.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;</description><link>http://sthen.blogspot.com/2011/10/android-tutorial-goto-arhus.html</link><author>noreply@blogger.com (Niels Sthen Hansen)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5841903314797592940.post-3186010154316359862</guid><pubDate>Fri, 28 May 2010 12:40:00 +0000</pubDate><atom:updated>2010-05-28T13:47:23.871+01:00</atom:updated><title>Wicket Webinar</title><description>Did a webinar on &lt;a href=&quot;http://wicket.apache.org/&quot;&gt;Apache Wicket&lt;/a&gt; recently for &lt;a href=&quot;http://dit.dk/&quot;&gt;Dansk IT&lt;/a&gt; - slides are &lt;a href=&quot;http://www.trifork.com/slides-fra-apache-wicket-smartere-java-webudvikling-webinar&quot;&gt;here&lt;/a&gt;...&lt;br /&gt;&lt;br /&gt;It is an odd way of presenting. You are basically just looking at your screen while talking - not much in the way of interaction with the audience. On the other hand, it is a fairly easy way to reach people you would normally not get out to because of geography so it will probably not be the last time I try this.</description><link>http://sthen.blogspot.com/2010/05/wicket-webinar.html</link><author>noreply@blogger.com (Niels Sthen Hansen)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5841903314797592940.post-7369055815826673891</guid><pubDate>Sat, 16 May 2009 09:14:00 +0000</pubDate><atom:updated>2009-05-16T11:13:38.255+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">continous integration</category><category domain="http://www.blogger.com/atom/ns#">junit</category><category domain="http://www.blogger.com/atom/ns#">testing</category><title>Don&#39;t Think - Just Write Tests, Right ?</title><description>I gave a brief talk on Continuous Integration at the local Java User Group a few weeks ago and I happened to mention that although I value automated regression testing very much I do not think it gives you any real guarantees that your software is error free.&lt;br /&gt;&lt;br /&gt;I think this provoked some in audience a bit - I got questions along the line of &quot;why do you hate unit testing so much?&quot; and I realized that I unwittingly had stepped on some toes there. Sorry guys, I hope we are still friends.&lt;br /&gt;&lt;br /&gt;Yes, I am a sceptic but for the record: I don&#39;t hate unit testing and I certainly do not think that people who do unit testing are idiots.&lt;br /&gt;&lt;br /&gt;What I &lt;span style=&quot;font-weight: bold;&quot;&gt;do&lt;/span&gt; have a problem with are when people set up their test suite, complete with red light for errors, green light for no errors - and then conclude the following:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Red light: there is a bug in the application code&lt;/li&gt;&lt;li&gt;Green light: there are no bugs in the application code&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;I think this assumption is incredibly naive and will try to explain why.&lt;br /&gt;&lt;br /&gt;Your test system consists of two components: The application code and the test code itself (junit test cases, mocking etc.). Software bugs can be present in &lt;span style=&quot;font-weight: bold;&quot;&gt;either&lt;/span&gt; component. This should be a known fact to anyone who have been working seriously with automated testing.&lt;br /&gt;&lt;br /&gt;Consequently, &lt;b&gt;red light&lt;/b&gt; means you have either&lt;br /&gt;&lt;ul&gt;&lt;li&gt;A bug in your application code&lt;/li&gt;&lt;li&gt;OR you have a bug in your test code!&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;I admit that this is very useful information and it also gives you an idea about where the problem lies - it is either in the code being tested or in the test itself.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Green light&lt;/b&gt; on the other hand is much more tricky. Really, all it tells you is that&lt;p&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;You have no bugs anywhere...&lt;/li&gt;&lt;li&gt;OR .. you have a bug in your application code but the test that was supposed to cover it is faulty as well!&lt;/li&gt;&lt;li&gt;OR .. you have a bug in your application code that is not covered by a test&lt;/li&gt;&lt;/ol&gt;When we see the green light we want to believe that we are dealing with case #1 - no bugs. But we really have no way of knowing this for sure.&lt;br /&gt;&lt;br /&gt;Case #2 is fairly common in large test systems and is generally detected by someone else down the line - either QA or the end user. How do know that your test code is error free anyway? Are you writing unit tests to test your unit tests? And if so, are you also testing the test code that is testing the original test code... ?&lt;br /&gt;&lt;br /&gt;This brings us to case #3 which has to do with test coverage. Yes, you can minimize the case 3 bugs by writing more tests. There is a catch, however: All the new test code you write could potentially have bugs, thus introducing more of the case #2 scenarios.&lt;br /&gt;&lt;br /&gt;If you have ten lines of test code for every line of application code it means that there is a ten times higher risk of bugs in your test code. There is some powerful mathematics working against us in our attempt to achieve a full, error-free test coverage.&lt;br /&gt;&lt;br /&gt;Integration testing is a way to test more lines of application code with less lines of test code but the same principle applies: As your test suite grows, so does the likelihood of having bugs in the test suite.&lt;br /&gt;&lt;br /&gt;All this doesn&#39;t mean that you should stop doing automated testing. What is does mean is that you should look at your test results with a certain amount of scepticism. A failed test means you have a problem - either with your application code or your tests. No failed tests just means that there are potential undetected problems out there. And the way to solve these problems may not be to just blindly write more test code. Don&#39;t fire your QA people just yet.</description><link>http://sthen.blogspot.com/2009/05/dont-think-just-write-tests-right.html</link><author>noreply@blogger.com (Niels Sthen Hansen)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5841903314797592940.post-6059384167116550858</guid><pubDate>Fri, 14 Mar 2008 13:56:00 +0000</pubDate><atom:updated>2008-03-14T15:35:25.441+00:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">SFTP</category><category domain="http://www.blogger.com/atom/ns#">SSH</category><title>SFTP in Java with JSch Using Private Key Authentication</title><description>&lt;a href=&quot;http://www.jcraft.com/jsch/&quot;&gt;JSch&lt;/a&gt; is an excellent library for ssh in Java. One bad thing is that there is no real documentation - or rather, the source itself is the documentation. And the good news is of course that the source code is available along with a nice collection of examples.&lt;br /&gt;&lt;br /&gt;I recently had to use SFTP from a Java application and it did take some source-diving to figure out exactly how it works (specifically to get the parameters for JSch.addIdentity right). It turned out to be rather straight-forward:&lt;br /&gt;&lt;pre style=&quot;color: #0000ff;&quot;&gt;&lt;br /&gt;    ...&lt;br /&gt;&lt;br /&gt;    private void execute() throws JSchException, SftpException {&lt;br /&gt;        JSch jSch = new JSch();&lt;br /&gt;        final byte[] prvkey = readMyPrivateKeyFromFile(); // Private key must be byte array&lt;br /&gt;        final byte[] emptyPassPhrase = new byte[0]; // Empty passphrase for now, get real passphrase from MyUserInfo&lt;br /&gt;&lt;br /&gt;        jSch.addIdentity(&lt;br /&gt;            &quot;myusername&quot;,    // String userName&lt;br /&gt;            prvkey,          // byte[] privateKey &lt;br /&gt;            null,            // byte[] publicKey&lt;br /&gt;            emptyPassPhrase  // byte[] passPhrase&lt;br /&gt;        );&lt;br /&gt;        Session session = jSch.getSession(&quot;myusername&quot;, &quot;hostname.com&quot;, 22);&lt;br /&gt;        UserInfo ui = new MyUserInfo(); // MyUserInfo implements UserInfo&lt;br /&gt;        session.setUserInfo(ui);&lt;br /&gt;        session.connect();&lt;br /&gt;        Channel channel = session.openChannel(&quot;sftp&quot;);&lt;br /&gt;        ChannelSftp sftp = (ChannelSftp) channel;&lt;br /&gt;        sftp.connect();&lt;br /&gt;&lt;br /&gt;        final Vector files = sftp.ls(&quot;.&quot;);&lt;br /&gt;        for (Object obj : files) {&lt;br /&gt;            // Do stuff with files&lt;br /&gt;        }&lt;br /&gt;        sftp.disconnect();&lt;br /&gt;        session.disconnect();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    ...&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;The MyUserInfo class must implement the UserInfo interface. There are a number of good examples of this in the jsch distribution.</description><link>http://sthen.blogspot.com/2008/03/sftp-i-java-with-jsch-using-private-key.html</link><author>noreply@blogger.com (Niels Sthen Hansen)</author><thr:total>17</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5841903314797592940.post-1815990308915933014</guid><pubDate>Fri, 15 Jun 2007 13:16:00 +0000</pubDate><atom:updated>2007-07-26T21:55:31.783+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">Agile</category><category domain="http://www.blogger.com/atom/ns#">Lean</category><title>Lean and Metaphors</title><description>A criticism of Lean Software Development is hard to find. While I think it offers a number of useful ideas and tools, I am somewhat sceptic towards the widespread use of &lt;font style=&quot;font-weight: bold;&quot;&gt;metaphors from manufacturing&lt;/font&gt; found in &lt;a href=&quot;http://www.amazon.com/Lean-Software-Development-Toolkit-Managers/dp/0321150783/ref=pd_bbs_sr_2/103-0492321-8124606?ie=UTF8&amp;s=books&amp;amp;amp;qid=1185464010&amp;sr=8-2&quot;&gt;Lean Software Development: An Agile Toolkit..&lt;/a&gt; and elsewhere.&lt;br /&gt;&lt;br /&gt;Metaphors are powerful in the way that they allow us to transfer insights from one area of experience to another. However, for these insights to be valid it is required that the metaphor has the same characteristics and dynamics as the system it is supposed to model. Or to put it more bluntly: Lean will solve all your problems to the extent that your software development organisation is like a manufacturing plant...&lt;br /&gt;&lt;br /&gt;It is not all bad, though. The assembly line model may fail to capture all aspects of software development - but it does bring issues such as queues and waste into focus and provide a framework for discussing and adressing them. So even if Lean is not the final answer to everything it remains a useful tool for certain applications.&lt;br /&gt;&lt;br /&gt;However, if software development is a field in its own right why do we then always have to use metaphors and analogues to describe it? It is clear that there is &lt;a href=&quot;http://www.amazon.com/Organizational-Patterns-Agile-Software-Development/dp/0131467409/ref=pd_bbs_sr_1/103-0492321-8124606?ie=UTF8&amp;amp;s=books&amp;qid=1185464366&amp;amp;sr=8-1&quot;&gt;much to be learned&lt;/a&gt; from viewing software development as .. well, software development.</description><link>http://sthen.blogspot.com/2007/06/lean-and-metaphors.html</link><author>noreply@blogger.com (Niels Sthen Hansen)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5841903314797592940.post-7488313821377731636</guid><pubDate>Thu, 31 May 2007 08:18:00 +0000</pubDate><atom:updated>2007-06-15T15:38:34.331+01:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">.NET</category><title>.NET Class Generation - Delegating Object Properties</title><description>In a recent assignment I had the need for a dynamically generated class that - among other things - could be generated with a field of arbitrary type and delegate the properties of said field. In other words something like&lt;br /&gt;&lt;pre style=&quot;color: green;&quot;&gt;&lt;br /&gt;public class MyWrapperClass : MyParentClass&lt;br /&gt;{&lt;br /&gt;private ObjectType _WrappedObject;&lt;br /&gt;&lt;br /&gt;public ObjectType WrappedObject&lt;br /&gt;{&lt;br /&gt;    set { _WrappedObject = value; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public string Field1&lt;br /&gt;{&lt;br /&gt;    get { return _WrappedObject.Field1; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;public int Field2&lt;br /&gt;{&lt;br /&gt;    get { return _WrappedObject.Field2; }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// ... other stuff&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;where ObjectType can be any type and MyParentClass is a base class.&lt;br /&gt;&lt;br /&gt;Fortunately, .NET reflection and class generation is pretty straight-forward. Generating the class itself requires an assembly, module etc.:&lt;br /&gt;&lt;pre style=&quot;color: blue;&quot;&gt;&lt;br /&gt;AppDomain appDomain = Thread.GetDomain();&lt;br /&gt;AssemblyName assemblyName = new AssemblyName();&lt;br /&gt;assemblyName.Name = &quot;MyAssembly&quot;;&lt;br /&gt;AssemblyBuilder assemblyBuilder&lt;br /&gt;= appDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);&lt;br /&gt;ModuleBuilder moduleBuilder = assemblyBuilder.DefineDynamicModule(&quot;MyModule&quot;);&lt;br /&gt;TypeBuilder typeBuilder&lt;br /&gt;= moduleBuilder.DefineType(&quot;MyWrapperClass&quot;, TypeAttributes.Public);&lt;br /&gt;typeBuilder.SetParent(typeof(MyParentClass));&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The field holding our wrapped object must be declared to be the same type as the object to be wrapped&lt;br /&gt;&lt;pre style=&quot;color: green;&quot;&gt;&lt;br /&gt;private ObjectType _ObjectToBeWrapped&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This can be done with the following code:&lt;br /&gt;&lt;pre style=&quot;color: blue;&quot;&gt;&lt;br /&gt;Type objectType = wrappedObject.GetType();&lt;br /&gt;FieldBuilder wrappedObjectField&lt;br /&gt;= typeBuilder.DefineField(&quot;_WrappedObject&quot;, objectType, FieldAttributes.Private);&lt;br /&gt;&lt;/pre&gt;We will also need a setter for the object&lt;br /&gt;&lt;pre style=&quot;color: green;&quot;&gt;&lt;br /&gt;public ObjectType WrappedObject { set { _WrappedObject = value; } }&lt;br /&gt;&lt;/pre&gt;And this requires some IL code generation:&lt;br /&gt;&lt;pre style=&quot;color: blue;&quot;&gt;&lt;br /&gt;// Create property ObjectToBeWrapped&lt;br /&gt;PropertyBuilder wrappedObjPropertyBuilder&lt;br /&gt;  = typeBuilder.DefineProperty(&quot;WrappedObject&quot;, PropertyAttributes.None,&lt;br /&gt;  objectType, null);&lt;br /&gt;&lt;br /&gt;// Create property setter&lt;br /&gt;MethodBuilder wrappedObjSetBuilder =&lt;br /&gt;  typeBuilder.DefineMethod(&quot;set_WrappedObject&quot;, MethodAttributes.Public,&lt;br /&gt;  null, new Type[] { objectType });&lt;br /&gt;ILGenerator wrappedObjSetILG = wrappedObjSetBuilder.GetILGenerator();&lt;br /&gt;wrappedObjSetILG.Emit(OpCodes.Ldarg_0);&lt;br /&gt;wrappedObjSetILG.Emit(OpCodes.Ldarg_1);&lt;br /&gt;wrappedObjSetILG.Emit(OpCodes.Stfld, wrappedObjectField);&lt;br /&gt;wrappedObjSetILG.Emit(OpCodes.Ret);&lt;br /&gt;wrappedObjPropertyBuilder.SetSetMethod(wrappedObjSetBuilder);&lt;br /&gt;&lt;/pre&gt;Note that the &quot;set { value = .. }&quot; notation actually corresponds to a method &quot;set_MyProperty(object value) {...&quot;, much like Java-style getters &amp; setters.&lt;br /&gt;&lt;br /&gt;Now for the fun bit: Create a getter for each property in the wrapped object. We iterate through the properties and generating a getter method works much like the setter above.&lt;br /&gt;&lt;pre style=&quot;color: blue;&quot;&gt;&lt;br /&gt;foreach (PropertyInfo propertyInfo in objectType.GetProperties())&lt;br /&gt;{&lt;br /&gt;  string name = propertyInfo.Name;&lt;br /&gt;  if (IgnoreProperty(name))&lt;br /&gt;  {&lt;br /&gt;     continue;&lt;br /&gt;  }&lt;br /&gt;  PropertyBuilder propertyBuilder =&lt;br /&gt;     typeBuilder.DefineProperty(name, PropertyAttributes.None,&lt;br /&gt;     propertyInfo.PropertyType, null);&lt;br /&gt;&lt;br /&gt;  MethodBuilder getBuilder =&lt;br /&gt;     typeBuilder.DefineMethod(&quot;get_&quot; + name, MethodAttributes.Public,&lt;br /&gt;     propertyInfo.PropertyType, Type.EmptyTypes);&lt;br /&gt;&lt;br /&gt;  ILGenerator getILG = getBuilder.GetILGenerator();&lt;br /&gt;  getILG.Emit(OpCodes.Ldarg_0);&lt;br /&gt;  getILG.Emit(OpCodes.Ldfld, wrappedObjectField);&lt;br /&gt;  getILG.Emit(OpCodes.Call, propertyInfo.GetGetMethod());&lt;br /&gt;  getILG.Emit(OpCodes.Ret);&lt;br /&gt;&lt;br /&gt;  propertyBuilder.SetGetMethod(getBuilder);&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;</description><link>http://sthen.blogspot.com/2007/05/net-class-generation-delegating-objects.html</link><author>noreply@blogger.com (Niels Sthen Hansen)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-5841903314797592940.post-4906005781151614154</guid><pubDate>Fri, 25 May 2007 12:08:00 +0000</pubDate><atom:updated>2008-12-09T04:07:36.206+00:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">IntelliJ</category><category domain="http://www.blogger.com/atom/ns#">JavaFX</category><title>JavaFX in IntelliJ IDEA</title><description>No, at this point in time there is no &lt;a href=&quot;http://sun.com/javafx/&quot;&gt;JavaFX&lt;/a&gt; plugin for &lt;a href=&quot;http://www.jetbrains.com/idea/&quot;&gt;IDEA&lt;/a&gt;.  It is fairly simple to get it up and running, though.&lt;br /&gt;&lt;br /&gt;1. First you want to get &lt;a href=&quot;https://openjfx.dev.java.net/#downloads&quot;&gt;openjfx&lt;/a&gt; (subversion or .zip).&lt;br /&gt;&lt;br /&gt;2. Create a Java project in IDEA and put the files from trunk/lib (Filters.jar,  javafxrt.jar &amp;  swing-layout.jar) in the classpath (e.g. add as a project library).&lt;br /&gt;&lt;br /&gt;3. Create a .fx file&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj17GWx7XxdCIdMhhz1UuxMnnKuRmII1_KK86hs0Li1eLSSueBX2Z_7Htd4RpVhKxmjqR1w_la5dqtzIlb-fkQX-R0tjr1mRuhOg7hRW947I61aav9YO9TrZrU28qsln3E63FqDYM3RgwI/s1600-h/syntax.png&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj17GWx7XxdCIdMhhz1UuxMnnKuRmII1_KK86hs0Li1eLSSueBX2Z_7Htd4RpVhKxmjqR1w_la5dqtzIlb-fkQX-R0tjr1mRuhOg7hRW947I61aav9YO9TrZrU28qsln3E63FqDYM3RgwI/s320/syntax.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5068497147388018690&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;4. Create a run configuration&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixu7d0ZHKdLP1ip4T10I7NPmtrY08M5s5ieXDcZMdIGH0wzeYBZ1YPK5ZmuZthNElHWBse4Czhl9K4V_O0A0FulHA4iiRbA147e01UvLq412YOL_ncuw3hFraEwsfcSQIZqg8CUzkhQ-E/s1600-h/idea-runconfig.png&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixu7d0ZHKdLP1ip4T10I7NPmtrY08M5s5ieXDcZMdIGH0wzeYBZ1YPK5ZmuZthNElHWBse4Czhl9K4V_O0A0FulHA4iiRbA147e01UvLq412YOL_ncuw3hFraEwsfcSQIZqg8CUzkhQ-E/s320/idea-runconfig.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5068481200174448626&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;Basically you want to run net.java.javafx.FXShell with your .fx file as an argument.&lt;br /&gt;&lt;br /&gt;4. &lt;span style=&quot;font-weight: bold;&quot;&gt;Make sure that your .fx file is in the classpath&lt;/span&gt;&lt;br /&gt;..Otherwise it won&#39;t work&lt;br /&gt;&lt;br /&gt;As for syntax highlighting this can be set up by making a file type definition for *.fx files:&lt;br /&gt;&lt;br /&gt;&lt;a onblur=&quot;try {parent.deselectBloggerImageGracefully();} catch(e) {}&quot; href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4_662ceiJaAprylI7fmmmQniejVbF-ZKWu9CT48cfjYVQ7gUIk9D-PmfmxZXBeqZeJafr18pxRrxMOY4lNgpc3RyNpNmSL2IGW7I5FVaS12kdBd365-iRKhqMquaxdCqTW16ygSL3AJU/s1600-h/filetype.png&quot;&gt;&lt;img style=&quot;margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4_662ceiJaAprylI7fmmmQniejVbF-ZKWu9CT48cfjYVQ7gUIk9D-PmfmxZXBeqZeJafr18pxRrxMOY4lNgpc3RyNpNmSL2IGW7I5FVaS12kdBd365-iRKhqMquaxdCqTW16ygSL3AJU/s320/filetype.png&quot; alt=&quot;&quot; id=&quot;BLOGGER_PHOTO_ID_5068497486690435090&quot; border=&quot;0&quot; /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;So all in all pretty ugly. A real JavaFX plugin is still on the IDEA &lt;a href=&quot;http://plugins.intellij.net/wishlist/item/?wid=94&quot;&gt;wishlist&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;And yes, there is already a &lt;a href=&quot;https://openjfx.dev.java.net/javafx-eclipse-plugin-install.html&quot;&gt;plugin&lt;/a&gt; for &lt;a href=&quot;http://www.eclipse.org/&quot;&gt;Eclipse&lt;/a&gt;. There is also a fairly comprehensive &lt;a href=&quot;https://openjfx.dev.java.net/Getting_Started_With_JavaFX.html&quot;&gt;tutorial&lt;/a&gt; using NetBeans on openjfx.dev.java.net&lt;br /&gt;&lt;br /&gt;&lt;span class=&quot;down&quot; style=&quot;display: block;&quot; id=&quot;formatbar_CreateLink&quot; title=&quot;Link&quot; onmouseover=&quot;ButtonHoverOn(this);&quot; onmouseout=&quot;ButtonHoverOff(this);&quot; onmouseup=&quot;&quot; onmousedown=&quot;CheckFormatting(event);FormatbarButton(&#39;richeditorframe&#39;, this, 8);ButtonMouseDown(this);&quot;&gt;&lt;/span&gt;</description><link>http://sthen.blogspot.com/2007/05/javafx-in-intellij-idea.html</link><author>noreply@blogger.com (Niels Sthen Hansen)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj17GWx7XxdCIdMhhz1UuxMnnKuRmII1_KK86hs0Li1eLSSueBX2Z_7Htd4RpVhKxmjqR1w_la5dqtzIlb-fkQX-R0tjr1mRuhOg7hRW947I61aav9YO9TrZrU28qsln3E63FqDYM3RgwI/s72-c/syntax.png" height="72" width="72"/><thr:total>2</thr:total></item></channel></rss>