<?xml version="1.0" encoding="utf-8"?>

			<rss version="2.0" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://web.resource.org/cc/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">

			<channel>
			<title>Brian Kotek: Inversion of Control - CFC Stub Generator</title>
			<link>http://www.briankotek.com/blog/index.cfm</link>
			<description>Brian Kotek on ExtJS, DeftJS, CoffeeScript, Java, Groovy, Grails, Design Patterns, and Object-Oriented Programming</description>
			<language>en-us</language>
			<pubDate>Sat, 25 May 2013 21:07:18 -0700</pubDate>
			<lastBuildDate>Sat, 03 May 2008 14:48:00 -0700</lastBuildDate>
			<generator>BlogCFC</generator>
			<docs>http://blogs.law.harvard.edu/tech/rss</docs>
			<managingEditor>brian428@briankotek.com</managingEditor>
			<webMaster>brian428@briankotek.com</webMaster>
			<itunes:subtitle></itunes:subtitle>
			<itunes:summary></itunes:summary>
			<itunes:category text="Technology" />
			<itunes:category text="Technology">
				<itunes:category text="Podcasting" />
			</itunes:category>
			<itunes:category text="Technology">
				<itunes:category text="Tech News" />
			</itunes:category>
			<itunes:keywords></itunes:keywords>
			<itunes:author></itunes:author>
			<itunes:owner>
				<itunes:email>brian428@briankotek.com</itunes:email>
				<itunes:name></itunes:name>
			</itunes:owner>
			
			<itunes:explicit>no</itunes:explicit>
			
			
			
			
			
			<item>
				<title>Slides and Code from My Code Generation Presentation</title>
				<link>http://www.briankotek.com/blog/index.cfm/2008/5/3/Presentation-and-Code-from-My-Code-Generation-Presentation</link>
				<description>
				
				As promised, here are the slides and code from my cf.Objective() 2008 presentation, &quot;Leveraging Code Generation to Jumpstart Your Development&quot;. Check the bottom of this entry for the enclosure.

So far the conference has been great. I&apos;ve learned a lot at several sessions, including Andrew Powell&apos;s integration presentation on using Spring and Hibernate as the Java model for an app using CF for Controller and View. Chris Scott&apos;s ColdSpring presentation got my wheels turning with regard to custom Proxy Factories. And the announcement of the ColdFusion Open Initiative was most welcome, with a public bug base and more organized enhancement request system.

I&apos;ll post more after the conference is over, but so far it&apos;s been as good as I expected it to be!
				
				</description>
				
				
				<category>Development</category>
				
				<category>Transfer</category>
				
				<category>ColdFusion</category>
				
				<category>CFC Stub Generator</category>
				
				<category>Conferences</category>
				
				<category>ColdSpring</category>
				
				<category>Reactor</category>
				
				<pubDate>Sat, 03 May 2008 14:48:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2008/5/3/Presentation-and-Code-from-My-Code-Generation-Presentation</guid>
				
				
				<enclosure url="http://www.briankotek.com/blog/enclosures/brian_kotek_cfobjective08_code_gen.zip" length="367243" type="application/zip"/>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>cf.Objective() 2008 Presenation on Code Generation</title>
				<link>http://www.briankotek.com/blog/index.cfm/2007/12/20/cfObjective-2008-Presenation-on-Code-Generation</link>
				<description>
				
				I&apos;ve also been tapped to present at the &lt;a href=&quot;http://www.cfobjective.com/&quot; target=&quot;_blank&quot;&gt;2008 cf.Objective() conference&lt;/a&gt;. My session is called &quot;Leveraging Code Generation to Jumpstart Your Development&quot;.

There are two kinds of coding: fun and boring. We all want to focus on the fun kind, but unfortunately the boring, repetitive kind also has to get done. Luckily, a lot of the boring coding can be generated for us! 

