<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
				<title>Comments on: OOP in JavaScript - Part 1: Writing classes</title>
		<link>http://www.phpdevblog.net/2009/09/oop-in-javascript-part-1-writing-classes.html</link>
		<description>OOP in JavaScript - Part 1: Writing classes Comment Feed</description>
				<language>de</language>
		<pubDate>Mon, 06 Sep 2010 07:07:49 +0000</pubDate>
		<generator>mcw[blog] 'Ruby' Alpha 3</generator>
		<item>
			<title>Comment #1 by: Paul</title>
			<link>http://www.phpdevblog.net/2009/09/oop-in-javascript-part-1-writing-classes.html#comment4661</link>
			<guid>http://www.phpdevblog.net/2009/09/oop-in-javascript-part-1-writing-classes.html#comment4661</guid>
			<author>Paul</author>			
			<pubDate>Mon, 14 Sep 2009 02:52:03 +0000</pubDate>
			<content:encoded><![CDATA[ Thanks for a much-needed blog topic! What do you think about declaring static classes with "new function" and using "var" for privates, "this" for publics?  I like this approach so far on my project because encapsulating all the methods and attributes together inside a class declaration is most like java and thus familiar for my team.  I have blogged about it here (see approach Three): http://paulmazak.blogspot.com/2009/03/javascript-classes.html  <br />
I'm curious if you still prefer prototyping after considering other ways to create OOP Javascript. ]]></content:encoded>
		</item>
		<item>
			<title>Comment #2 by: Dominik Jungowski</title>
			<link>http://www.phpdevblog.net/2009/09/oop-in-javascript-part-1-writing-classes.html#comment4674</link>
			<guid>http://www.phpdevblog.net/2009/09/oop-in-javascript-part-1-writing-classes.html#comment4674</guid>
			<author>Dominik Jungowski</author>			
			<pubDate>Mon, 14 Sep 2009 12:14:02 +0000</pubDate>
			<content:encoded><![CDATA[ Declaring static class with new: One could do that, I just don't see a benefit unless you do what you and I've done in the following passage.<br />
<br />
Using var for privates seems like a nice idea at first, but it's rather a "superprivate" since you only have the var in the scope of the concurrent function (like always in javascript) which makes it rather useless unless you declare the methods in the constructor otherwise none of your methods can use it:<br />
<br />
function Registry()<br />
{<br />
    var somestuff = '123abc';<br />
<br />
    this.get = function() {<br />
        return somestuff;<br />
    }<br />
}<br />
<br />
var reg = new Registry();<br />
alert(reg.get()); ]]></content:encoded>
		</item>
		<item>
			<title>Comment #3 by: Vlad Dumitrica</title>
			<link>http://www.phpdevblog.net/2009/09/oop-in-javascript-part-1-writing-classes.html#comment4731</link>
			<guid>http://www.phpdevblog.net/2009/09/oop-in-javascript-part-1-writing-classes.html#comment4731</guid>
			<author>Vlad Dumitrica</author>			
			<pubDate>Tue, 15 Sep 2009 10:54:10 +0000</pubDate>
			<content:encoded><![CDATA[ I think will be a n interesting series of articles.<br />
<br />
I'd rather go with encapsulation, so I prefer something like this (a variant of Paul's "Three" version):<br />
Test = function(){<br />
    var privateData = {<br />
        appVersion: '0.1 alpha'<br />
    };<br />
    <br />
    var publicData = {<br />
        getVersion: function(){<br />
            return (privateData.appVersion);<br />
        }<br />
    };<br />
    <br />
    return publicData;<br />
}(); ]]></content:encoded>
		</item>
		<item>
			<title>Comment #4 by: Marcus B</title>
			<link>http://www.phpdevblog.net/2009/09/oop-in-javascript-part-1-writing-classes.html#comment4739</link>
			<guid>http://www.phpdevblog.net/2009/09/oop-in-javascript-part-1-writing-classes.html#comment4739</guid>
			<author>Marcus B</author>			
			<pubDate>Tue, 15 Sep 2009 14:09:05 +0000</pubDate>
			<content:encoded><![CDATA[ The Bindows framework (http://www.bindows.net) is one of the most complete Ajax frameworks, and it uses prototype-based OOP throughout. There is a short introduction to JavaScript OOP in the Bindows user's manual (http://www.bindows.net/documentation/download/bindows_manual.pdf) p. 18 and onwards. It shows nicely how prototype-based OOP is flexible enough to accommodate a model that looks sufficiently close to class-based OOP that programmers with, say, a Java background can feel comfortable.<br />
<br />
The Bindows model does not use encapsulation, instead relying on conventions for property accessors and public/private members. ]]></content:encoded>
		</item>
		<item>
			<title>Comment #5 by: shaffy</title>
			<link>http://www.phpdevblog.net/2009/09/oop-in-javascript-part-1-writing-classes.html#comment16784</link>
			<guid>http://www.phpdevblog.net/2009/09/oop-in-javascript-part-1-writing-classes.html#comment16784</guid>
			<author>shaffy</author>			
			<pubDate>Fri, 13 Aug 2010 05:20:35 +0000</pubDate>
			<content:encoded><![CDATA[ Thanks ]]></content:encoded>
		</item>
		</channel>
</rss>