<?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>foomonger&#039;s blog &#187; swiz</title>
	<atom:link href="http://blog.foomonger.com/tag/swiz/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.foomonger.com</link>
	<description>Tips and Musings on Software Development, Flash, and Flex</description>
	<lastBuildDate>Wed, 14 Jul 2010 20:18:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>foomonger-swizframework Updated With Swiz 1.0.0 RC1</title>
		<link>http://blog.foomonger.com/2010/05/23/foomonger-swizframework-updated-with-swiz-1-0-0-rc1/</link>
		<comments>http://blog.foomonger.com/2010/05/23/foomonger-swizframework-updated-with-swiz-1-0-0-rc1/#comments</comments>
		<pubDate>Sun, 23 May 2010 07:26:42 +0000</pubDate>
		<dc:creator>Sam Ahn</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[custom processor]]></category>
		<category><![CDATA[resource manager]]></category>
		<category><![CDATA[signals]]></category>
		<category><![CDATA[swiz]]></category>

		<guid isPermaLink="false">http://blog.foomonger.com/?p=164</guid>
		<description><![CDATA[Swiz 1.0.0 RC1 was recently released so I've updated my custom metadata processors to work with it. Head over to Google Code to check out [MediateSignal] and [Resource]. Happy coding...
]]></description>
			<content:encoded><![CDATA[<p><a href="http://swizframework.jira.com/wiki/display/SWIZ/Home">Swiz 1.0.0 RC1</a> was recently released so I've updated my custom metadata processors to work with it. Head over to <a href="http://code.google.com/p/foomonger-swizframework/">Google Code</a> to check out <a href="http://code.google.com/p/foomonger-swizframework/wiki/MediateSignalProcessor">[MediateSignal]</a> and <a href="http://code.google.com/p/foomonger-swizframework/wiki/ResourceProcessor">[Resource]</a>. Happy coding...</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.foomonger.com%2F2010%2F05%2F23%2Ffoomonger-swizframework-updated-with-swiz-1-0-0-rc1%2F&amp;linkname=foomonger-swizframework%20Updated%20With%20Swiz%201.0.0%20RC1"><img src="http://blog.foomonger.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://blog.foomonger.com/2010/05/23/foomonger-swizframework-updated-with-swiz-1-0-0-rc1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SwizLogger Helpers: SwizLoggerConfig and LoggerProcessor</title>
		<link>http://blog.foomonger.com/2010/03/20/swizlogger-helpers-swizloggerconfig-and-loggerprocessor/</link>
		<comments>http://blog.foomonger.com/2010/03/20/swizlogger-helpers-swizloggerconfig-and-loggerprocessor/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 23:46:56 +0000</pubDate>
		<dc:creator>Sam Ahn</dc:creator>
				<category><![CDATA[flash]]></category>
		<category><![CDATA[flex]]></category>
		<category><![CDATA[custom processor]]></category>
		<category><![CDATA[logging]]></category>
		<category><![CDATA[swiz]]></category>

		<guid isPermaLink="false">http://blog.foomonger.com/?p=142</guid>
		<description><![CDATA[I started using the SwizLogger recently and quickly realized I wanted to do the following:

Create ILogger instances without importing Swiz classes in my application classes
Easily add targets in MXML

#1 isn't a huge deal if you consider logging to be more of a system tool than an application dependency, but if I'm avoiding Singletons why not [...]]]></description>
			<content:encoded><![CDATA[<p>I started using the SwizLogger recently and quickly realized I wanted to do the following:</p>
<ol>
<li>Create ILogger instances without importing Swiz classes in my application classes</li>
<li>Easily add targets in MXML</li>
</ol>
<p>#1 isn't a huge deal if you consider logging to be more of a system tool than an application dependency, but if I'm avoiding Singletons why not keep it up. #2 also isn't a big deal because it doesn't take much ActionScript to add logging targets, but I think it makes a lot of sense to do it declaratively.</p>
<p>Piotr Walczyszyn created a <a title="LogProcessor" href="http://www.riaspace.net/2009/12/logprocessor-custom-metadata-processor-for-swiz-1-0-0/" target="_blank">custom LogProcessor</a> to address #1, but I didn't like how the TraceTarget was hard-coded into it. Instead of building more complex processor I decided to create a bare-bones <a title="LoggerProcessor" href="http://code.google.com/p/foomonger-swizframework/source/browse/trunk/FoomongerSwizFramework/src/com/foomonger/swizframework/processors/LoggerProcessor.as" target="_blank">LoggerProcessor</a> and <a title="SwizLoggerConfig" href="http://code.google.com/p/foomonger-swizframework/source/browse/trunk/FoomongerSwizFramework/src/com/foomonger/swizframework/utils/SwizLoggerConfig.as" target="_blank">SwizLoggerConfig</a> class.</p>
<p>Here's an example application's source (the SWF is just a button):  <a title="SwizLoggerConfigExample" href="http://www.foomonger.com/swizframework/SwizLoggerConfigExample/srcview/" target="_blank">Source</a></p>
<p>The LoggerProcessor is again bare-bones. All it does is inject an ILogger instance using SwizLogger:</p>
<pre class="actionscript"><span style="color: #66cc66;">&#91;</span>Logger<span style="color: #66cc66;">&#93;</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> logger:ILogger;</pre>
<p><br/><br />
The LoggerProcessor priority is set to be one above [Inject] so the injected ILoggers are available at [Inject] and [PostConstruct].</p>
<p>SwizLoggerConfig doesn't do too much either. It's just provides a default public Array property which is used to add targets to the SwizLogger.</p>
<pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;utf-8&quot;</span><span style="font-weight: bold; color: black;">?&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Application</span> <span style="color: #000066;">xmlns:mx</span>=<span style="color: #ff0000;">&quot;http://www.adobe.com/2006/mxml&quot;</span>
        <span style="color: #000066;">xmlns:utils</span>=<span style="color: #ff0000;">&quot;com.foomonger.swizframework.utils.*&quot;</span>
        <span style="color: #000066;">xmlns:view</span>=<span style="color: #ff0000;">&quot;example.view.*&quot;</span>
        <span style="color: #000066;">xmlns:local</span>=<span style="color: #ff0000;">&quot;*&quot;</span>
        <span style="color: #000066;">layout</span>=<span style="color: #ff0000;">&quot;absolute&quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #339933;">&lt;![CDATA[</span>
<span style="color: #339933;">            import mx.logging.LogEventLevel;</span>
<span style="color: #339933;">        ]]&gt;</span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Script<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;utils:SwizLoggerConfig<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:TraceTarget</span>
                <span style="color: #000066;">includeCategory</span>=<span style="color: #ff0000;">&quot;true&quot;</span>
                <span style="color: #000066;">includeDate</span>=<span style="color: #ff0000;">&quot;false&quot;</span>
                <span style="color: #000066;">includeLevel</span>=<span style="color: #ff0000;">&quot;true&quot;</span>
                <span style="color: #000066;">includeTime</span>=<span style="color: #ff0000;">&quot;true&quot;</span>
                <span style="color: #000066;">level</span>=<span style="color: #ff0000;">&quot;{LogEventLevel.INFO}&quot;</span>
                <span style="color: #000066;">filters</span>=<span style="color: #ff0000;">&quot;*&quot;</span>
                <span style="color: #000066;">fieldSeparator</span>=<span style="color: #ff0000;">&quot; | &quot;</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/utils:SwizLoggerConfig<span style="font-weight: bold; color: black;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;local:SwizLoggerConfigExampleSwiz</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;view:MainView</span><span style="font-weight: bold; color: black;">/&gt;</span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:Application<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;</pre>
<p><br/></p>
<p>The value of these classes will depend on your personal style and preference. I wrote them so I like them. They're available on <a href="http://code.google.com/p/foomonger-swizframework/" target="_blank">Google Code</a>.</p>
<p>Happy coding.</p>
<p><br/><br />
* Update: Here's the MXML syntax for adding multiple packages to the filters Array:</p>
<pre class="xml"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:TraceTarget</span>
        <span style="color: #000066;">includeCategory</span>=<span style="color: #ff0000;">&quot;true&quot;</span>
        <span style="color: #000066;">includeDate</span>=<span style="color: #ff0000;">&quot;false&quot;</span>
        <span style="color: #000066;">includeLevel</span>=<span style="color: #ff0000;">&quot;true&quot;</span>
        <span style="color: #000066;">includeTime</span>=<span style="color: #ff0000;">&quot;true&quot;</span>
        <span style="color: #000066;">level</span>=<span style="color: #ff0000;">&quot;{LogEventLevel.INFO}&quot;</span>
        <span style="color: #000066;">fieldSeparator</span>=<span style="color: #ff0000;">&quot; | &quot;</span><span style="font-weight: bold; color: black;">&gt;</span></span>
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;mx:filters<span style="font-weight: bold; color: black;">&gt;</span></span></span>
        [&quot;foo.bar.*&quot;, &quot;com.foomonger.*&quot;]
    <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:filters<span style="font-weight: bold; color: black;">&gt;</span></span></span>
<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/mx:TraceTarget<span style="font-weight: bold; color: black;">&gt;</span></span></span>
&nbsp;</pre>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.foomonger.com%2F2010%2F03%2F20%2Fswizlogger-helpers-swizloggerconfig-and-loggerprocessor%2F&amp;linkname=SwizLogger%20Helpers%3A%20SwizLoggerConfig%20and%20LoggerProcessor"><img src="http://blog.foomonger.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://blog.foomonger.com/2010/03/20/swizlogger-helpers-swizloggerconfig-and-loggerprocessor/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Swiz, ResourceManager, and [Resource]</title>
		<link>http://blog.foomonger.com/2010/03/10/swiz-resourcemanager-and-resource/</link>
		<comments>http://blog.foomonger.com/2010/03/10/swiz-resourcemanager-and-resource/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 06:48:10 +0000</pubDate>
		<dc:creator>Sam Ahn</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[custom processor]]></category>
		<category><![CDATA[resource manager]]></category>
		<category><![CDATA[swiz]]></category>

		<guid isPermaLink="false">http://blog.foomonger.com/?p=131</guid>
		<description><![CDATA[I'm using the Swiz Framework in a side project which requires runtime loading of all the copy. I decided to use Flex's ResourceManager by parsing static XML files and populating the ResourceManager with the newly created ResourceBundles. Binding resources into view's wasn't too bad, but it could be better. For one thing any component that [...]]]></description>
			<content:encoded><![CDATA[<p>I'm using the Swiz Framework in a side project which requires runtime loading of all the copy. I decided to use Flex's ResourceManager by parsing static XML files and populating the ResourceManager with the newly created ResourceBundles. Binding resources into view's wasn't too bad, but it could be better. For one thing any component that needed a resource included a ResourceManager dependency. So I thought about it and then created a ResourceProcessor which really cleans things up.</p>
<p>Here's an example application:</p>
<ul>
<li><a href="http://www.foomonger.com/swizframework/ResourceProcessorExample/ResourceProcessorExample.swf" target="_blank">SWF</a></li>
<li><a href="http://www.foomonger.com/swizframework/ResourceProcessorExample/srcview/" target="_blank">Source</a></li>
</ul>
<p>I set up the [Resource] tag to mirror the @Resource directive. All you do is decorate a property like so:</p>
<pre class="actionscript"><span style="color: #66cc66;">&#91;</span>Resource<span style="color: #66cc66;">&#40;</span><span style="color: #0066CC;">key</span>=<span style="color: #ff0000;">&quot;title&quot;</span>, bundle=<span style="color: #ff0000;">&quot;example&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
<span style="color: #66cc66;">&#91;</span>Bindable<span style="color: #66cc66;">&#93;</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">var</span> title:<span style="color: #0066CC;">String</span>;</pre>
<p>The processor binds the resources so they will update when binding events fire in the ResourceManager. And you only need to include a ResourceManager dependency if you are adding resources at runtime or changing the locales array.</p>
<p>This processor is available in my <a href="http://code.google.com/p/foomonger-swizframework/" target="_blank">foomonger-swizframework</a> project on Google Code. Enjoy!</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.foomonger.com%2F2010%2F03%2F10%2Fswiz-resourcemanager-and-resource%2F&amp;linkname=Swiz%2C%20ResourceManager%2C%20and%20%5BResource%5D"><img src="http://blog.foomonger.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://blog.foomonger.com/2010/03/10/swiz-resourcemanager-and-resource/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Swiz, Signals, and [MediateSignal]</title>
		<link>http://blog.foomonger.com/2010/02/26/swiz-signals-and-mediatesignal/</link>
		<comments>http://blog.foomonger.com/2010/02/26/swiz-signals-and-mediatesignal/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 04:37:41 +0000</pubDate>
		<dc:creator>Sam Ahn</dc:creator>
				<category><![CDATA[flex]]></category>
		<category><![CDATA[custom processor]]></category>
		<category><![CDATA[signals]]></category>
		<category><![CDATA[swiz]]></category>

		<guid isPermaLink="false">http://blog.foomonger.com/?p=107</guid>
		<description><![CDATA[Joel Hooks created this RobotLegs/Signals demo. Ben Clinkinbeard then created this Swiz-version of Joel's demo. I then took Ben's demo and Swiz-ified it even more by using a custom [MediateSignal] processor. Here's the source.
[MediateSignal] is the Signal equivalent of [Mediate]. Here's an example:
&#91;MediateSignal&#40;&#34;galleryUpdatedSignal&#34;&#41;&#93;
public function galleryUpdated&#40;gallery:Gallery&#41;:void
[MediateSignal] takes a Signal Bean name or type and adds the decorated method to [...]]]></description>
			<content:encoded><![CDATA[<p>Joel Hooks created this <a title="Robotlegs Image Gallery Example using AS3-Signals and the Presentation Model" href="http://joelhooks.com/2010/01/16/robotlegs-image-gallery-example-using-as3-signals-and-the-presentation-model/" target="_blank">RobotLegs/Signals demo</a>. Ben Clinkinbeard then created <a title="Swiz, AS3-Signals, and [Inject] FTW" href="http://www.benclinkinbeard.com/2010/02/swiz-as3-signals-and-inject-ftw/" target="_blank">this Swiz-version</a> of Joel's demo. I then took Ben's demo and Swiz-ified it even more by using a custom [MediateSignal] processor. Here's the <a title="RobotLegsConversion2" href="http://blog.foomonger.com/pub/2010/02/26/swiz-signals-mediatesignal/srcview/index.html" target="_blank">source</a>.</p>
<p>[MediateSignal] is the Signal equivalent of [Mediate]. Here's an example:</p>
<pre class="actionscript"><span style="color: #66cc66;">&#91;</span>MediateSignal<span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;galleryUpdatedSignal&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#93;</span>
<span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> galleryUpdated<span style="color: #66cc66;">&#40;</span>gallery:Gallery<span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></pre>
<p>[MediateSignal] takes a Signal Bean name or type and adds the decorated method to the Signal (see GalleryThumbnailsPresentationModel for examples).</p>
<p>This is what I changed from Ben's demo:</p>
<ul>
<li>Created the MediateSignalProcessor</li>
<li>Added [MediateSignal] metadata to the Signal listeners</li>
<li>Made the Signal listeners public</li>
<li>Named the Signal Beans</li>
<li>Removed [PostConstruct] methods that added the Signal listeners</li>
<li>Removed injected Signals that weren't being using to dispatch</li>
</ul>
<p>[MediateSignal] makes using Signals in Swiz very parallel to using Events (especially if you define the Event dispatcher as a Bean and inject it by name). And just like Events, you only need to [Inject] the Signals into Beans who are dispatching Signals. I was pretty excited to create my first custom processor and play with Signals for the first time. Let me know what you think!</p>
<p><span style="color: #999999;">Disclaimer: I set up MediateSignalProcessor to also handle DeluxeSignals and remove listeners, though to be honest I didn't test those.</span></p>
<p><span style="color: #999999;"><span style="color: #0000ff;">* Update: I've posted the processor on </span><a title="foomonger-swizframework" href="http://code.google.com/p/foomonger-swizframework/" target="_blank"><span style="color: #0000ff;">Google Code</span></a><span style="color: #0000ff;"> and it contains unit tests (including DeluxeSignals and removing listeners).</span></span></p>
<p><span style="color: #999999;"><span style="color: #0000ff;">** Update: I've created a bare-bones example application: <a href="http://www.foomonger.com/swizframework/MediateSignalProcessorExample/MediateSignalProcessorExample.swf" target="_blank">SWF</a> and <a href="http://www.foomonger.com/swizframework/MediateSignalProcessorExample/srcview/" target="_blank">Source</a>.</span></span></p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fblog.foomonger.com%2F2010%2F02%2F26%2Fswiz-signals-and-mediatesignal%2F&amp;linkname=Swiz%2C%20Signals%2C%20and%20%5BMediateSignal%5D"><img src="http://blog.foomonger.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://blog.foomonger.com/2010/02/26/swiz-signals-and-mediatesignal/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