The underlying concepts of code generation will be discussed. This will include active and passive generation, along with the benefits and drawbacks of each approach.

I&apos;ll also look at using code generation to help you get to the fun stuff more quickly. Topics will touch on the full range of available code generation techniques, including CFEclipse Snippets, ANT build files, scaffolding, ORM frameworks, the Illudium PU-36 generator from Brian Rinaldi, and my UML to CFC Stub Generator. I hope to see you there!
				
				</description>
				
				
				<category>ColdFusion</category>
				
				<category>CFC Stub Generator</category>
				
				<category>Conferences</category>
				
				<pubDate>Thu, 20 Dec 2007 13:52:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2007/12/20/cfObjective-2008-Presenation-on-Code-Generation</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>ColdMock and CFC Stub Generator Updates</title>
				<link>http://www.briankotek.com/blog/index.cfm/2007/11/14/ColdMock-and-CFC-Stub-Generator-Updates</link>
				<description>
				
				Just a quick note about some updates to the RIAForge projects for &lt;a href=&quot;http://coldmock.riaforge.org/&quot; target=&quot;_blank&quot;&gt;ColdMock&lt;/a&gt; and the &lt;a href=&quot;http://cfcstub.riaforge.org/&quot; target=&quot;_blank&quot;&gt;CFC Stub Generator&lt;/a&gt;.

