<?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>Query7 &#187; Flex</title>
	<atom:link href="http://query7.com/category/flex/feed" rel="self" type="application/rss+xml" />
	<link>http://query7.com</link>
	<description>PHP, Javascript, Python and Web Development</description>
	<lastBuildDate>Sat, 25 Jun 2011 21:29:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>Playing with MouseEvent in Flex 3</title>
		<link>http://query7.com/playing-with-mouseevent-in-flex-3</link>
		<comments>http://query7.com/playing-with-mouseevent-in-flex-3#comments</comments>
		<pubDate>Wed, 12 Nov 2008 04:58:12 +0000</pubDate>
		<dc:creator>Amar Shukla</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[AS3 MouseEvent]]></category>
		<category><![CDATA[flex 3]]></category>
		<category><![CDATA[flex 3 tricks]]></category>
		<category><![CDATA[Flex 3 Tutorial]]></category>
		<category><![CDATA[MouseEvent]]></category>
		<category><![CDATA[Playing with Events]]></category>

		<guid isPermaLink="false">http://www.webdevelopmentbits.com/?p=281</guid>
		<description><![CDATA[<p>I have come across a very interesting problem while developing a flex application where I have a<br />
button control and I want to call two different functions on  click of the button . The interesting part<br />
is that I want to call two different functions on different events of the same button control, one at<br />
single click and other at double click .<br />
Now what to do in this case as it will always execute the function defined at single click .<br />
So what I am gonna do is to use a Timer using setInterval( ) method and use it to solve this problem.</p>
<p>The code goes here -</p>
<p><code>&#60;?xml version="1.0" encoding="utf-8"?&#62;<br />
&#60;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"&#62;<br />
&#60;mx:Script&#62;<br />
&#60;![CDATA[<br />
import mx.controls.Alert;<br />
import flash.utils.clearInterval;<br />
private var timeGap:Number = new Number();<br />
private function doubleClick(event:MouseEvent):void {<br />
clearInterval(timeGap);<br />
//put your code here to be executed on double click<br />
Alert.show("double click");<br />
}<br />
private function singleClick(event:MouseEvent):void {<br />
clearInterval(timeGap);<br />
timeGap = setInterval(otherClick, 250);<br />
}<br />
private function otherClick():void {<br />
//put your code here to be executed on single click<br />
Alert.show("first click");<br />
clearInterval(timeGap);<br />
}<br />
]]&#62;<br</code>&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>I have come across a very interesting problem while developing a flex application where I have a<br />
button control and I want to call two different functions on  click of the button . The interesting part<br />
is that I want to call two different functions on different events of the same button control, one at<br />
single click and other at double click .<br />
Now what to do in this case as it will always execute the function defined at single click .<br />
So what I am gonna do is to use a Timer using setInterval( ) method and use it to solve this problem.</p>
<p>The code goes here -</p>
<p><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;<br />
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"&gt;<br />
&lt;mx:Script&gt;<br />
&lt;![CDATA[<br />
import mx.controls.Alert;<br />
import flash.utils.clearInterval;<br />
private var timeGap:Number = new Number();<br />
private function doubleClick(event:MouseEvent):void {<br />
clearInterval(timeGap);<br />
//put your code here to be executed on double click<br />
Alert.show("double click");<br />
}<br />
private function singleClick(event:MouseEvent):void {<br />
clearInterval(timeGap);<br />
timeGap = setInterval(otherClick, 250);<br />
}<br />
private function otherClick():void {<br />
//put your code here to be executed on single click<br />
Alert.show("first click");<br />
clearInterval(timeGap);<br />
}<br />
]]&gt;<br />
&lt;/mx:Script&gt;<br />
&lt;mx:Button label="click" x="134" y="94"<br />
click="singleClick(event)"<br />
doubleClickEnabled="true"<br />
doubleClick="doubleClick(event)"/&gt;<br />
&lt;/mx:Application&gt;<br />
</code><br />
Now it&#8217;s the time to explain whats going on inside the code.<br />
On single click and double click events I am invoking two different Alerts to just display a message,<br />
In your case you can  write any code which is to be executed on those click events.</p>
<p>On click, inside the singleClick( ) method, we will reset &amp; initiate the timer which will call the<br />
otherClick( ) method on complete. otherClick( ) method contains actual single Click code.</p>
<p>If doubleClick is not invoked, then the  timer completes and otherClick( ) method is executed.<br />
But if doubleClick is invoked , it will call the doubleClick( ) method, where we will clear the<br />
timer  so the timer will not complete and execute the otherClick( ) method  and thus it will invoke the<br />
doubleClick( ) method.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/playing-with-mouseevent-in-flex-3/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SingleTon Pattern in Flex</title>
		<link>http://query7.com/singleton-pattern-in-flex</link>
		<comments>http://query7.com/singleton-pattern-in-flex#comments</comments>
		<pubDate>Tue, 04 Nov 2008 14:11:44 +0000</pubDate>
		<dc:creator>Ponbharathi Bakthaduruvan</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Singleton Pattern]]></category>

		<guid isPermaLink="false">http://www.webdevelopmentbits.com/?p=236</guid>
		<description><![CDATA[<p><strong>What is singleton pattern?</strong></p>
<p><strong></strong></p>
<p>The singleton pattern is a design pattern that is used to restrict instantiation of a class to one object. If you create the class as a singleton then no way to create more than one instance. But, you can get that single instance in any number of classes. So all the classes will share the same properties and behaviours of that singleton object.</p>
<p><strong>How to implement the singleton pattern?</strong></p>
<p>Implementation of a singleton pattern must satisfy the single instance and global access principles. It requires a mechanism to access the singleton class member without creating a class object and a mechanism to persist the value of class members among class objects. The singleton pattern is implemented by creating a class with a method that creates a new instance of the class if one does not exist. If an instance already exists, it simply returns a reference to that object. To make sure that the object cannot be instantiated any other way, the constructor is made protected (not private, because reuse and unit test could need to access the constructor). Note the distinction between a simple static instance of a class and a singleton: although a&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><strong>What is singleton pattern?</strong></p>
<p><strong></strong></p>
<p>The singleton pattern is a design pattern that is used to restrict instantiation of a class to one object. If you create the class as a singleton then no way to create more than one instance. But, you can get that single instance in any number of classes. So all the classes will share the same properties and behaviours of that singleton object.</p>
<p><strong>How to implement the singleton pattern?</strong></p>
<p>Implementation of a singleton pattern must satisfy the single instance and global access principles. It requires a mechanism to access the singleton class member without creating a class object and a mechanism to persist the value of class members among class objects. The singleton pattern is implemented by creating a class with a method that creates a new instance of the class if one does not exist. If an instance already exists, it simply returns a reference to that object. To make sure that the object cannot be instantiated any other way, the constructor is made protected (not private, because reuse and unit test could need to access the constructor). Note the distinction between a simple static instance of a class and a singleton: although a singleton can be implemented as a static instance, it can also be lazily constructed, requiring no memory or resources until needed. Another notable difference is that static member classes cannot implement an interface, unless that interface is simply a marker. So if the class has to realize a contract expressed by an interface, it really has to be a singleton.</p>
<p>The singleton pattern must be carefully constructed in multi-threaded applications. If two threads are to execute the creation method at the same time when a singleton does not yet exist, they both must check for an instance of the singleton and then only one should create the new one. If the programming language has concurrent processing capabilities the method should be constructed to execute as a mutually exclusive operation.<br />
The classic solution to this problem is to use mutual exclusion on the class that indicates that the object is being instantiated.</p>
<p><strong>How to implement the singleton pattern in Flex and ActionScript?</strong></p>
<ul>
<li> Can we implement the singleton pattern in ActionScript? Why not? Ofcource we can.</li>
</ul>
<ul>
<li> Is there any keyword named as singleton in Flex?. No.</li>
</ul>
<ul>
<li> Can we declare the constructor as protected in Flex?. No. (ActionScript 3.0 will not support protected constructors)</li>
</ul>
<ul>
<li> Can we declare the constructor as private in Flex?. No. (ActionScript 3.0 will not support private constructors)</li>
</ul>
<ul>
<li> Then how can we implement the singleton pattern in Flex ? See the next line.</li>
</ul>
<p><strong>Steps to  implement the singleton pattern in Flex and ActionScript</strong></p>
<p>Consider the <strong>MySingleTon </strong>class as a singleton class.</p>
<pre>package {
	public class MySingleTon {

    	// Single Instance of Our MySingleTon
		private static var instance:MySingleTon;

	    //DEFINE YOUR VARIABLES HERE
	    public function MySingleTon (enforcer:SingletonEnforcer)
	    {
	    	if (enforcer == null)
	    	{
                      throw new Error( "You Can Only Have One MySingleTon" );
			}
		}

		// Returns the Single Instance
		public static function getInstance() : MySingleTon
		{
			if (instance == null)
			{
				instance = new MySingleTon ( new SingletonEnforcer );
			}
			return instance;
		}
	}
}

// Utility Class to Deny Access to Constructor
class SingletonEnforcer {}

1). We should create one static variable. It will be called "instance" and it will be of type MySingleTon. This will be the variable where we will store our
one instance of our class.

2). Then we should create one constructor. The constructor takes one argument - "enforcer". You will notice that this "enforcer" has a type of "SingletonEnforcer"
which is defined directly after our class. Here is the logic behind that:</pre>
<ul>
<li>When you put a class in an Actionscript file below the main class, it is only available to that class.</li>
</ul>
<ul>
<li>If the constructor requires this argument &#8211; then only our main class can create an instance of itself, because we do not have access to the &#8220;SingletonEnforcer&#8221; class. Only the main class has this access.</li>
</ul>
<ul>
<li>We will not access our class in the normal way by using the &#8220;new&#8221; statement because we can&#8217;t call the constructor. Once we get inside of the constructor, we have a few lines that make sure things work as planned. The &#8220;if&#8221; statement ensures that we had a valid &#8220;enforcer&#8221; passed in. If there wasn&#8217;t it throws an Error stating that &#8220;You Can Have Only One MySingleTon&#8221;.</li>
</ul>
<p>Then we should create one static function named as getInstance. The &#8220;getInstance&#8221; function is how we will access our MySingleTon from our application. This function simply passes back the &#8220;instance&#8221; of the class. If it doesn&#8217;t exist yet, it creates it. We can now get the MySingleTon by using the following:</p>
<p>var mySingleTone:MySingleTon = MySingleTon.getInstance();. So you can share this single object in any number of classes.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/singleton-pattern-in-flex/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Modular Applications</title>
		<link>http://query7.com/modular-applications</link>
		<comments>http://query7.com/modular-applications#comments</comments>
		<pubDate>Tue, 04 Nov 2008 14:10:57 +0000</pubDate>
		<dc:creator>Ponbharathi Bakthaduruvan</dc:creator>
				<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex Modules]]></category>

		<guid isPermaLink="false">http://www.webdevelopmentbits.com/?p=220</guid>
		<description><![CDATA[<p><strong>Modular applications</strong></p>
<p>Sometimes our flex application&#8217;s size becomes very large. Due to this, we are facing many problems such as bandwidth, network traffic and it will take more time to load. We have many ways to solve this problem such as</p>
<p>1. Do not embed the assets into the project.<br />
2. Modules.</p>
<p><strong>About Modules</strong></p>
<p>Modules are the swf files which can be loaded and unloaded dynamically by an application. The user cannot run the modules independently in the browser or the flash player. But the user can share the modules in any number of applications.</p>
<p><strong>Benifits of Modules</strong></p>
<ul>
<li>Smaller initial download size of the SWF file.</li>
<li>Shorter load time due to smaller SWF file size.</li>
<li>Better encapsulation of related aspects of an application. For example, a &#8220;reporting&#8221; feature can be separated into a module that you can then work on independently.</li>
<li>Any number of applications can share the modules.</li>
</ul>
<p><strong>Creating the Modules</strong></p>
<p>To create the modules we should create seperate mxml or actionscript class and an application that uses the modules. We can create the modules in two ways, one is by using the mxml and by using the actionscript class.</p>
<p><strong>Creating the modules by using the</strong>&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><strong>Modular applications</strong></p>
<p>Sometimes our flex application&#8217;s size becomes very large. Due to this, we are facing many problems such as bandwidth, network traffic and it will take more time to load. We have many ways to solve this problem such as</p>
<p>1. Do not embed the assets into the project.<br />
2. Modules.</p>
<p><strong>About Modules</strong></p>
<p>Modules are the swf files which can be loaded and unloaded dynamically by an application. The user cannot run the modules independently in the browser or the flash player. But the user can share the modules in any number of applications.</p>
<p><strong>Benifits of Modules</strong></p>
<ul>
<li>Smaller initial download size of the SWF file.</li>
<li>Shorter load time due to smaller SWF file size.</li>
<li>Better encapsulation of related aspects of an application. For example, a &#8220;reporting&#8221; feature can be separated into a module that you can then work on independently.</li>
<li>Any number of applications can share the modules.</li>
</ul>
<p><strong>Creating the Modules</strong></p>
<p>To create the modules we should create seperate mxml or actionscript class and an application that uses the modules. We can create the modules in two ways, one is by using the mxml and by using the actionscript class.</p>
<p><strong>Creating the modules by using the mxml</strong></p>
<p>An MXML-based module file&#8217;s root tag should be &lt;mx:Module&gt;. Within this tag we can create all our child containers and components.Ofcource we can have our styles and scripts also. We should compile the modules using the mxmlc command-line compiler or the compiler built into Adobe Flex Builder. The swf file will be created after we compile the modules.</p>
<pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;!-- modules/MyModule.mxml --&gt;
&lt;mx:Module xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="400" height="300"&gt;
	&lt;mx:Script&gt;
		&lt;![CDATA[
			import mx.collections.ArrayCollection;
	        	[Bindable]
	        	public var expenses:ArrayCollection = new ArrayCollection([
	            		{Month:"Jan", Profit:2000, Expenses:1500},
		            	{Month:"Feb", Profit:1000, Expenses:200},
		           	{Month:"Mar", Profit:1500, Expenses:500},
	        	    	{Month:"April", Profit:2000, Expenses:600},
	            		{Month:"May", Profit:2500, Expenses:700},
		            	{Month:"June", Profit:3000, Expenses:500},
		            	{Month:"July", Profit:4000, Expenses:400}
	        	]);
		]]&gt;
	&lt;/mx:Script&gt;

	&lt;mx:DataGrid dataProvider="{expenses}" &gt;
		&lt;mx:columns&gt;
			&lt;mx:DataGridColumn dataField="Month" headerText="Month" /&gt;
			&lt;mx:DataGridColumn dataField="Profit" headerText="Proft" /&gt;
			&lt;mx:DataGridColumn dataField="Expenses" headerText="Expenses" /&gt;
		&lt;/mx:columns&gt;
	&lt;/mx:DataGrid&gt;
&lt;/mx:Module&gt;</pre>
<p><strong>Creating the modules by using ActionScript</strong></p>
<p>To create a module in ActionScript, we should create a file that extends either the mx.modules.Module class or the mx.modules.ModuleBase class. Extending the Module class is the same as using the &lt;mx:Module&gt; tag in an MXML file. You should extend this class if your module interacts with the framework; this typically means that it adds objects to the display list or otherwise interacts with visible objects.</p>
<pre>package modules{
    import mx.modules.ModuleBase;

    public class ArithmaticModule extends ModuleBase {

        public function ArithmaticModule () {

        }

        public function add(a:Number, b:Number):Number {
            return a + b;
        }

	public function subtract(a:Number, b:Number):Number {
            return a - b;
        }

	public function divide(a:Number, b:Number):Number {
            return a / b;
        }

	public function multiply(a:Number, b:Number):Number {
            return a * b;
        }
    }
}</pre>
<p><strong>Loading the modules</strong></p>
<p>We can load the modules in our applications by using the &lt;mx:ModuleLoader&gt; mxml tag or mx.modules.ModuleLoader and mx.modules.ModuleManager ActionScript classes. Typically, we use one of the following techniques to load MXML-based modules:</p>
<ul>
<li><strong>ModuleLoader </strong> : The ModuleLoader class provides the highest-level API for handling modules.</li>
<li><strong>ModuleManager</strong> : The ModuleManager class provides a lower-level API for handling modules than the ModuleLoader class does.</li>
</ul>
<p><strong>Using the ModuleLoader class to load module</strong>s</p>
<p>We can use the ModuleLoader class to load module in an application or other module. The easiest way to do this in an MXML application is to use the &lt;mx:ModuleLoader&gt; tag. We set the value of the url property to point to the location of the module&#8217;s SWF file. The following example loads the module when the application first starts:</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;!-- modules/MySimplestModuleLoader.mxml --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"&gt;
    &lt;mx:ModuleLoader url="MyModule.swf"/&gt;
&lt;/mx:Application&gt;</pre>
<p>We can change when the module loads by setting the value of the url property at some other time, such as in response to an event. Setting the target URL of a ModuleLoader triggers a call to the loadModule() method. This occurs when we first create a ModuleLoader with the url property set. It also occurs if we change the value of that property. If we set the value of the url property to an empty string (&#8220;&#8221;), the ModuleLoader unloads the current module.</p>
<p><strong>Using the ModuleManager class to load modules </strong></p>
<p>You can use the ModuleManager class to load the module. This technique is less abstract than using the &lt;mx:ModuleLoader&gt; tag, but it does provide you with greater control over how and when the module is loaded. To use the ModuleManager to load a module in ActionScript, you first get a reference to the module&#8217;s IModuleInfo interface by using the ModuleManager getModule() method. You then call the interface&#8217;s load() method. Finally, you use the factory property of the interface to call the create() method and cast the return value as the module&#8217;s class.</p>
<p>The IModuleInfo class&#8217;s load() method optionally takes an ApplicationDomain and a SecurityDomain as arguments. If you do not specify either of these, then the module is loaded into a new child domain. The following example shell application loads the ColumnChartModule.swf file and then adds it to the display list so that it appears when the application starts:</p>
<pre>&lt;?xml version="1.0"?&gt;
&lt;!-- modules/ModuleLoaderApp.mxml --&gt;
&lt;mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" creationComplete="initApp()"&gt;
    &lt;mx:Script&gt;
        &lt;![CDATA[
        import mx.events.ModuleEvent;
        import mx.modules.ModuleManager;
        import mx.modules.IModuleInfo;

        public var info:IModuleInfo;

        private function initApp():void {
            info = ModuleManager.getModule("MyModule.swf");
            info.addEventListener(ModuleEvent.READY, modEventHandler);

            // Load the module into memory. Calling load() makes the
            // IFlexModuleFactory available. You can then get an
            // instance of the class using the factory's create()
            // method.
            info.load();
        }

        private function modEventHandler(e:ModuleEvent):void {
            // Add an instance of the module's class to the
            // display list.
            vb1.addChild(info.factory.create() as ColumnChartModule);
        }
        ]]&gt;
    &lt;/mx:Script&gt;

    &lt;mx:VBox id="vb1"/&gt;

&lt;/mx:Application&gt;</pre>
<p><strong><em>Note:</em></strong> MXML-based modules can load other modules. Those modules can load other modules, and so on.</p>
<p><strong>Unloading the Modules</strong></p>
<p>We can unload the modelues in two ways:</p>
<p>1. If we set the value of the url property to an empty string (&#8220;&#8221;), the ModuleLoader unloads the current module.</p>
<p>2. Calling the unloadModule() method of the ModuleLoader instance.<br />
public function removeModule(m:ModuleLoader):void {<br />
m.unloadModule();<br />
}</p>
<p><strong>Modular applications best practices</strong></p>
<p>By default, a module is loaded into a child domain of the current application domain. You can specify a different application domain by using the applicationDomain property of the ModuleLoader class. Because a module is loaded into a child domain, it owns class definitions that are not in the main application&#8217;s domain. For example, the first module to load the PopUpManager class becomes the owner of the PopUpManager class for the entire application because it registers the manager with the SingletonManager. If another module later tries to use the PopUpManager, Adobe ® Flash® Player throws an exception.</p>
<p>The solution is to ensure that managers such as PopUpManager and DragManager and any other shared services are defined by the main application (or loaded late into the shell&#8217;s application domain). When you promote one of those classes to the shell, the class can then be used by all modules. Typically, this is done by adding the following to a script block:</p>
<p>import mx.managers.PopUpManager;<br />
import mx.managers.DragManager;<br />
private var popUpManager:PopUpManager;<br />
private var dragManager:DragManager;</p>
<p>This technique also applies to components. The module that first uses the component owns that component&#8217;s class definition in its domain. As a result, if another module tries to use a component that has already been used by another module, its definition will not match the existing definition. To avoid a mismatch of component definitions, create an instance of the component in the main application. The result is that the definition of the component is owned by the main application and can be used by modules in any child domain.</p>
<p>Because a Flex module must be in the same security domain as the application (SWF) that loads it, when you&#8217;re using modules in an AIR application any module SWF must be located in the same directory as the main application SWF or one of its subdirectories, which ensures that like the main application SWF, the module SWF is in the AIR application security sandbox.</p>
<p>One way to verify this is to ensure that a relative URL for the module&#8217;s location doesn&#8217;t require &#8220;../&#8221; (&#8220;up one level&#8221;) notation to navigate outside the application directory or one of its subdirectories.</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/modular-applications/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Philosophy of Object Oriented Programming and Software Design</title>
		<link>http://query7.com/philosophy-of-object-oriented-programming-and-software-design</link>
		<comments>http://query7.com/philosophy-of-object-oriented-programming-and-software-design#comments</comments>
		<pubDate>Sat, 01 Nov 2008 14:33:25 +0000</pubDate>
		<dc:creator>yaapa</dc:creator>
				<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web 2.0]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Zend]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[Object-Oriented Programming]]></category>
		<category><![CDATA[philosophy]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://www.webdevelopmentbits.com/?p=241</guid>
		<description><![CDATA[Now, I am no expert in OOP or software design, but here's a philosophy which might help you make the most of what you know about OOP and software design.]]></description>
			<content:encoded><![CDATA[<p>Now, I am no expert in OOP or software design, but here&#8217;s a philosophy which might help you make the most of what you know about OOP and software design. I have observed and have read reports that people absorb most information when it&#8217;s presented in lists, preferably bulleted. So without any further ramling, I present you my bulleted philosophy of OOP and Software Design.</p>
<ul>
<li>It&#8217;s not how much and what you know; but what you can do with what you know, which&#8217;s important.</li>
</ul>
<ul>
<li>Ability to implement Polymorphism, Inheritance, private, public namespaces, static methods etc is no guarantee you are a good OO developer.</li>
</ul>
<ul>
<li>OOP is useless if you don&#8217;t use it to create good software design (architecture).</li>
</ul>
<ul>
<li>Using packages, classes, etc does not guarantee good software design.</li>
</ul>
<ul>
<li>When designing your software, think of it as an electronic device you are designing.</li>
</ul>
<ul>
<li>Sketch out the &#8216;electronic device&#8217;. Label the different components, list their functionalities.</li>
</ul>
<ul>
<li>Stay hungry, stay foolish.</li>
</ul>
<p>That&#8217;s it for today. I hope you are blessed with more knowledge, and the ability to make the best use of them.  Adios!</p>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/philosophy-of-object-oriented-programming-and-software-design/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>PureMVC</title>
		<link>http://query7.com/puremvc</link>
		<comments>http://query7.com/puremvc#comments</comments>
		<pubDate>Tue, 28 Oct 2008 10:28:42 +0000</pubDate>
		<dc:creator>Ponbharathi Bakthaduruvan</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.webdevelopmentbits.com/?p=193</guid>
		<description><![CDATA[<p>PureMVC is a framework which helps the Flex programmers to create applications in the MVC architecture. It helps the programmers to develop loosely coupled components. It helps to create the resusable codes. Very easy to understand and maintain than other frameworks. Forces the singleton pattern.</p>
<p>We can divide the pureMVC as:</p>
<ul>
<li> Facade &#38; Core</li>
<li> Controller &#38; Commands</li>
<li> Model &#38; Proxies</li>
<li> View &#38; Mediators</li>
<li> Observers &#38; Notifications</li>
</ul>
<p><strong>Steps to follow in PureMVC</strong></p>
<p><strong>1</strong>. Main application should call the facade.startup(this). Here facade is the singletone instance of ApplicationFacade class.</p>
<p><strong>2</strong>. <strong>ApplicationFacade</strong></p>
<ul>
<li> Singleton class.</li>
<li> It extedns the org.puremvc.as3.patterns.facade.Facade.</li>
<li> It implements org.puremvc.as3.interfaces.IFacade .</li>
<li> Should override the initializeController() method.</li>
<li> It defines static constants for Notification names.</li>
<li> Initializes the Commands used to access and notify the Commands, Mediators and Proxies.</li>
</ul>
<p><strong>3.</strong> <strong>MacroCommand(s) </strong></p>
<ul>
<li> It extends the org.puremvc.as3.patterns.command.MacroCommand.</li>
<li> It implements the org.puremvc.as3.interfaces.ICommand.</li>
<li> Should override the initializeMacroCommand() method.</li>
<li> Executes the SimpleCommands and MacroCommands.</li>
<li> User can registerand retrieve the Mediators and Proxies.</li>
</ul>
<p><strong>4</strong>. <strong>SimpleCommand(s)</strong></p>
<ul>
<li> It extends the org.puremvc.as3.patterns.command.SimpleCommand.</li>
<li> It implements org.puremvc.as3.interfaces.ICommand.</li>
<li> Should override the execute( note:INotification ) method.</li>
<li> User can register and</li></ul><p>&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>PureMVC is a framework which helps the Flex programmers to create applications in the MVC architecture. It helps the programmers to develop loosely coupled components. It helps to create the resusable codes. Very easy to understand and maintain than other frameworks. Forces the singleton pattern.</p>
<p>We can divide the pureMVC as:</p>
<ul>
<li> Facade &amp; Core</li>
<li> Controller &amp; Commands</li>
<li> Model &amp; Proxies</li>
<li> View &amp; Mediators</li>
<li> Observers &amp; Notifications</li>
</ul>
<p><strong>Steps to follow in PureMVC</strong></p>
<p><strong>1</strong>. Main application should call the facade.startup(this). Here facade is the singletone instance of ApplicationFacade class.</p>
<p><strong>2</strong>. <strong>ApplicationFacade</strong></p>
<ul>
<li> Singleton class.</li>
<li> It extedns the org.puremvc.as3.patterns.facade.Facade.</li>
<li> It implements org.puremvc.as3.interfaces.IFacade .</li>
<li> Should override the initializeController() method.</li>
<li> It defines static constants for Notification names.</li>
<li> Initializes the Commands used to access and notify the Commands, Mediators and Proxies.</li>
</ul>
<p><strong>3.</strong> <strong>MacroCommand(s) </strong></p>
<ul>
<li> It extends the org.puremvc.as3.patterns.command.MacroCommand.</li>
<li> It implements the org.puremvc.as3.interfaces.ICommand.</li>
<li> Should override the initializeMacroCommand() method.</li>
<li> Executes the SimpleCommands and MacroCommands.</li>
<li> User can registerand retrieve the Mediators and Proxies.</li>
</ul>
<p><strong>4</strong>. <strong>SimpleCommand(s)</strong></p>
<ul>
<li> It extends the org.puremvc.as3.patterns.command.SimpleCommand.</li>
<li> It implements org.puremvc.as3.interfaces.ICommand.</li>
<li> Should override the execute( note:INotification ) method.</li>
<li> User can register and retrieve the Mediators and proxies.</li>
</ul>
<p><strong>5</strong>. <strong>Mediator(s)</strong></p>
<ul>
<li> It extends the org.puremvc.as3.patterns.mediator.Mediator.</li>
<li> It implements the org.puremvc.as3.interfaces.IMediator.</li>
<li> Should override the listNotificationInterests() and handleNotification( note:INotification ) methods    to listen to the notifications.</li>
<li> Registers the mediators and proxies.</li>
<li> User can retrieve the Mediators and proxies.</li>
<li> User can register the notifications.</li>
<li> Listens for the notifications from other Mediators, Proxies and commands.</li>
<li> Listens for the events from the component.</li>
<li> Sends the notifications to other mediators.</li>
</ul>
<p><strong>6. Proxy(ies)</strong></p>
<ul>
<li> It extends org.puremvc.as3.patterns.proxy.Proxy.</li>
<li> It implents the interface org.puremvc.as3.interfaces.IProxy.</li>
<li> User can send the notifications.</li>
<li> Used to access the Delegates and datas.</li>
</ul>
<p><strong>7. Component(s)</strong></p>
<ul>
<li> Views of our application.</li>
<li> Every component should have its own Mediator. One Mediator per Component.</li>
<li> Dispatches the event. So the mediator can listen for that events.</li>
</ul>
<p><strong>Observers</strong></p>
<p>PureMVC applications may run in environments without access to Flash’s Event and EventDispatcher classes, so the framework implements an Observer notification scheme for communication between the Core MVC actors and other parts of the system in a loosely-coupled way. No need to create instance for the Observers and notificatios. These are inbuilt things in the pureMVC.</p>
<p><strong>Notifications</strong><br />
PureMVC implements the Observer pattern so that the Core actors and their collaborators can communicate in a loosely-coupled way, and without platform dependency.</p>
<p>Not simply a replacement for Events, Notifications operate in a fundamentally different way, and work synergistically with Events to produce extremely reusable View Components that need not even know that they are coupled to a PureMVC system at all if engineered properly.</p>
<p>Events are dispatched from Flash display objects that implement the IEventDispatcher interface. The Event is ‘bubbled’ up the display hierarchy, allowing the parent object to handle the Event, or the parent’s parent, etc.</p>
<p>Notifications are sent by the Facade and Proxies; listened for and sent by Mediators; mapped to and sent by Commands. It is a publish/subscribe mechanism whereby many Observers may receive and act upon the same Notification.</p>
<p><strong>WorkFlow of the PureMVC framework</strong></p>
<ul>
<li> MainApplication should startup the pureMVC framework by calling the ApplicationFacade(Facade)&#8217;s startup method.</li>
<li> ApplicationFacade Registers the Commands,Mediators and Proxies.</li>
<li> User can retrieve the Mediators and Proxies in the  ApplicationFacade.</li>
<li> Two commands are there: MacroCommand and SimpleCommand.</li>
<li> MacroCommand registers other commands, Mediators and Proxies.</li>
<li> SimpleCommand registers the Mediators and Proxies.</li>
<li> Both the Macro and Simple Commands can be used to retrieve the Mediators and Proxies.</li>
<li> User can send notifications from both the Macro and Simple commands.</li>
<li> Mediators registers the component with the PureMVC.</li>
<li> Mediators will listen for the events and notifications.</li>
<li> Mediators will listen for the events dispatched from the Components.</li>
<li> Mediators will listen for the notifications sent from the other  Mediators, Proxies and Commands.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/puremvc/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>RIA and Flex</title>
		<link>http://query7.com/ria-and-flex</link>
		<comments>http://query7.com/ria-and-flex#comments</comments>
		<pubDate>Mon, 27 Oct 2008 05:57:46 +0000</pubDate>
		<dc:creator>Ponbharathi Bakthaduruvan</dc:creator>
				<category><![CDATA[Flex]]></category>

		<guid isPermaLink="false">http://www.webdevelopmentbits.com/?p=103</guid>
		<description><![CDATA[<p><a href="http://query7.com/wp-content/uploads/riaic.png"><img class="alignnone size-full wp-image-107" title="riaic" src="http://query7.com/wp-content/uploads/riaic.png" alt="" width="102" height="15" /></a></p>
<p style="text-align: center;"><a href="http://query7.com/wp-content/uploads/ria.png"><img class="size-medium wp-image-104 aligncenter" title="ria" src="http://www.webdevelopmentbits.com/wp-content/uploads/2008/10/ria-300x300.png" alt="RIA" width="300" height="300" /></a></p>
<ul>
<li> A rich Internet application (RIA) is a Web application designed to deliver the same features and functions normally associated with deskop applications.</li>
</ul>
<ul>
<li>RIAs typically form a stateful client application with a separate services layer on the backend.</li>
</ul>
<ul>
<li>Run in a web browser, or do not require software installation</li>
</ul>
<ul>
<li>Run locally in a secure environment called a sandbox</li>
</ul>
<ul>
<li>Installation footprint is smaller &#8212; overhead for updating and distributing the application is trivial, or significantly reduced compared to a desktop or OS native application</li>
</ul>
<ul>
<li>Updates/upgrades to new versions can be automatic or transparent to the end user</li>
</ul>
<ul>
<li>Users can use the application from any computer with an internet connection</li>
</ul>
<ul>
<li>Many tools exist to allow off-line use of applications, such as Adobe AIR, Google Gears, Curl, and other technologies</li>
</ul>
<ul>
<li>Most RIA techologies allow the user experience to be consistent, regardless of what operating system the client uses.</li>
</ul>
<ul>
<li>Web-based applications are generally less prone to viral infection than running an actual executable</li>
</ul>
<p><a href="http://query7.com/wp-content/uploads/flexic.png"><img class="alignnone size-medium wp-image-108" title="flexic" src="http://query7.com/wp-content/uploads/flexic.png" alt="" width="95" height="16" /></a></p>
<div class="mceTemp mceIEcenter">
<dl id="attachment_105" class="wp-caption aligncenter" style="width: 510px;">
<dt class="wp-caption-dt"><a href="http://query7.com/wp-content/uploads/flex.png"><img class="size-full wp-image-105" title="flex" src="http://query7.com/wp-content/uploads/flex.png" alt="Flex" width="500" height="83" /></a></dt>
</dl>
</div>
<p style="text-align: center;"><a href="http://query7.com/wp-content/uploads/flex-builder.jpg"><img class="size-medium wp-image-106 aligncenter" title="flex-builder" src="http://www.webdevelopmentbits.com/wp-content/uploads/2008/10/flex-builder-300x272.jpg" alt="Flex Builder IDE" width="300" height="272" /></a>&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://query7.com/wp-content/uploads/riaic.png"><img class="alignnone size-full wp-image-107" title="riaic" src="http://query7.com/wp-content/uploads/riaic.png" alt="" width="102" height="15" /></a></p>
<p style="text-align: center;"><a href="http://query7.com/wp-content/uploads/ria.png"><img class="size-medium wp-image-104 aligncenter" title="ria" src="http://www.webdevelopmentbits.com/wp-content/uploads/2008/10/ria-300x300.png" alt="RIA" width="300" height="300" /></a></p>
<ul>
<li> A rich Internet application (RIA) is a Web application designed to deliver the same features and functions normally associated with deskop applications.</li>
</ul>
<ul>
<li>RIAs typically form a stateful client application with a separate services layer on the backend.</li>
</ul>
<ul>
<li>Run in a web browser, or do not require software installation</li>
</ul>
<ul>
<li>Run locally in a secure environment called a sandbox</li>
</ul>
<ul>
<li>Installation footprint is smaller &#8212; overhead for updating and distributing the application is trivial, or significantly reduced compared to a desktop or OS native application</li>
</ul>
<ul>
<li>Updates/upgrades to new versions can be automatic or transparent to the end user</li>
</ul>
<ul>
<li>Users can use the application from any computer with an internet connection</li>
</ul>
<ul>
<li>Many tools exist to allow off-line use of applications, such as Adobe AIR, Google Gears, Curl, and other technologies</li>
</ul>
<ul>
<li>Most RIA techologies allow the user experience to be consistent, regardless of what operating system the client uses.</li>
</ul>
<ul>
<li>Web-based applications are generally less prone to viral infection than running an actual executable</li>
</ul>
<p><a href="http://query7.com/wp-content/uploads/flexic.png"><img class="alignnone size-medium wp-image-108" title="flexic" src="http://query7.com/wp-content/uploads/flexic.png" alt="" width="95" height="16" /></a></p>
<div class="mceTemp mceIEcenter">
<dl id="attachment_105" class="wp-caption aligncenter" style="width: 510px;">
<dt class="wp-caption-dt"><a href="http://query7.com/wp-content/uploads/flex.png"><img class="size-full wp-image-105" title="flex" src="http://query7.com/wp-content/uploads/flex.png" alt="Flex" width="500" height="83" /></a></dt>
</dl>
</div>
<p style="text-align: center;"><a href="http://query7.com/wp-content/uploads/flex-builder.jpg"><img class="size-medium wp-image-106 aligncenter" title="flex-builder" src="http://www.webdevelopmentbits.com/wp-content/uploads/2008/10/flex-builder-300x272.jpg" alt="Flex Builder IDE" width="300" height="272" /></a></p>
<p style="text-align: center;">
<ul>
<li>Open source framework used to develop the RIAs</li>
</ul>
<ul>
<li>Highly productive development</li>
</ul>
<ul>
<li>Created applications run across all browsers and desktops</li>
</ul>
<ul>
<li>Highly maintainable and scalable solutions</li>
</ul>
<ul>
<li>Flex is Flash based</li>
</ul>
<ul>
<li>Flex gives powerful environment for data-driven apps using Actionscript and MXML</li>
</ul>
<ul>
<li>Flex has no timeline</li>
</ul>
<ul>
<li>Flex is 100% code based solution</li>
</ul>
<ul>
<li>Flex can be used in parallel with Flash</li>
</ul>
<ul>
<li>2 languages    ▫ MXML    ▫ ActionScript 3</li>
</ul>
<ul>
<li> Flex    Builder IDE</li>
</ul>
<ul>
<li>Compilers, Debuggers and profilers</li>
</ul>
<ul>
<li>Rich Component Library</li>
</ul>
<ul>
<li>Flex Builder IDE</li>
</ul>
<ul>
<li>Wide range of communication   ▫ HTTPService    ▫ WebService   ▫ RemoteObject</li>
</ul>
<ul>
<li>Web Services Introspection &#8211; Generate code from WSDL and enables code hinting</li>
</ul>
<ul>
<li>Data Wizards &#8211; Generating both server and client code</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://query7.com/ria-and-flex/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

