<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	Comments on: XML vs. AS2 part Deux &#8211; scoping callbacks: Inheritance	</title>
	<atom:link href="https://jessewarden.com/2004/02/xml-vs-as2-part-deux-scoping-callbacks-inheritance.html/feed" rel="self" type="application/rss+xml" />
	<link>https://jessewarden.com/2004/02/xml-vs-as2-part-deux-scoping-callbacks-inheritance.html</link>
	<description>Software &#124; Fitness &#124; Gaming</description>
	<lastBuildDate>Sat, 28 Feb 2004 10:33:49 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: Matthew		</title>
		<link>https://jessewarden.com/2004/02/xml-vs-as2-part-deux-scoping-callbacks-inheritance.html/comment-page-1#comment-1438</link>

		<dc:creator><![CDATA[Matthew]]></dc:creator>
		<pubDate>Sat, 28 Feb 2004 10:33:49 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=451#comment-1438</guid>

					<description><![CDATA[Hi ? 

Grants original solution feels correct and analogous to Java anonymous classes.


public void aMethod ()
{

}

public void startThread ()
{
  new Thread(new Runnable ()
  {
    public void run ()
      {
        aMethod();
      }
  }).start();
}

Here in this example aMethod is scoped to the parent class, the same class the Thread was created.  Runnable is an interface instanciated as an anonymous class.  I cant be certain but I seem to remember the compiler has a hand in making the run method have access to the parent class.

Ive used many similar solutions in AS2, eg.

interface IRequest
{
  public function handleRequest (aRequest:Request)
}   


class Foo 
{

public function initHandlers ()
{
  var _this:Foo = this;

  // Create new instance of Irequest interface
  var aHander:IRequest = new IRequest ();
  // Define handleRequest method
  aHandler.handleRequest = function ()
  {
    _this.doSomething();
  }
  this.setRequestHandler(?XXX.YYY?, aHandler);
  }
}

Ive left some methods undefined however this seems to recreate the functionality of anonymous inner classes, using the activation object ?trick?.  Of course we could do all this without the interface ? however the interface is essential really. Its our contract, but also provides comment like reminders of what the code is doing.

So, I guess, my point is that grants method is my best practice, or atleast in some situations, thoughts anyone?

Matt
]]></description>
			<content:encoded><![CDATA[<p>Hi ? </p>
<p>Grants original solution feels correct and analogous to Java anonymous classes.</p>
<p>public void aMethod ()<br />
{</p>
<p>}</p>
<p>public void startThread ()<br />
{<br />
  new Thread(new Runnable ()<br />
  {<br />
    public void run ()<br />
      {<br />
        aMethod();<br />
      }<br />
  }).start();<br />
}</p>
<p>Here in this example aMethod is scoped to the parent class, the same class the Thread was created.  Runnable is an interface instanciated as an anonymous class.  I cant be certain but I seem to remember the compiler has a hand in making the run method have access to the parent class.</p>
<p>Ive used many similar solutions in AS2, eg.</p>
<p>interface IRequest<br />
{<br />
  public function handleRequest (aRequest:Request)<br />
}   </p>
<p>class Foo<br />
{</p>
<p>public function initHandlers ()<br />
{<br />
  var _this:Foo = this;</p>
<p>  // Create new instance of Irequest interface<br />
  var aHander:IRequest = new IRequest ();<br />
  // Define handleRequest method<br />
  aHandler.handleRequest = function ()<br />
  {<br />
    _this.doSomething();<br />
  }<br />
  this.setRequestHandler(?XXX.YYY?, aHandler);<br />
  }<br />
}</p>
<p>Ive left some methods undefined however this seems to recreate the functionality of anonymous inner classes, using the activation object ?trick?.  Of course we could do all this without the interface ? however the interface is essential really. Its our contract, but also provides comment like reminders of what the code is doing.</p>
<p>So, I guess, my point is that grants method is my best practice, or atleast in some situations, thoughts anyone?</p>
<p>Matt</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: andy makely		</title>
		<link>https://jessewarden.com/2004/02/xml-vs-as2-part-deux-scoping-callbacks-inheritance.html/comment-page-1#comment-1437</link>

		<dc:creator><![CDATA[andy makely]]></dc:creator>
		<pubDate>Fri, 27 Feb 2004 23:37:30 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=451#comment-1437</guid>

					<description><![CDATA[I&#039;d love an XML object that had these timeout/callback features, as well as Xpath functionality like this bit from Xfactor:
http://www.xfactorstudio.com/Actionscript/AS2/XPath

It amazes me that features like these aren&#039;t built in by MM, and always end up being added by diligent users after the fact.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;d love an XML object that had these timeout/callback features, as well as Xpath functionality like this bit from Xfactor:<br />
<a href="http://www.xfactorstudio.com/Actionscript/AS2/XPath" rel="nofollow ugc">http://www.xfactorstudio.com/Actionscript/AS2/XPath</a></p>
<p>It amazes me that features like these aren&#8217;t built in by MM, and always end up being added by diligent users after the fact.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: cadement		</title>
		<link>https://jessewarden.com/2004/02/xml-vs-as2-part-deux-scoping-callbacks-inheritance.html/comment-page-1#comment-1436</link>

		<dc:creator><![CDATA[cadement]]></dc:creator>
		<pubDate>Fri, 27 Feb 2004 19:52:11 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=451#comment-1436</guid>

					<description><![CDATA[Doh!  - in the time it took me to get around to typing the suggestion he up and posted exactly that solution :(]]></description>
			<content:encoded><![CDATA[<p>Doh!  &#8211; in the time it took me to get around to typing the suggestion he up and posted exactly that solution :(</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: cadement		</title>
		<link>https://jessewarden.com/2004/02/xml-vs-as2-part-deux-scoping-callbacks-inheritance.html/comment-page-1#comment-1435</link>

		<dc:creator><![CDATA[cadement]]></dc:creator>
		<pubDate>Fri, 27 Feb 2004 19:49:15 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=451#comment-1435</guid>

					<description><![CDATA[Alternately, you might try making the XMLWrapper implement the new event-handling model so that you could attach a listener from the container object.  That would get you where you want to go while still maintaining logical consistency with other classes you are using (assuming you&#039;re working primarily with the new component set and don&#039;t mind the slight extra processing overhead).]]></description>
			<content:encoded><![CDATA[<p>Alternately, you might try making the XMLWrapper implement the new event-handling model so that you could attach a listener from the container object.  That would get you where you want to go while still maintaining logical consistency with other classes you are using (assuming you&#8217;re working primarily with the new component set and don&#8217;t mind the slight extra processing overhead).</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Anonymous		</title>
		<link>https://jessewarden.com/2004/02/xml-vs-as2-part-deux-scoping-callbacks-inheritance.html/comment-page-1#comment-1434</link>

		<dc:creator><![CDATA[Anonymous]]></dc:creator>
		<pubDate>Fri, 27 Feb 2004 19:49:03 +0000</pubDate>
		<guid isPermaLink="false">http://jessewarden.com/?p=451#comment-1434</guid>

					<description><![CDATA[Alternately, you might try making the XMLWrapper implement the new event-handling model so that you could attach a listener from the container object.  That would get you where you want to go while still maintaining logical consistency with other classes you are using (assuming you&#039;re working primarily with the new component set and don&#039;t mind the slight extra processing overhead).]]></description>
			<content:encoded><![CDATA[<p>Alternately, you might try making the XMLWrapper implement the new event-handling model so that you could attach a listener from the container object.  That would get you where you want to go while still maintaining logical consistency with other classes you are using (assuming you&#8217;re working primarily with the new component set and don&#8217;t mind the slight extra processing overhead).</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
