On Mon, Jun 4, 2012 at 3:31 PM, Nickolay Platonov <[email protected]> wrote: > I'll just mark some wrong (misunderstood) points about Joose: > > On Sun, Jun 3, 2012 at 11:50 AM, Nodir Turakulov <[email protected]> > wrote: >> >> Thanks for pointing out to Joose! A powerful class system indeed. I think >> I'll borrow some features. >> >> Here is my humble opinion on Joose. >> >> Method overrides >> I wonder why method overrides are put to "overrides" builder. Besides >> unnecessary complexity and aspect smearing, it is inconsistent with >> attribute overriding: to override an attribute you need to just re-declare >> it. Method overriding syntax could be the same. > > > Methods and method overrides are different concepts.
I wonder whether attributes and attribute overrides are different concepts? > If you need to > re-define some method in the subclass, you just declare it as usual method > (in "methods"). There are special rules about composition of methods defined > in roles. If you need to override a _method_ in some class, you can use an > "_override method modifier_" >> >> Attributes >> >> However, there is design a decision that I find dangerous: a constructor >> parameters are generated based on the order of "has" attributes. > > > This is completely wrong, where did you find this? Looks like you have an outdated or wrong sample. Take a look here: http://joose.github.com/Joose/doc/html/Joose/Manual/Unsweetened.html Pay attention to the generated code: --------------- Person = function (firstName, lastName) { if (!firstName) throw "Required attribute 'firstName' was not provided to constructor" if (!lastName) throw "Required attribute 'lastName' was not provided to constructor" ... --------------- Perhaps it must be --------------- Person = function (attrs) { if (!attrs.firstName) throw "Required attribute 'firstName' was not provided to constructor" if (!attrs.lastName) throw "Required attribute 'lastName' was not provided to constructor" ... --------------- Thanks, -Nodir > >> Roles >> As far as I understand, a role cannot "do" other roles. > > > Of course they can. > > -- > Job Board: http://jobs.nodejs.org/ > Posting guidelines: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > You received this message because you are subscribed to the Google > Groups "nodejs" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/nodejs?hl=en?hl=en -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
