1

We are using Prototype.js framework for OOP. I know you can do class inheritance easily. You can do callbacks easily. So, is there a way to implement an OOP "interface"? Or, do we have to stay with class inheritance?

wxactly
  • 2,400
  • 1
  • 26
  • 42
biajee
  • 565
  • 1
  • 4
  • 20
  • Also, is there a better way to implement OOP in javascript? – biajee Aug 08 '12 at 18:22
  • Javascript does OOP just fine, if you don't get hung up on trying to do it like Java does. :) – cHao Feb 11 '13 at 05:37
  • 1
    Highly related: http://stackoverflow.com/questions/3710275/does-javascript-have-the-interface-type-such-as-java-interface/3710367#3710367 -- my answer goes a bit into why JS doesn't have Java-style interfaces (and to a degree, why they wouldn't be worth having anyway). – cHao Feb 11 '13 at 05:40

0 Answers0