<?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: Prototype vs. YUI round 1: OOP Architecture</title>
	<atom:link href="http://mattsnider.com/languages/javascript/prototype-vs-yui-round-1-oop-architecture/feed/" rel="self" type="application/rss+xml" />
	<link>http://mattsnider.com/languages/javascript/prototype-vs-yui-round-1-oop-architecture/</link>
	<description>Understanding JavaScript and Frameworks</description>
	<pubDate>Tue, 06 Jan 2009 07:27:18 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: admin</title>
		<link>http://mattsnider.com/languages/javascript/prototype-vs-yui-round-1-oop-architecture/comment-page-1/#comment-749</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Mon, 15 Oct 2007 23:05:23 +0000</pubDate>
		<guid isPermaLink="false">http://mattsnider.com/?p=14#comment-749</guid>
		<description>Joel,

Very true. For said reason, I also wouldn't use the YUI module pattern with a large and/or frequently reused object. I reserve the Module Pattern for Objects that are initialized once, such as business logic and widget management objects. 

However, I also wouldn't use the Prototype method, because you expose too much by attaching everything to the 'this' variable. Lately, I have been using a combination of overriding the prototype, lazy function definition, and proxy functions created using the Module Pattern.</description>
		<content:encoded><![CDATA[<p>Joel,</p>
<p>Very true. For said reason, I also wouldn&#8217;t use the YUI module pattern with a large and/or frequently reused object. I reserve the Module Pattern for Objects that are initialized once, such as business logic and widget management objects. </p>
<p>However, I also wouldn&#8217;t use the Prototype method, because you expose too much by attaching everything to the &#8216;this&#8217; variable. Lately, I have been using a combination of overriding the prototype, lazy function definition, and proxy functions created using the Module Pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joel</title>
		<link>http://mattsnider.com/languages/javascript/prototype-vs-yui-round-1-oop-architecture/comment-page-1/#comment-747</link>
		<dc:creator>Joel</dc:creator>
		<pubDate>Mon, 15 Oct 2007 21:53:37 +0000</pubDate>
		<guid isPermaLink="false">http://mattsnider.com/?p=14#comment-747</guid>
		<description>When you're talking about real-world objects with large or many functions in them, Prototype's approach to object creation is going to win in terms of memory usage, when you have multiple instances of the same object. Any methods attached to a class's "prototype" are shared between all instances of the class. Because YUI doesn't seem from your example to use the prototype object, every instance of the class will get its own copies of all the functions.</description>
		<content:encoded><![CDATA[<p>When you&#8217;re talking about real-world objects with large or many functions in them, Prototype&#8217;s approach to object creation is going to win in terms of memory usage, when you have multiple instances of the same object. Any methods attached to a class&#8217;s &#8220;prototype&#8221; are shared between all instances of the class. Because YUI doesn&#8217;t seem from your example to use the prototype object, every instance of the class will get its own copies of all the functions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Foo Hack &#187; YUI&#8217;s &#8220;Module Pattern&#8221; vs. Prototype&#8217;s Class Function</title>
		<link>http://mattsnider.com/languages/javascript/prototype-vs-yui-round-1-oop-architecture/comment-page-1/#comment-157</link>
		<dc:creator>Foo Hack &#187; YUI&#8217;s &#8220;Module Pattern&#8221; vs. Prototype&#8217;s Class Function</dc:creator>
		<pubDate>Mon, 13 Aug 2007 17:54:01 +0000</pubDate>
		<guid isPermaLink="false">http://mattsnider.com/?p=14#comment-157</guid>
		<description>[...] Geoffery Moller, I came across this article on Matt Snider&#8217;s blog. I&#8217;m surprised that no one noticed what (to me) was the most [...]</description>
		<content:encoded><![CDATA[<p>[...] Geoffery Moller, I came across this article on Matt Snider&#8217;s blog. I&#8217;m surprised that no one noticed what (to me) was the most [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://mattsnider.com/languages/javascript/prototype-vs-yui-round-1-oop-architecture/comment-page-1/#comment-18</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Mon, 21 May 2007 17:02:45 +0000</pubDate>
		<guid isPermaLink="false">http://mattsnider.com/?p=14#comment-18</guid>
		<description>Thanks for the comments Geoff. You make a good point.</description>
		<content:encoded><![CDATA[<p>Thanks for the comments Geoff. You make a good point.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: When Javascript Libraries Attack at geoffreymoller.com</title>
		<link>http://mattsnider.com/languages/javascript/prototype-vs-yui-round-1-oop-architecture/comment-page-1/#comment-17</link>
		<dc:creator>When Javascript Libraries Attack at geoffreymoller.com</dc:creator>
		<pubDate>Tue, 15 May 2007 21:27:57 +0000</pubDate>
		<guid isPermaLink="false">http://mattsnider.com/?p=14#comment-17</guid>
		<description>[...] This post at mattsnider.com talks extremely briefly about Javascript object creation. It goes on to compare Prototype&#8217;s class definition method versus the standard pattern present in the YUI Library. While I often favor an approach even more traditional than the YUI pattern, the Yahoo! pattern maintains encapsulation. The Prototype abstraction of class definition is a great example of &#8220;places where Javascript libraries shouldn&#8217;t go.&#8221; [...]</description>
		<content:encoded><![CDATA[<p>[...] This post at mattsnider.com talks extremely briefly about Javascript object creation. It goes on to compare Prototype&#8217;s class definition method versus the standard pattern present in the YUI Library. While I often favor an approach even more traditional than the YUI pattern, the Yahoo! pattern maintains encapsulation. The Prototype abstraction of class definition is a great example of &#8220;places where Javascript libraries shouldn&#8217;t go.&#8221; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoff Moller</title>
		<link>http://mattsnider.com/languages/javascript/prototype-vs-yui-round-1-oop-architecture/comment-page-1/#comment-16</link>
		<dc:creator>Geoff Moller</dc:creator>
		<pubDate>Tue, 15 May 2007 19:04:44 +0000</pubDate>
		<guid isPermaLink="false">http://mattsnider.com/?p=14#comment-16</guid>
		<description>I'm a big fan of Prototype's collections and DOM utils, but the OO implementation is curious.

The Class.create() method seems to eschew any sort of encapsulation - I'm not sure how that's OK, no matter what language we're working with. 

Also keep in mind the inheritance gotchas with Prototype:
http://www.encytemedia.com/blog/articles/2006/05/23/prototype-inheritance-madness</description>
		<content:encoded><![CDATA[<p>I&#8217;m a big fan of Prototype&#8217;s collections and DOM utils, but the OO implementation is curious.</p>
<p>The Class.create() method seems to eschew any sort of encapsulation - I&#8217;m not sure how that&#8217;s OK, no matter what language we&#8217;re working with. </p>
<p>Also keep in mind the inheritance gotchas with Prototype:<br />
<a href="http://www.encytemedia.com/blog/articles/2006/05/23/prototype-inheritance-madness" rel="nofollow">http://www.encytemedia.com/blog/articles/2006/05/23/prototype-inheritance-madness</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
