Dear Prototypers,
I've been using the following technique for separating private and
public methods/variables in a class declaration.

Object.extend(myclass.prototype, function() {
        //private variables
        var attr1;
        var attr2;
        //private methods
        function meth1 () {}
        function meth2 () {}

        return {
                //public methods
                pub_meth1: function() {},
                pub_meth2: function() {}

I'm wondering if this is a good practice. Are there any insights that
i should be aware of? Are the private methods/functions being
duplicated for each of myclass instance?

Thanks in advance


You received this message because you are subscribed to the Google Groups 
"Prototype &" group.
To post to this group, send email to
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at

Reply via email to