<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-5841903314797592940</atom:id><lastBuildDate>Fri, 09 Dec 2011 09:11:09 +0000</lastBuildDate><category>junit</category><category>continous integration</category><category>Lean</category><category>IntelliJ</category><category>testing</category><category>SSH</category><category>Java</category><category>Agile</category><category>SFTP</category><category>.NET</category><category>JavaFX</category><title>On Software Development</title><description /><link>http://sthen.blogspot.com/</link><managingEditor>noreply@blogger.com (Niels Sthen Hansen)</managingEditor><generator>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/OnSoftwareDevelopment" /><feedburner:info uri="onsoftwaredevelopment" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><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="https://market.android.com/details?id=com.lessor.mobile.employee&amp;amp;feature=search_result"&gt;&lt;/a&gt;&lt;span style="text-decoration: underline;"&gt;&lt;/span&gt; &lt;a href="http://www.lessor.dk"&gt;Lessor&lt;/a&gt; app just made it to the Android market. &lt;a href="https://market.android.com/details?id=com.lessor.mobile.employee&amp;amp;feature=search_result"&gt;Check it out!&lt;/a&gt;&lt;div style='clear: both; text-align: center; font-size: xx-small;'&gt;Published with Blogger-droid v1.7.4&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5841903314797592940-9081654341368830776?l=sthen.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OnSoftwareDevelopment/~4/hWMgWOjpDzA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OnSoftwareDevelopment/~3/hWMgWOjpDzA/lessor-app-just-made-it-to-android.html</link><author>noreply@blogger.com (Niels Sthen Hansen)</author><thr:total>0</thr:total><feedburner:origLink>http://sthen.blogspot.com/2011/10/lessor-app-just-made-it-to-android.html</feedburner:origLink></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="ltr" id=":wa"&gt;&lt;a href="https://docs.google.com/#folders/0B_C0TFg2y2ezYTYyMTlmM2MtYzY0ZC00OGIwLWFlNTctYTFmMTJiYWQ5OTlk"&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="http://dl.dropbox.com/u/20657490/androidtutorial.zip"&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="http://dl.dropbox.com/u/20657490/GOTO_android_tutorial_presentation.pdf"&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="http://dl.dropbox.com/u/20657490/androidtutorialsolution.zip"&gt;http://dl.dropbox.com/u/20657490/androidtutorialsolution.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5841903314797592940-601763595834883260?l=sthen.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OnSoftwareDevelopment/~4/6HjQIljzdUA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OnSoftwareDevelopment/~3/6HjQIljzdUA/android-tutorial-goto-arhus.html</link><author>noreply@blogger.com (Niels Sthen Hansen)</author><thr:total>0</thr:total><feedburner:origLink>http://sthen.blogspot.com/2011/10/android-tutorial-goto-arhus.html</feedburner:origLink></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="http://wicket.apache.org/"&gt;Apache Wicket&lt;/a&gt; recently for &lt;a href="http://dit.dk/"&gt;Dansk IT&lt;/a&gt; - slides are &lt;a href="http://www.trifork.com/slides-fra-apache-wicket-smartere-java-webudvikling-webinar"&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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5841903314797592940-3186010154316359862?l=sthen.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OnSoftwareDevelopment/~4/kecnHegoEeE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OnSoftwareDevelopment/~3/kecnHegoEeE/wicket-webinar.html</link><author>noreply@blogger.com (Niels Sthen Hansen)</author><thr:total>0</thr:total><feedburner:origLink>http://sthen.blogspot.com/2010/05/wicket-webinar.html</feedburner:origLink></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#">testing</category><category domain="http://www.blogger.com/atom/ns#">junit</category><title>Don'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 "why do you hate unit testing so much?" 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'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="font-weight: bold;"&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="font-weight: bold;"&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'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't fire your QA people just yet.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5841903314797592940-7369055815826673891?l=sthen.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OnSoftwareDevelopment/~4/1YPSBcPOMIg" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OnSoftwareDevelopment/~3/1YPSBcPOMIg/dont-think-just-write-tests-right.html</link><author>noreply@blogger.com (Niels Sthen Hansen)</author><thr:total>1</thr:total><feedburner:origLink>http://sthen.blogspot.com/2009/05/dont-think-just-write-tests-right.html</feedburner:origLink></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.441Z</atom:updated><category domain="http://www.blogger.com/atom/ns#">Java</category><category domain="http://www.blogger.com/atom/ns#">SSH</category><category domain="http://www.blogger.com/atom/ns#">SFTP</category><title>SFTP in Java with JSch Using Private Key Authentication</title><description>&lt;a href="http://www.jcraft.com/jsch/"&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="color: #0000ff;"&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;            "myusername",    // 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("myusername", "hostname.com", 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("sftp");&lt;br /&gt;        ChannelSftp sftp = (ChannelSftp) channel;&lt;br /&gt;        sftp.connect();&lt;br /&gt;&lt;br /&gt;        final Vector files = sftp.ls(".");&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.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5841903314797592940-6059384167116550858?l=sthen.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OnSoftwareDevelopment/~4/HwNOBabLRzI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OnSoftwareDevelopment/~3/HwNOBabLRzI/sftp-i-java-with-jsch-using-private-key.html</link><author>noreply@blogger.com (Niels Sthen Hansen)</author><thr:total>17</thr:total><feedburner:origLink>http://sthen.blogspot.com/2008/03/sftp-i-java-with-jsch-using-private-key.html</feedburner:origLink></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#">Lean</category><category domain="http://www.blogger.com/atom/ns#">Agile</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="font-weight: bold;"&gt;metaphors from manufacturing&lt;/font&gt; found in &lt;a href="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"&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="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"&gt;much to be learned&lt;/a&gt; from viewing software development as .. well, software development.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5841903314797592940-1815990308915933014?l=sthen.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OnSoftwareDevelopment/~4/8tukGhIWJlQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OnSoftwareDevelopment/~3/8tukGhIWJlQ/lean-and-metaphors.html</link><author>noreply@blogger.com (Niels Sthen Hansen)</author><thr:total>1</thr:total><feedburner:origLink>http://sthen.blogspot.com/2007/06/lean-and-metaphors.html</feedburner:origLink></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="color: green;"&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="color: blue;"&gt;&lt;br /&gt;AppDomain appDomain = Thread.GetDomain();&lt;br /&gt;AssemblyName assemblyName = new AssemblyName();&lt;br /&gt;assemblyName.Name = "MyAssembly";&lt;br /&gt;AssemblyBuilder assemblyBuilder&lt;br /&gt;= appDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);&lt;br /&gt;ModuleBuilder moduleBuilder = assemblyBuilder.DefineDynamicModule("MyModule");&lt;br /&gt;TypeBuilder typeBuilder&lt;br /&gt;= moduleBuilder.DefineType("MyWrapperClass", 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="color: green;"&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="color: blue;"&gt;&lt;br /&gt;Type objectType = wrappedObject.GetType();&lt;br /&gt;FieldBuilder wrappedObjectField&lt;br /&gt;= typeBuilder.DefineField("_WrappedObject", objectType, FieldAttributes.Private);&lt;br /&gt;&lt;/pre&gt;We will also need a setter for the object&lt;br /&gt;&lt;pre style="color: green;"&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="color: blue;"&gt;&lt;br /&gt;// Create property ObjectToBeWrapped&lt;br /&gt;PropertyBuilder wrappedObjPropertyBuilder&lt;br /&gt;  = typeBuilder.DefineProperty("WrappedObject", 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("set_WrappedObject", 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 "set { value = .. }" notation actually corresponds to a method "set_MyProperty(object value) {...", 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="color: blue;"&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("get_" + 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;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5841903314797592940-7488313821377731636?l=sthen.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OnSoftwareDevelopment/~4/S_I04unEW_s" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OnSoftwareDevelopment/~3/S_I04unEW_s/net-class-generation-delegating-objects.html</link><author>noreply@blogger.com (Niels Sthen Hansen)</author><thr:total>0</thr:total><feedburner:origLink>http://sthen.blogspot.com/2007/05/net-class-generation-delegating-objects.html</feedburner:origLink></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.206Z</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="http://sun.com/javafx/"&gt;JavaFX&lt;/a&gt; plugin for &lt;a href="http://www.jetbrains.com/idea/"&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="https://openjfx.dev.java.net/#downloads"&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="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_4E_zmGHw3rY/RlbrTS8kwAI/AAAAAAAAAAc/2_z3eRQxKyg/s1600-h/syntax.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://2.bp.blogspot.com/_4E_zmGHw3rY/RlbrTS8kwAI/AAAAAAAAAAc/2_z3eRQxKyg/s320/syntax.png" alt="" id="BLOGGER_PHOTO_ID_5068497147388018690" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;4. Create a run configuration&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_4E_zmGHw3rY/RlbczC8kv_I/AAAAAAAAAAU/SLN7E8RafJk/s1600-h/idea-runconfig.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_4E_zmGHw3rY/RlbczC8kv_I/AAAAAAAAAAU/SLN7E8RafJk/s320/idea-runconfig.png" alt="" id="BLOGGER_PHOTO_ID_5068481200174448626" border="0" /&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="font-weight: bold;"&gt;Make sure that your .fx file is in the classpath&lt;/span&gt;&lt;br /&gt;..Otherwise it won'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="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_4E_zmGHw3rY/RlbrnC8kwBI/AAAAAAAAAAk/qYtmFnIjTaQ/s1600-h/filetype.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_4E_zmGHw3rY/RlbrnC8kwBI/AAAAAAAAAAk/qYtmFnIjTaQ/s320/filetype.png" alt="" id="BLOGGER_PHOTO_ID_5068497486690435090" border="0" /&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="http://plugins.intellij.net/wishlist/item/?wid=94"&gt;wishlist&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;And yes, there is already a &lt;a href="https://openjfx.dev.java.net/javafx-eclipse-plugin-install.html"&gt;plugin&lt;/a&gt; for &lt;a href="http://www.eclipse.org/"&gt;Eclipse&lt;/a&gt;. There is also a fairly comprehensive &lt;a href="https://openjfx.dev.java.net/Getting_Started_With_JavaFX.html"&gt;tutorial&lt;/a&gt; using NetBeans on openjfx.dev.java.net&lt;br /&gt;&lt;br /&gt;&lt;span class="down" style="display: block;" id="formatbar_CreateLink" title="Link" onmouseover="ButtonHoverOn(this);" onmouseout="ButtonHoverOff(this);" onmouseup="" onmousedown="CheckFormatting(event);FormatbarButton('richeditorframe', this, 8);ButtonMouseDown(this);"&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5841903314797592940-4906005781151614154?l=sthen.blogspot.com' alt='' /&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/OnSoftwareDevelopment/~4/by71Q-Q2aR4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/OnSoftwareDevelopment/~3/by71Q-Q2aR4/javafx-in-intellij-idea.html</link><author>noreply@blogger.com (Niels Sthen Hansen)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/_4E_zmGHw3rY/RlbrTS8kwAI/AAAAAAAAAAc/2_z3eRQxKyg/s72-c/syntax.png" height="72" width="72" /><thr:total>2</thr:total><feedburner:origLink>http://sthen.blogspot.com/2007/05/javafx-in-intellij-idea.html</feedburner:origLink></item></channel></rss>

