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

<channel>
	<title>The ramblings of a yorkshire tyke &#187; cobol.net</title>
	<atom:link href="http://www.gennard.net/blog/tag/cobol-net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gennard.net/blog</link>
	<description>Life, Rants and Programming In A Blog</description>
	<lastBuildDate>Sat, 10 Jul 2010 23:04:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Method Chaining</title>
		<link>http://www.gennard.net/blog/2010/05/method-chaining/</link>
		<comments>http://www.gennard.net/blog/2010/05/method-chaining/#comments</comments>
		<pubDate>Thu, 27 May 2010 23:50:09 +0000</pubDate>
		<dc:creator>spgennard</dc:creator>
				<category><![CDATA[CLR]]></category>
		<category><![CDATA[COBOL]]></category>
		<category><![CDATA[cobol.net]]></category>
		<category><![CDATA[method-chaining]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Visual COBOL]]></category>
		<category><![CDATA[visualcobol]]></category>

		<guid isPermaLink="false">http://www.gennard.net/blog/?p=591</guid>
		<description><![CDATA[Creating objects with a complex constructor can be a bit of a pain in any language. One technique I have used is method chaining. It is not applicable to every type of class but it can be useful. Method chain can help simply the use class and allows more complex object initialisation without having to [...]]]></description>
			<content:encoded><![CDATA[<p>Creating objects with a complex constructor can be a bit of a pain in any language.     One technique I have used is method chaining.  It is not applicable to every type of class but it can be useful.</p>
<p>Method chain can help simply the use class and allows more complex object initialisation without having to worry about the order of the parameters and be done inline.</p>
<p>Consider the use of an &#8220;Account&#8221; class that takes Name, Address, Telephone and Country.  All of which are strings, the constructor with four strings would not be a great constructor.  </p>
<p>So you could have a simple constructor and four properties/methods.. however so set up the object would mean you have spread the setup over multiple lines.</p>
<p>Using method chain you can overcome this and even space in the &#8220;value&#8221; area of the object in your storage area.</p>
<div class="codecolorer-container cobol blackboard" style="border: 1px solid #9F9F9F;width:435px;"><div class="cobol codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000; font-weight: bold;">set</span> x <span style="color: #000000; font-weight: bold;">to</span> new <span style="color: #008000; font-weight: bold;">type</span> Account::Name<span style="color: #339933;">&#40;</span><span style="color: #ff0000;">&quot;xx&quot;</span><span style="color: #339933;">&#41;</span>::<span style="color: #008000; font-weight: bold;">Address</span><span style="color: #339933;">&#40;</span><span style="color: #ff0000;">&quot;yy&quot;</span><span style="color: #339933;">&#41;</span> ::Telephone<span style="color: #339933;">&#40;</span><span style="color: #ff0000;">&quot;yy&quot;</span><span style="color: #339933;">&#41;</span><br />
&nbsp; &nbsp; &nbsp;::Country<span style="color: #339933;">&#40;</span><span style="color: #ff0000;">&quot;zz&quot;</span><span style="color: #339933;">&#41;</span>::World<span style="color: #339933;">&#40;</span><span style="color: #ff0000;">&quot;Earth&quot;</span><span style="color: #339933;">&#41;</span></div></div>
<p>The trick of the pattern is to provide methods that always return this/self, so we can change the invokes together&#8230;    For example:</p>
<p>This technique could even be used to build up a series of items required, for example, the preparation and execution of a sql statement comes to mind&#8230; in a similar fashion to Linq.</p>
<p>So&#8230; lets look at an example:</p>
<div class="codecolorer-container cobol blackboard" style="border: 1px solid #9F9F9F;width:435px;"><div class="cobol codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #a0a0a0; font-style: italic;">$set ilusing&quot;System.Collections.Generic&quot; </span><br />
<span style="color: #008000; font-weight: bold;">program-id</span><span style="color: #000066;">.</span> Program1 <span style="color: #008000; font-weight: bold;">as</span> <span style="color: #ff0000;">&quot;MethodChaining1.Program1&quot;</span><span style="color: #000066;">.</span><br />
<span style="color: #008000; font-weight: bold;">data</span> <span style="color: #008000; font-weight: bold;">division</span><span style="color: #000066;">.</span><br />
<span style="color: #008000; font-weight: bold;">working-storage</span> <span style="color: #000080; font-weight: bold;">section</span><span style="color: #000066;">.</span><br />
01 accounts <span style="color: #008000; font-weight: bold;">type</span> <span style="color: #000080; font-weight: bold;">List</span><span style="color: #339933;">&#91;</span><span style="color: #008000; font-weight: bold;">type</span> Account<span style="color: #339933;">&#93;</span> <span style="color: #008000; font-weight: bold;">value</span> new <span style="color: #008000; font-weight: bold;">type</span> <span style="color: #000080; font-weight: bold;">List</span><span style="color: #339933;">&#91;</span><span style="color: #008000; font-weight: bold;">type</span> Account<span style="color: #339933;">&#93;</span><span style="color: #000066;">.</span> &nbsp; &nbsp; &nbsp;<br />
01 jAccount <span style="color: #008000; font-weight: bold;">type</span> Account <span style="color: #008000; font-weight: bold;">value</span><br />
&nbsp; &nbsp;new <span style="color: #008000; font-weight: bold;">type</span> Account::Name<span style="color: #339933;">&#40;</span><span style="color: #ff0000;">&quot;Mr Johnson&quot;</span><span style="color: #339933;">&#41;</span>::<span style="color: #008000; font-weight: bold;">Address</span><span style="color: #339933;">&#40;</span><span style="color: #ff0000;">&quot;Somewhere, some place&quot;</span><span style="color: #339933;">&#41;</span><br />
&nbsp; &nbsp; ::Telephone<span style="color: #339933;">&#40;</span><span style="color: #ff0000;">&quot;+44 1234 4321&quot;</span><span style="color: #339933;">&#41;</span><span style="color: #000066;">.</span><br />
01 sAccount <span style="color: #008000; font-weight: bold;">type</span> Account <span style="color: #008000; font-weight: bold;">value</span><br />
&nbsp; &nbsp;new <span style="color: #008000; font-weight: bold;">type</span> Account::Name<span style="color: #339933;">&#40;</span><span style="color: #ff0000;">&quot;Mr Smith&quot;</span><span style="color: #339933;">&#41;</span>::<span style="color: #008000; font-weight: bold;">Address</span><span style="color: #339933;">&#40;</span><span style="color: #ff0000;">&quot;Nowhere place&quot;</span><span style="color: #339933;">&#41;</span><br />
&nbsp; &nbsp; &nbsp;::Telephone<span style="color: #339933;">&#40;</span><span style="color: #ff0000;">&quot;+44 1234 4321&quot;</span><span style="color: #339933;">&#41;</span>::Country<span style="color: #339933;">&#40;</span><span style="color: #ff0000;">&quot;Wales&quot;</span><span style="color: #339933;">&#41;</span><span style="color: #000066;">.</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
01 lAccount <span style="color: #008000; font-weight: bold;">type</span> Account<span style="color: #000066;">.</span><br />
<span style="color: #008000; font-weight: bold;">procedure</span> <span style="color: #008000; font-weight: bold;">division</span><span style="color: #000066;">.</span><br />
&nbsp;<span style="color: #008000; font-weight: bold;">invoke</span> accounts::<span style="color: #000000; font-weight: bold;">Add</span><span style="color: #339933;">&#40;</span>jAccount<span style="color: #339933;">&#41;</span><br />
&nbsp;<span style="color: #008000; font-weight: bold;">invoke</span> accounts::<span style="color: #000000; font-weight: bold;">Add</span><span style="color: #339933;">&#40;</span>sAccount<span style="color: #339933;">&#41;</span><br />
&nbsp;<br />
&nbsp;<span style="color: #000000; font-weight: bold;">perform</span> <span style="color: #000000; font-weight: bold;">varying</span> lAccount <span style="color: #008000; font-weight: bold;">through</span> accounts<br />
&nbsp; <span style="color: #000000; font-weight: bold;">display</span> lAccount<br />
&nbsp;<span style="color: #000000; font-weight: bold;">end-perform</span><br />
<br />
&nbsp;<span style="color: #000000; font-weight: bold;">goback</span><span style="color: #000066;">.</span><br />
<span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">program</span><span style="color: #000066;">.</span></div></div>
<p>WIth the class being:</p>
<div class="codecolorer-container cobol blackboard" style="border: 1px solid #9F9F9F;width:435px;"><div class="cobol codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #008000; font-weight: bold;">class-id</span> Account<span style="color: #000066;">.</span><br />
<br />
<span style="color: #008000; font-weight: bold;">working-storage</span> <span style="color: #000080; font-weight: bold;">section</span><span style="color: #000066;">.</span><br />
01 wName &nbsp; &nbsp; &nbsp; <span style="color: #008000; font-weight: bold;">string</span> property <span style="color: #008000; font-weight: bold;">as</span> <span style="color: #ff0000;">&quot;Name&quot;</span><span style="color: #000066;">.</span><br />
01 wAddres &nbsp; &nbsp; <span style="color: #008000; font-weight: bold;">string</span> property <span style="color: #008000; font-weight: bold;">as</span> <span style="color: #ff0000;">&quot;Address&quot;</span><span style="color: #000066;">.</span><br />
01 wCountry &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">string</span> property <span style="color: #008000; font-weight: bold;">as</span> <span style="color: #ff0000;">&quot;Country&quot;</span><span style="color: #000066;">.</span><br />
01 wTelephone &nbsp;<span style="color: #008000; font-weight: bold;">string</span> property <span style="color: #008000; font-weight: bold;">as</span> <span style="color: #ff0000;">&quot;Telephone&quot;</span><span style="color: #000066;">.</span><br />
01 wEmail &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">string</span> property <span style="color: #008000; font-weight: bold;">as</span> <span style="color: #ff0000;">&quot;Email&quot;</span><span style="color: #000066;">.</span><br />
<br />
<span style="color: #008000; font-weight: bold;">method-id</span> New<span style="color: #000066;">.</span><br />
<span style="color: #008000; font-weight: bold;">local-storage</span> <span style="color: #000080; font-weight: bold;">section</span><span style="color: #000066;">.</span><br />
<span style="color: #008000; font-weight: bold;">procedure</span> <span style="color: #008000; font-weight: bold;">division</span><span style="color: #000066;">.</span><br />
&nbsp; <span style="color: #008000; font-weight: bold;">set</span> wCountry <span style="color: #000000; font-weight: bold;">to</span> <span style="color: #008000; font-weight: bold;">type</span> System<span style="color: #000066;">.</span>Globalization<span style="color: #000066;">.</span>RegionInfo::CurrentRegion::DisplayName<br />
<span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">method</span><span style="color: #000066;">.</span><br />
<br />
<span style="color: #008000; font-weight: bold;">method-id</span> Name public<span style="color: #000066;">.</span><br />
<span style="color: #008000; font-weight: bold;">procedure</span> <span style="color: #008000; font-weight: bold;">division</span> <span style="color: #008000; font-weight: bold;">using</span> uName <span style="color: #008000; font-weight: bold;">as</span> <span style="color: #008000; font-weight: bold;">string</span><br />
&nbsp;<span style="color: #000000; font-weight: bold;">returning</span> ret <span style="color: #008000; font-weight: bold;">as</span> <span style="color: #008000; font-weight: bold;">type</span> Account<span style="color: #000066;">.</span><br />
&nbsp; <span style="color: #008000; font-weight: bold;">set</span> self::Name <span style="color: #000000; font-weight: bold;">to</span> uName<br />
&nbsp; <span style="color: #008000; font-weight: bold;">set</span> ret <span style="color: #000000; font-weight: bold;">to</span> self<br />
<span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">method</span><span style="color: #000066;">.</span><br />
<br />
<span style="color: #008000; font-weight: bold;">method-id</span> <span style="color: #008000; font-weight: bold;">Address</span> public<span style="color: #000066;">.</span><br />
<span style="color: #008000; font-weight: bold;">procedure</span> <span style="color: #008000; font-weight: bold;">division</span> <span style="color: #008000; font-weight: bold;">using</span> uAddress <span style="color: #008000; font-weight: bold;">as</span> <span style="color: #008000; font-weight: bold;">string</span><br />
&nbsp;<span style="color: #000000; font-weight: bold;">returning</span> ret <span style="color: #008000; font-weight: bold;">as</span> <span style="color: #008000; font-weight: bold;">type</span> Account<span style="color: #000066;">.</span><br />
&nbsp; <span style="color: #008000; font-weight: bold;">set</span> self::<span style="color: #008000; font-weight: bold;">Address</span> <span style="color: #000000; font-weight: bold;">to</span> uAddress<br />
&nbsp; <span style="color: #008000; font-weight: bold;">set</span> ret <span style="color: #000000; font-weight: bold;">to</span> self<br />
<span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">method</span><span style="color: #000066;">.</span><br />
<br />
<span style="color: #008000; font-weight: bold;">method-id</span> Telephone public<span style="color: #000066;">.</span><br />
<span style="color: #008000; font-weight: bold;">procedure</span> <span style="color: #008000; font-weight: bold;">division</span> <span style="color: #008000; font-weight: bold;">using</span> uTelephone <span style="color: #008000; font-weight: bold;">as</span> <span style="color: #008000; font-weight: bold;">string</span><br />
&nbsp;<span style="color: #000000; font-weight: bold;">returning</span> ret <span style="color: #008000; font-weight: bold;">as</span> <span style="color: #008000; font-weight: bold;">type</span> Account<span style="color: #000066;">.</span><br />
&nbsp; <span style="color: #008000; font-weight: bold;">set</span> self::<span style="color: #008000; font-weight: bold;">Address</span> <span style="color: #000000; font-weight: bold;">to</span> uTelephone<br />
&nbsp; <span style="color: #008000; font-weight: bold;">set</span> ret <span style="color: #000000; font-weight: bold;">to</span> self<br />
<span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">method</span><span style="color: #000066;">.</span><br />
<br />
<span style="color: #008000; font-weight: bold;">method-id</span> Email public<span style="color: #000066;">.</span><br />
<span style="color: #008000; font-weight: bold;">procedure</span> <span style="color: #008000; font-weight: bold;">division</span> <span style="color: #008000; font-weight: bold;">using</span> uEmail <span style="color: #008000; font-weight: bold;">as</span> <span style="color: #008000; font-weight: bold;">string</span><br />
&nbsp;<span style="color: #000000; font-weight: bold;">returning</span> ret <span style="color: #008000; font-weight: bold;">as</span> <span style="color: #008000; font-weight: bold;">type</span> Account<span style="color: #000066;">.</span><br />
&nbsp; <span style="color: #008000; font-weight: bold;">set</span> self::<span style="color: #008000; font-weight: bold;">Address</span> <span style="color: #000000; font-weight: bold;">to</span> uEmail<br />
&nbsp; <span style="color: #008000; font-weight: bold;">set</span> ret <span style="color: #000000; font-weight: bold;">to</span> self<br />
<span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">method</span><span style="color: #000066;">.</span><br />
<br />
<span style="color: #008000; font-weight: bold;">method-id</span> Country public<span style="color: #000066;">.</span><br />
<span style="color: #008000; font-weight: bold;">procedure</span> <span style="color: #008000; font-weight: bold;">division</span> <span style="color: #008000; font-weight: bold;">using</span> uCountry <span style="color: #008000; font-weight: bold;">as</span> <span style="color: #008000; font-weight: bold;">string</span><br />
&nbsp;<span style="color: #000000; font-weight: bold;">returning</span> ret <span style="color: #008000; font-weight: bold;">as</span> <span style="color: #008000; font-weight: bold;">type</span> Account<span style="color: #000066;">.</span><br />
&nbsp; <span style="color: #008000; font-weight: bold;">set</span> self::Country <span style="color: #000000; font-weight: bold;">to</span> uCountry<br />
&nbsp; <span style="color: #008000; font-weight: bold;">set</span> ret <span style="color: #000000; font-weight: bold;">to</span> self<br />
<span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">method</span><span style="color: #000066;">.</span><br />
<br />
<span style="color: #008000; font-weight: bold;">method-id</span> ToString public override<span style="color: #000066;">.</span><br />
<span style="color: #008000; font-weight: bold;">procedure</span> <span style="color: #008000; font-weight: bold;">division</span> <span style="color: #000000; font-weight: bold;">returning</span> ret <span style="color: #008000; font-weight: bold;">as</span> <span style="color: #008000; font-weight: bold;">string</span><span style="color: #000066;">.</span><br />
<span style="color: #008000; font-weight: bold;">set</span> ret <span style="color: #000000; font-weight: bold;">to</span> <span style="color: #008000; font-weight: bold;">String</span>::Format<span style="color: #339933;">&#40;</span><span style="color: #ff0000;">&quot;Name:{0}, Address:{1}, Telephone:{2}, Email:{3}, Country:{4}&quot;</span><span style="color: #000066;">,</span> <br />
&nbsp; &nbsp; &nbsp;self::Name<span style="color: #000066;">,</span> self::<span style="color: #008000; font-weight: bold;">Address</span><span style="color: #000066;">,</span> self::Telephone<span style="color: #000066;">,</span><br />
&nbsp; &nbsp; &nbsp;self::Email<span style="color: #000066;">,</span> self::Country<span style="color: #339933;">&#41;</span><br />
<span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">method</span><span style="color: #000066;">.</span><br />
<span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">class</span><span style="color: #000066;">.</span></div></div>
<p>Which when run with Visual COBOL gives: </p>
<div class="codecolorer-container text blackboard" style="border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Name:Mr Johnson, Address:+44 1234 4321, Telephone:, Email:, Country:United Kingdom<br />
Name:Mr Smith, Address:+44 1234 4321, Telephone:, Email:, Country:Wales</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.gennard.net/blog/2010/05/method-chaining/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Visual COBOL @ Microsoft Teched</title>
		<link>http://www.gennard.net/blog/2010/03/visual-cobol-teched/</link>
		<comments>http://www.gennard.net/blog/2010/03/visual-cobol-teched/#comments</comments>
		<pubDate>Mon, 29 Mar 2010 21:23:17 +0000</pubDate>
		<dc:creator>spgennard</dc:creator>
				<category><![CDATA[COBOL]]></category>
		<category><![CDATA[TechEd]]></category>
		<category><![CDATA[cobol.net]]></category>
		<category><![CDATA[micro focus cobol]]></category>
		<category><![CDATA[Microsoft india 2010]]></category>
		<category><![CDATA[microsoft teched india]]></category>
		<category><![CDATA[microsoft teched india 2010]]></category>
		<category><![CDATA[microsoft teched las vegas]]></category>
		<category><![CDATA[Visual COBOL]]></category>

		<guid isPermaLink="false">http://www.gennard.net/blog/?p=557</guid>
		<description><![CDATA[The last couple of weeks have been very busy and it has unfortunately affected the amount of blog entries I have done but the good news I have plenty of new material.. So, what&#8217;s my excuse.. Well we have been counting down the internal builds of Visual COBOL and we are pretty much ready to [...]]]></description>
			<content:encoded><![CDATA[<p>The last couple of weeks have been very busy and it has unfortunately affected the amount of blog entries I have done but the good news I have plenty of new material..</p>
<p>So, what&#8217;s my excuse.. Well we have been counting down the internal builds of <a href="http://vs2010.microfocus.com/visual-cobol.html">Visual COBOL</a> and we are pretty much ready to ship which is a relief since we are going to launching it at the <i>Microsoft’s Visual Studio launch parties in Las Vegas and TechEd in Bangalore April 12-14</i>.</p>
<p>Personally for me I am quite excited because I will be going to Teched in Bangalore to help show off Visual COBOL.</p>
<p>If would like a look at some of the Visual Studio 2010 integration Micro Focus has is about to release, pop along to <a href="http://www.microsoftteched.in/">http://vs2010.microfocus.com/</a> and see for yourself.   Better still, have a visit to teched <img src='http://www.gennard.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>I will finish the silly little blog with a link to a demo of Visual COBOL.  Just because I&#8217;m proud of it&#8230;</p>
<p><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/-1Pi0rxjk3Y&#038;hl=en_US&#038;fs=1&#038;color1=0x3a3a3a&#038;color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/-1Pi0rxjk3Y&#038;hl=en_US&#038;fs=1&#038;color1=0x3a3a3a&#038;color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></p>
<p>ref: <a href="http://www.microsoftteched.in/">http://www.microsoftteched.in/</a><br />
 and <a href="http://www.microsoft.com/visualstudio/en-gb/products/2010/default.mspx">http://www.microsoft.com/visualstudio/en-gb/products/2010/default.mspx</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gennard.net/blog/2010/03/visual-cobol-teched/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reflection and COBOL</title>
		<link>http://www.gennard.net/blog/2010/02/cobol-dotnet-reflection/</link>
		<comments>http://www.gennard.net/blog/2010/02/cobol-dotnet-reflection/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 22:56:01 +0000</pubDate>
		<dc:creator>spgennard</dc:creator>
				<category><![CDATA[CLR]]></category>
		<category><![CDATA[COBOL]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[cobol.net]]></category>
		<category><![CDATA[managed cobol]]></category>
		<category><![CDATA[reflection]]></category>

		<guid isPermaLink="false">http://www.gennard.net/blog/?p=525</guid>
		<description><![CDATA[For the last couple of months I have working on Visual Studio 2010 and this include Microsoft CLR v4 and I was recently asked how to write a test that determines at runtime which CLR is being used and what assemblies it uses. I replies would use reflection. So I dropped my friend a mega [...]]]></description>
			<content:encoded><![CDATA[<p>For the last couple of months I have working on Visual Studio 2010 and this include Microsoft CLR v4 and I was recently asked how to write a test that determines at runtime which CLR is being used and what assemblies it uses.   I replies would use reflection.   So I dropped my friend a mega simple demo&#8230; and here it is.</p>
<div class="codecolorer-container cobol blackboard" style="border: 1px solid #9F9F9F;width:435px;"><div class="cobol codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #a0a0a0; font-style: italic;">$set ilusing&quot;System.Reflection&quot;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; 01 myAssembly <span style="color: #008000; font-weight: bold;">type</span> <span style="color: #ff0000;">&quot;Assembly&quot;</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; 01 usedAssemblyName <span style="color: #008000; font-weight: bold;">type</span> <span style="color: #ff0000;">&quot;AssemblyName&quot;</span><span style="color: #000066;">.</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000; font-weight: bold;">set</span> myAssembly <span style="color: #000000; font-weight: bold;">to</span> <span style="color: #008000; font-weight: bold;">type</span> <span style="color: #ff0000;">&quot;Assembly&quot;</span>::<span style="color: #ff0000;">&quot;GetExecutingAssembly&quot;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span> <span style="color: #ff0000;">&quot;My exe is &quot;</span> myAssembly::<span style="color: #ff0000;">&quot;FullName&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span> <span style="color: #ff0000;">&quot;and is using CLR &quot;</span> myAssembly::<span style="color: #ff0000;">&quot;ImageRuntimeVersion&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span> <span style="color: #ff0000;">&quot;and is loaded from &quot;</span> myAssembly::<span style="color: #ff0000;">&quot;Location&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span> <span style="color: #ff0000;">&quot;the initial method of this program was &quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; myAssembly::<span style="color: #ff0000;">&quot;EntryPoint&quot;</span>::<span style="color: #ff0000;">&quot;Name&quot;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span> <span style="color: #ff0000;">&quot;This assembly references -&gt; &quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">perform</span> <span style="color: #000000; font-weight: bold;">varying</span> usedAssemblyName<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">through</span> myAssembly::<span style="color: #ff0000;">&quot;GetReferencedAssemblies&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">display</span> <span style="color: #ff0000;">&quot;-&gt; &quot;</span> usedAssemblyName<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">end-perform</span></div></div>
<p>And the output of the program is: </p>
<div class="codecolorer-container text blackboard" style="border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">My exe is clrver, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null<br />
and is using CLR v2.0.50727<br />
and is loaded from d:\clrver.exe<br />
the initial method of this program was _MF_ENTRYThis assembly references -&gt; <br />
-&gt; mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089<br />
-&gt; MicroFocus.COBOL.Runtime, Version=3.6.0.0, Culture=neutral, <br />
PublicKeyToken=0412c5e0b2aaa8f0</div></div>
]]></content:encoded>
			<wfw:commentRss>http://www.gennard.net/blog/2010/02/cobol-dotnet-reflection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A Comparison Of .Net COBOL, Visual Basic and C#</title>
		<link>http://www.gennard.net/blog/2009/12/cobol-vb-csharp-compared/</link>
		<comments>http://www.gennard.net/blog/2009/12/cobol-vb-csharp-compared/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 12:35:44 +0000</pubDate>
		<dc:creator>spgennard</dc:creator>
				<category><![CDATA[COBOL]]></category>
		<category><![CDATA[CSharp]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[VB.Net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[cobol.net]]></category>
		<category><![CDATA[vb]]></category>

		<guid isPermaLink="false">http://www.gennard.net/blog/?p=382</guid>
		<description><![CDATA[Today my collegues Robert and Alex have finally decided to publish a document that compares Visual Basic, C# and COBOL for .Net under The Creative Commons Attribution-ShareAlike 2.5 License. Rather than doing a cut-paste job, here is a quote from alex, along with a link to the &#8220;real&#8221; article itself. Enjoy. Alex Turner said: A [...]]]></description>
			<content:encoded><![CDATA[<p>Today my collegues Robert and Alex have finally <img src='http://www.gennard.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  decided to publish a document that compares Visual Basic, C# and COBOL for .Net under <a href="http://creativecommons.org/licenses/by-sa/2.5/">The Creative Commons Attribution-ShareAlike 2.5 License</a>.</p>
<p>Rather than doing a cut-paste job, here is a quote from alex, along with a link to the &#8220;real&#8221; article itself.</p>
<p>Enjoy.</p>
<blockquote>
<p>Alex Turner said:</p>
<p><strong><em>A Comparison Of .Net COBOL, Visual Basic and C#</em></strong></p>
<p><strong>Introduction</strong></p>
<p>If you are a COBOL programmer wanting to learn C# or a VB programmer wanting to learn COBOL as a .net language (or any other combination of VB.net, C# and COBOL) then this is a good place to start. </p>
<p><strong>Background</strong></p>
<p>If you are a COBOL programmer wanting to learn C# or a VB programmer wanting to learn COBOL as a .net language (or any other combination of VB.net, C# and COBOL) then this is a good place to start.</p>
<p>It has often been noted that the richness of the COBOL language in its Micro Focus .net implementation is not well known. Robert Sales and I have worked on this document to help bring the language to peoples&#8217; attention and to help people who need to work with COBOL on the .net platform.</p>
<p><a href="http://www.codeproject.com/KB/net-languages/COBOLvsVBvsCSharp.aspx">Click here to continue reading the rest of the article&#8230;</a></p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.gennard.net/blog/2009/12/cobol-vb-csharp-compared/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Free compiler for non-commercial use.</title>
		<link>http://www.gennard.net/blog/2009/12/free-compiler-for-non-commercial-use/</link>
		<comments>http://www.gennard.net/blog/2009/12/free-compiler-for-non-commercial-use/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 08:38:25 +0000</pubDate>
		<dc:creator>spgennard</dc:creator>
				<category><![CDATA[COBOL]]></category>
		<category><![CDATA[cobol.net]]></category>
		<category><![CDATA[free]]></category>
		<category><![CDATA[non-commercial]]></category>
		<category><![CDATA[visualstudio]]></category>

		<guid isPermaLink="false">http://www.gennard.net/blog/?p=372</guid>
		<description><![CDATA[If you are interested in trying out some of my examples with a modern COBOL compiler.. let me give you a quote from a friend. From: Twitter &#8220;]]></description>
			<content:encoded><![CDATA[<p>If you are interested in trying out some of my examples with a modern COBOL compiler.. let me give you a quote from a friend.</p>
<blockquote><p>From: Twitter &#8220;<a href="http://twitter.com/scotnielsen/"scot nielsen">Scot Nielsen</a> said: Micro Focus COBOL for .NET and Visual Studio available here FREE for non-commercial.
</p></blockquote>
<p>The development environment/compiler can be downloaded from the <a href="http://www.microfocus.com/Resources/Communities/Academic/shop/">Micro Focus Shop</a>.</p>
<p>More information can be picked up from the <a href="http://visualstudiogallery.msdn.microsoft.com/de-de/326d29fe-24b6-43ee-b453-bfe9572ce10b">Microsoft Visual Studio Gallery</a></p></p>
]]></content:encoded>
			<wfw:commentRss>http://www.gennard.net/blog/2009/12/free-compiler-for-non-commercial-use/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Factory Method Pattern in COBOL</title>
		<link>http://www.gennard.net/blog/2009/12/factory-method-pattern-in-cobol/</link>
		<comments>http://www.gennard.net/blog/2009/12/factory-method-pattern-in-cobol/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 20:49:24 +0000</pubDate>
		<dc:creator>spgennard</dc:creator>
				<category><![CDATA[CLR]]></category>
		<category><![CDATA[COBOL]]></category>
		<category><![CDATA[cobol.net]]></category>
		<category><![CDATA[factorypattern]]></category>

		<guid isPermaLink="false">http://www.gennard.net/blog/?p=363</guid>
		<description><![CDATA[Continuing my series on design patterns for the COBOL, the next one on my list is the &#8220;Factory method&#8221; pattern. The pattern is useful, as it helps you hide the real implementation/creation mechanism of your classes. I you are fond of uml&#8230; here is the actual uml (from wikipedia). Factory Method Pattern from Wikipedia! So&#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>Continuing my series on design patterns for the COBOL, the next one on my list is the &#8220;Factory method&#8221; pattern.</p>
<p>The pattern is useful, as it helps you hide the real implementation/creation mechanism of your classes.   I you are fond of uml&#8230; here is the actual uml (from wikipedia).</p>
<p><img src="http://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/FactoryMethod.svg/500px-FactoryMethod.svg.png" /></p>
<p><a href="http://en.wikipedia.org/wiki/Factory_method_pattern">Factory Method Pattern</a> from Wikipedia!</p>
<p>So&#8230; lets see the COBOL code&#8230;</p>
<div class="codecolorer-container cobol blackboard" style="border: 1px solid #9F9F9F;width:435px;"><div class="cobol codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp; &nbsp; &nbsp; &nbsp;interface-id<span style="color: #000066;">.</span> <span style="color: #ff0000;">&quot;Base&quot;</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">method-id</span><span style="color: #000066;">.</span> <span style="color: #ff0000;">&quot;DoIt&quot;</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">method</span> <span style="color: #ff0000;">&quot;DoIt&quot;</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">end</span> interface <span style="color: #ff0000;">&quot;Base&quot;</span><span style="color: #000066;">.</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">class-id</span><span style="color: #000066;">.</span> <span style="color: #ff0000;">&quot;Derived1Impl&quot;</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">object</span><span style="color: #000066;">.</span> implements <span style="color: #008000; font-weight: bold;">type</span> <span style="color: #ff0000;">&quot;Base&quot;</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000; font-weight: bold;">method-id</span><span style="color: #000066;">.</span> <span style="color: #ff0000;">&quot;DoIt&quot;</span> public<span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">display</span> <span style="color: #ff0000;">&quot;Derived1Impl from DoIt&quot;</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">method</span> <span style="color: #ff0000;">&quot;DoIt&quot;</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">object</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">class</span> <span style="color: #ff0000;">&quot;Derived1Impl&quot;</span><span style="color: #000066;">.</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">class-id</span><span style="color: #000066;">.</span> <span style="color: #ff0000;">&quot;Derived2Impl&quot;</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">object</span><span style="color: #000066;">.</span> implements <span style="color: #008000; font-weight: bold;">type</span> <span style="color: #ff0000;">&quot;Base&quot;</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000; font-weight: bold;">method-id</span><span style="color: #000066;">.</span> <span style="color: #ff0000;">&quot;DoIt&quot;</span> public<span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">display</span> <span style="color: #ff0000;">&quot;Derived2Impl from DoIt&quot;</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">method</span> <span style="color: #ff0000;">&quot;DoIt&quot;</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">object</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">class</span> <span style="color: #ff0000;">&quot;Derived2Impl&quot;</span><span style="color: #000066;">.</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">class-id</span><span style="color: #000066;">.</span> <span style="color: #ff0000;">&quot;Factory&quot;</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">object</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">method-id</span><span style="color: #000066;">.</span> <span style="color: #ff0000;">&quot;GetObject&quot;</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">linkage</span> <span style="color: #000080; font-weight: bold;">section</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;01 obj-base <span style="color: #008000; font-weight: bold;">type</span> <span style="color: #ff0000;">&quot;Base&quot;</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">procedure</span> <span style="color: #008000; font-weight: bold;">division</span> <span style="color: #008000; font-weight: bold;">using</span> <span style="color: #008000; font-weight: bold;">by</span> <span style="color: #008000; font-weight: bold;">value</span> oType <span style="color: #008000; font-weight: bold;">as</span> binary-long<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">returning</span> obj-base<span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">evaluate</span> oType<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000; font-weight: bold;">when</span> 1 <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">set</span> obj-base <span style="color: #000000; font-weight: bold;">to</span> new <span style="color: #008000; font-weight: bold;">type</span> <span style="color: #ff0000;">&quot;Derived1Impl&quot;</span><span style="color: #339933;">&#40;</span><span style="color: #339933;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000; font-weight: bold;">when</span> 2 <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">set</span> obj-base <span style="color: #000000; font-weight: bold;">to</span> new <span style="color: #008000; font-weight: bold;">type</span> <span style="color: #ff0000;">&quot;Derived2Impl&quot;</span><span style="color: #339933;">&#40;</span><span style="color: #339933;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000; font-weight: bold;">when</span> <span style="color: #008000; font-weight: bold;">other</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">set</span> obj-base <span style="color: #000000; font-weight: bold;">to</span> <span style="color: #008000; font-weight: bold;">null</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">method</span> <span style="color: #ff0000;">&quot;GetObject&quot;</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">object</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">class</span> <span style="color: #ff0000;">&quot;Factory&quot;</span><span style="color: #000066;">.</span><br />
<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">class-id</span><span style="color: #000066;">.</span> <span style="color: #ff0000;">&quot;FactoryDemo&quot;</span><span style="color: #000066;">.</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">method-id</span><span style="color: #000066;">.</span> <span style="color: #ff0000;">&quot;Main&quot;</span> <span style="color: #008000; font-weight: bold;">static</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">local-storage</span> <span style="color: #000080; font-weight: bold;">section</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;01 obj-factory <span style="color: #008000; font-weight: bold;">type</span> <span style="color: #ff0000;">&quot;Factory&quot;</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;01 base-obj <span style="color: #008000; font-weight: bold;">type</span> <span style="color: #ff0000;">&quot;Base&quot;</span><span style="color: #000066;">.</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">linkage</span> <span style="color: #000080; font-weight: bold;">section</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;01 args <span style="color: #008000; font-weight: bold;">string</span> <span style="color: #008000; font-weight: bold;">occurs</span> <span style="color: #008000; font-weight: bold;">any</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">procedure</span> <span style="color: #008000; font-weight: bold;">division</span> <span style="color: #008000; font-weight: bold;">using</span> <span style="color: #008000; font-weight: bold;">by</span> <span style="color: #008000; font-weight: bold;">value</span> args<span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000; font-weight: bold;">set</span> obj-factory <span style="color: #000000; font-weight: bold;">to</span> new <span style="color: #008000; font-weight: bold;">type</span> <span style="color: #ff0000;">&quot;Factory&quot;</span><span style="color: #339933;">&#40;</span><span style="color: #339933;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000; font-weight: bold;">set</span> base-obj <span style="color: #000000; font-weight: bold;">to</span> obj-factory::<span style="color: #ff0000;">&quot;GetObject&quot;</span><span style="color: #339933;">&#40;</span>1<span style="color: #339933;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000; font-weight: bold;">invoke</span> base-obj::<span style="color: #ff0000;">&quot;DoIt&quot;</span><span style="color: #339933;">&#40;</span><span style="color: #339933;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000; font-weight: bold;">set</span> base-obj <span style="color: #000000; font-weight: bold;">to</span> obj-factory::<span style="color: #ff0000;">&quot;GetObject&quot;</span><span style="color: #339933;">&#40;</span>2<span style="color: #339933;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #008000; font-weight: bold;">invoke</span> base-obj::<span style="color: #ff0000;">&quot;DoIt&quot;</span><span style="color: #339933;">&#40;</span><span style="color: #339933;">&#41;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">method</span> <span style="color: #ff0000;">&quot;Main&quot;</span><span style="color: #000066;">.</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #008000; font-weight: bold;">end</span> <span style="color: #008000; font-weight: bold;">class</span> <span style="color: #ff0000;">&quot;FactoryDemo&quot;</span><span style="color: #000066;">.</span></div></div>
<p>That was pretty straight forward&#8230; not too much pain&#8230;</p>
<p>And finally the code produces&#8230;</p>
<div class="codecolorer-container text blackboard" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">d:\&gt; FactoryDemo.exe<br />
Derived1Impl from DoIt<br />
Derived2Impl from DoIt<br />
Hello world</div></div>
<p>Time to sign off for today.. but if you would like me to continue the series on code patterns or have a particular pattern you need&#8230; drop us a line!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gennard.net/blog/2009/12/factory-method-pattern-in-cobol/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