ColdMock had an issue when trying to mock a method that was defined in a superclass of the target object. This has been corrected. It will also validate arrays of components as return types (i.e. User[]) (thanks to Jo&#xe3;o Fernandes for contributing this fix).

The CFC Stub Generator has some significant additions as well. The tool now supports generating private and public properties if you define these in the UML. Public properties are set in the THIS scope, and associated cfproperty tags are created. 

The tool also supports existing CFCs now. It will not overwrite existing components, but will still generate the other files (unit tests, ColdSpring, etc.). This will allow you to quickly generate unit tests for an existing set of components by spec&apos;ing them out in UML.

You can also set up alternate package hierarchies in the tool to define paths to CFCs that are outside of your project (for example, Transfer), and mark a CFC as &quot;active&quot; in the UML tool to instruct the generator to use this path as opposed to the root path you defined for your main project. You must set up the alternate package path and set the base package for the alternate packages as &quot;root&quot; in the UML tool. In this way, the generator will know the proper paths to the external components for typing and ColdSpring path creation. Examples of this setup are included in the bookstore2.zuml/bookstore2.xmi files.

Finally, the tool now has an option to use ColdMock instead of generating staic mock CFC files, and configure the unit tests and the generated ColdSpring file to use the MockFactory to use in the unit tests (requires ColdMock and CF8).
				
				</description>
				
				
				<category>ColdFusion</category>
				
				<category>CFC Stub Generator</category>
				
				<category>Unit Testing</category>
				
				<category>OOP CF</category>
				
				<category>ColdMock</category>
				
				<pubDate>Wed, 14 Nov 2007 12:01:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2007/11/14/ColdMock-and-CFC-Stub-Generator-Updates</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>CFC Stub Generator Now Defines ColdSpring Bean Dependencies</title>
				<link>http://www.briankotek.com/blog/index.cfm/2007/7/24/CFC-Stub-Generator-Now-Defines-ColdSpring-Bean-Dependencies</link>
				<description>
				
				I made a quick update to the CFC Stub Generator to support creating the proper dependencies in the ColdSpring XML file that it generates. This will only work when using a UML XMI file as the generation source. When you define an aggregation or composition relationship in the UML, the generator knows about these relationships and creates the ColdSpring XML accordingly. So, if you have a UML diagram like this:

&lt;img src=&quot;http://www.briankotek.com/blog/images//bookstore_with_aggregation.gif&quot;&gt;

The ColdSpring XML that gets generated would look like this:

&lt;code&gt;
&lt;!DOCTYPE beans PUBLIC &quot;-//SPRING//DTD BEAN//EN&quot; &quot;http://www.springframework.org/dtd/spring-beans.dtd&quot;&gt;

&lt;beans&gt;	
	
	&lt;bean id=&quot;Config&quot; class=&quot;bookstore.components.beans.Config&quot; /&gt;		
	&lt;bean id=&quot;MockConfig&quot; class=&quot;bookstore.components.beans.mock.MockConfig&quot; /&gt;
	&lt;bean id=&quot;AbstractService&quot; class=&quot;bookstore.components.services.AbstractService&quot;&gt;
		&lt;property name=&quot;Config&quot;&gt;	
			&lt;ref bean=&quot;Config&quot; /&gt;
		&lt;/property&gt;
		&lt;property name=&quot;SessionFacade&quot;&gt;	
			&lt;ref bean=&quot;SessionFacade&quot; /&gt;
		&lt;/property&gt;
	&lt;/bean&gt;		
	&lt;bean id=&quot;MockAbstractService&quot; class=&quot;bookstore.components.services.mock.MockAbstractService&quot; /&gt;
	&lt;bean id=&quot;StoreService&quot; class=&quot;bookstore.components.services.StoreService&quot;&gt;
		&lt;property name=&quot;StoreFactory&quot;&gt;	
			&lt;ref bean=&quot;StoreFactory&quot; /&gt;
		&lt;/property&gt;
	&lt;/bean&gt;		
	&lt;bean id=&quot;MockStoreService&quot; class=&quot;bookstore.components.services.mock.MockStoreService&quot; /&gt;
	&lt;bean id=&quot;StoreFactory&quot; class=&quot;bookstore.components.factories.StoreFactory&quot; /&gt;		
	&lt;bean id=&quot;MockStoreFactory&quot; class=&quot;bookstore.components.factories.mock.MockStoreFactory&quot; /&gt;
	&lt;bean id=&quot;Membership&quot; class=&quot;bookstore.components.businessobjects.Membership&quot; /&gt;		
	&lt;bean id=&quot;MockMembership&quot; class=&quot;bookstore.components.businessobjects.mock.MockMembership&quot; /&gt;
	&lt;bean id=&quot;Product&quot; class=&quot;bookstore.components.businessobjects.Product&quot; /&gt;		
	&lt;bean id=&quot;MockProduct&quot; class=&quot;bookstore.components.businessobjects.mock.MockProduct&quot; /&gt;
	&lt;bean id=&quot;SessionFacade&quot; class=&quot;bookstore.components.facades.SessionFacade&quot; /&gt;		
	&lt;bean id=&quot;MockSessionFacade&quot; class=&quot;bookstore.components.facades.mock.MockSessionFacade&quot; /&gt;
	
&lt;/beans&gt;
&lt;/code&gt;

As you can see, the bean dependencies that are created in the ColdSpring XML match the aggregation relationships defined in the UML. This is pretty handy if you plan to copy the ColdSpring XML that is used by the generated test suite in your real application. It also makes it easy to modify this XML to pass Mock objects into your components when creating your tests.
				
				</description>
				
				
				<category>ColdFusion</category>
				
				<category>CFC Stub Generator</category>
				
				<category>OOP CF</category>
				
				<category>ColdSpring</category>
				
				<pubDate>Tue, 24 Jul 2007 13:56:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2007/7/24/CFC-Stub-Generator-Now-Defines-ColdSpring-Bean-Dependencies</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>CFC Generator 1.6 With A Few UML Generation Enhancements</title>
				<link>http://www.briankotek.com/blog/index.cfm/2007/6/25/CFC-Generator-16-With-A-Few-UML-Generation-Enhancements</link>
				<description>
				
				I&apos;ve updated the &lt;a href=&quot;http://cfcstub.riaforge.org/&quot; target=&quot;_blank&quot;&gt;CFC Stub Generator RIAForge Project&lt;/a&gt; with a few new items:

&lt;ul&gt;
&lt;li&gt;A few bugs and typos were fixed.&lt;/li&gt;
&lt;li&gt;Added an option from Nat Papovich regarding the documentation tab from Poseidon. Any text included in the Poseidon &apos;documentation&apos; tab for that method will either be inserted into the &apos;hint&apos; attribute of the CFFUNCTION tag, OR be placed into the body of the CFFUNCTION tag set as a CFML comment. This option is set on the Stub Generator configuration screen.&lt;/li&gt;
&lt;li&gt;Strip HTML from Documenation: This option can be turned off or on in the Configuration Options screen. Since the Poseidon documentation tab is a rich text editor, HTML markup can end up in your generated hints or CFML comments. Some people like to have HTML in their hints to make viewing it in the Component Browsers more readable so I left this in as an option.&lt;/li&gt;
&lt;li&gt;Getter and Setter Generation: This option can be turned off or on in the Configuration Options screen. If a method starts with &quot;get&quot;, the generator will add in code to return an instance variable with the name of the method. i.e., if you have a UML method called &quot;getName&quot;, the generator will add the code 

&lt;code&gt;&lt;cfreturn variables.instance.name /&gt;&lt;/code&gt;
 

Along the same line, if a method starts with &quot;set&quot; and has one argument, the generator will add in code to set the variable. i.e., if you have a UML method called &quot;setName&quot; with a single argument called &quot;name&quot;, the generator will add the code 

&lt;code&gt;&lt;cfset variables.instance.name = arguments.name /&gt;&lt;/code&gt; 

I realize this won&apos;t always be correct, but I figured it wouldn&apos;t hurt much since it does eliminate a lot of mundane typing and if it incorrectly adds code for a method that you didn&apos;t really mean to be a getter or setter, it&apos;s very easy to delete that code. This option can be turned off or on in the Configuration Options screen.&lt;/li&gt;
&lt;li&gt;Composition and Aggregation: The tool does detect aggregation or composition between components and inserts a custom attribute to the CFCOMPONENT tag called &quot;aggregates&quot; and lists aggregated components in a comma-delimited list. This isn&apos;t used by ColdFusion, but in the event that I create a tool that can read CFCs and generate the UML diagram, this attribute would allow the UML to be aware of composition and aggregation in your CFCs. This option can be turned off or on in the Configuration Options screen.&lt;/li&gt;
&lt;li&gt;Readme updated&lt;/li&gt;
&lt;/ul&gt;
				
				</description>
				
				
				<category>CFC Stub Generator</category>
				
				<category>OOP CF</category>
				
				<pubDate>Mon, 25 Jun 2007 08:07:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2007/6/25/CFC-Generator-16-With-A-Few-UML-Generation-Enhancements</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Generate CFCs from UML Using CFC Stub Generator</title>
				<link>http://www.briankotek.com/blog/index.cfm/2007/6/12/Generate-CFCs-from-UML-Using-CFC-Stub-Generator</link>
				<description>
				
				I&apos;ve added the ability to pass an XMI file to CFC Stub Generator (now at version 1.5) and use that to generate the CFCs, unit tests, and associated files. XMI is an XML format that describes UML, and I believe that most UML tools will export this format.

Using UML to define the CFCs gives a great deal more control over what gets generated. I&apos;ve created another Captivate presentation to describe the new capabilities:

&lt;a href=&quot;http://experts.acrobat.com/p54208808/&quot; target=&quot;_blank&quot;&gt;http://experts.acrobat.com/p54208808/&lt;/a&gt;

The files and SVN repository at the &lt;a href=&quot;http://cfcstub.riaforge.org/&quot; target=&quot;_blank&quot;&gt;CFC Stub Generator RIAForge project&lt;/a&gt; have also been updated. You can also get to the RIAForge project download via the link in the right sidebar. The zip and SVN repository now include sample XMI and zuml files to help get you started.

Full details on the improvements:

The Stub Generator can generate components based on an XMI data file. XMI is a standard XML format for describing UML diagrams. I have only tested this with Poseidon UML, but as far as I know any UML tool that can export to XMI should work. Note that the location of the XMI file used in the generation will be used as the base location for the test suite files (the test suite files will be placed in a subdirectory called &apos;testsuite&apos; beneath the folder containing the XMI file).

&lt;ul&gt;
&lt;li&gt;
Built-in ColdFusion data types: The cfctemplate.zuml file already has the necessary data types created to represent most of the built-in ColdFusion data types like query, struct, etc. It also has some Java data types defined since Posiedon will try to create these and they can interfere with the CFC generation. It is crucial that you type all argument and return types using these types, even if you pick the &apos;any&apos; data type.
&lt;/li&gt;
&lt;li&gt;
Packages: Poseidon supports the creation of packages and I suggest using them. The generator will use the package paths for any CFC or interface components and use these when adding argument types, return types, extends, and implements. It also uses the package paths to create the ColdSpring XML, test suites, and ANT build XML files. The package paths are determined relative to the web root. Thus, if you have a package in your UML that resolves to &apos;myapp.components.beans&apos;, the CFCs in that package will be generated to the web root-relative path &apos;/myapp/components/beans&apos;.
&lt;/li&gt;
&lt;li&gt;
CFCs: CFCOMPONENT stubs will be generated for all objects in the UML diagram. The name of each component corresponds to the object name given in the UML diagram. Any text included in the Poseidon &apos;documentation&apos; tab for that object will be inserted into the &apos;hint&apos; attribute of the CFCOMPONENT tag.
&lt;/li&gt;
&lt;li&gt;
CFC Init Methods: Init methods are ignored when generating test methods in the unit test files. Init methods should be given a return type matching the CFC type.
&lt;/li&gt;
&lt;li&gt;
CFC Methods: CFFUNCTION stubs will be generated for all methods in the UML diagram. The &apos;returnType&apos; attribute will be populated with the return type specified in the UML diagram (including concrete CFCs, abstract CFCs, or interfaces). Any text included in the Poseidon &apos;documentation&apos; tab for that method will be inserted into the &apos;hint&apos; attribute of the CFFUNCTION tag.
&lt;/li&gt;
&lt;li&gt;
CFC Method Arguments: CFARGUMENT tags will be generated for all method parameters specified in the UML diagram (including concrete CFCs, abstract CFCs, or interfaces). Any text included in the Poseidon &apos;documentation&apos; tab for that parameter will be inserted into the &apos;hint&apos; attribute of the CFARGUMENT tag.
&lt;/li&gt;
&lt;li&gt;
Abstract Methods: Abstract methods are generated with a body containing a CFTHROW tag which specifies that the method is abstract and must be overridden by a subclass. Also, abstract methods are ignored when generating test methods in the unit test files.
&lt;/li&gt;
&lt;li&gt;
Inheritance: Inheritance is included in the generated CFCs by applying the &apos;extends&apos; attribute of CFCOMPONENT or CFINTERFACE.
&lt;/li&gt;
&lt;li&gt;
Interfaces: If you incorporate interfaces in your UML, CFINTERFACE files will be created for each interface. If an object in your UML implements one or more interfaces, those interfaces will be added to the &apos;implements&apos; attribute of the generated CFCOMPONENT tag as a comma-delimited list. If an interface extends one or more interfaces, those interfaces wil be added to the &apos;extends&apos; attribute of the generated CFINTERFACE tag as a comma-delimited list. Any text included in the Poseidon &apos;documentation&apos; tab for that interface will be inserted into the &apos;hint&apos; attribute of the CFINTERFACE tag. Note that as of this writing, interfaces are only supported by ColdFusion 8. 
&lt;/li&gt;
&lt;li&gt;
Composition and Aggregation: The tool does detect aggregation or composition between components, but I was not sure how to actually use this information. This is because any composed objects have to be passed into the object either in the constructor or a setter. I really can&apos;t try to generate these automatically since I would have no way of knowing whether to use constructor or setter injection. If anyone has any ideas on how knowing about composition might be helpful in the generated code please let me know. I suppose I could have it generate a hint or comment in the CFC documenting the relationshipS?
&lt;/li&gt;
&lt;li&gt;
Unit Tests: Unit test methods will be created for any public methods in the corresponding CFCs. Unit test files will be created in a &apos;test&apos; subdirectory of each package, and will contain tests for the CFCs in that package. 
&lt;/li&gt;
&lt;li&gt;
Test Suites: CFCUnit/CFUnit test runners, ColdSpring XML, and ANT build XML files will be created in a &apos;testsuite&apos; subdirectory of the directory where the XMI file used to generate the CFCs was read from.
&lt;/li&gt;
&lt;/ul&gt;
				
				</description>
				
				
				<category>Development</category>
				
				<category>ColdFusion</category>
				
				<category>CFC Stub Generator</category>
				
				<category>OOP CF</category>
				
				<category>ColdSpring</category>
				
				<pubDate>Tue, 12 Jun 2007 00:46:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2007/6/12/Generate-CFCs-from-UML-Using-CFC-Stub-Generator</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>CFC Stub Generator on RIAForge</title>
				<link>http://www.briankotek.com/blog/index.cfm/2007/5/16/CFC-Stub-Generator-on-RIAForge</link>
				<description>
				
				Just a quick follow up post to report that an &lt;a href=&quot;http://cfcstub.riaforge.org/&quot; target=&quot;_blank&quot;&gt;RIAForge project has been created for the CFC Stub Generator&lt;/a&gt;.
				
				</description>
				
				
				<category>ColdFusion</category>
				
				<category>CFC Stub Generator</category>
				
				<pubDate>Wed, 16 May 2007 11:17:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2007/5/16/CFC-Stub-Generator-on-RIAForge</guid>
				
				
			</item>
			
		 	
			
			
			<item>
				<title>Stub Generator for CFCs, Unit Tests, and More</title>
				<link>http://www.briankotek.com/blog/index.cfm/2007/5/16/Stub-Generator-for-CFCs-Unit-Tests-and-More</link>
				<description>
				
				I&apos;ve created a new and much improved CFC Stub Generator and want to see what people think of this idea. It will generate CFCs, unit tests (for CFUnit or CFCUnit), mock objects, test runners, ColdSpring XML, and ANT unit test build XML files from a simple text file.

You can download the code in the sidebar. I&apos;ve also submitted an RIAForge project for it. To show how it works, I created a &lt;a href=&quot;http://experts.acrobat.com/p61249254/&quot; target=&quot;_blank&quot;&gt;Connect presentation about using the CFC Stub Generator&lt;/a&gt;. Have a look and let me know what you think. Thanks.

(Quick aside since I don&apos;t think I explicitly mentioned it, you can get the CFCUnit facade for the unit testing tab in CFEclipse at &lt;a href=&quot;http://www.corfield.org/blog/index.cfm&quot; target=&quot;_blank&quot;&gt;Sean Corfield&apos;s blog&lt;/a&gt;.)
				
				</description>
				
				
				<category>CFEclipse</category>
				
				<category>Development</category>
				
				<category>ColdFusion</category>
				
				<category>CFC Stub Generator</category>
				
				<category>OOP CF</category>
				
				<category>ColdSpring</category>
				
				<pubDate>Wed, 16 May 2007 08:00:00 -0700</pubDate>
				<guid>http://www.briankotek.com/blog/index.cfm/2007/5/16/Stub-Generator-for-CFCs-Unit-Tests-and-More</guid>
				
				
			</item>
			
		 	
			</channel></rss>