This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Object Oriented Javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Object Oriented Javascript" Watch "Object Oriented Javascript" New topic
Author

Object Oriented Javascript

sridhar row
Ranch Hand

Joined: Jan 16, 2008
Posts: 162
Hi Stoyan, congrats on your new book. I don't have much knowledge in javascript but i think its sometimes fun to work with it as long as the browser discrepancies don't come into play.
Does your book address object oriented topics such as polymorphism, multiple inheritance, and type casting? Can we create new classes, interfaces and use them like regular java? What is the best way you think is to solve the browser discrepancies issues? Can we come up with something that can work on all browsers just like java works on all platforms? Thanks.
Stoyan Stefanov
author
Ranch Hand

Joined: Jul 16, 2008
Posts: 61
Hi Sridhar, and thanks! Quite a few interesting questions here

Does your book address object oriented topics

yes, as the title suggests (sorry, I couldn't resist interrupting your sentence here)

such as polymorphism, multiple inheritance,

yep

and type casting?

you don't need type casting is a dynamically typed language, yeey!

Can we create new classes,

JavaScript doesn't have classes, but it has a class-look-like syntax which helps spread the confusion An object in JS is a hash and is defined as simply as:



The class-like alternative is to use constructor functions (JS has many uses for functions!).



There's an article I wrote for the JavaRanch newsletter, which will probably be published soon and will hopefully give you some more insights into this.

interfaces and use them like regular java?

You can fake interfaces but it will require a little discipline on your end, as javascript will not check if you've implemented all methods and won't complain if you don't.

What is the best way you think is to solve the browser discrepancies issues?

A good way is to use a library, such as jQuery or YUI to "normalize" the browsers.

Can we come up with something that can work on all browsers just like java works on all platforms? Thanks.

Oh, yeah, people ship complex JS applications all the time.


<a href="http://www.thinkinginjavascript.com" target="_blank" rel="nofollow">my OOJS book</a>
sridhar row
Ranch Hand

Joined: Jan 16, 2008
Posts: 162
Thanks Stoyan for answering my questions. I would definitely love to read your book and looking forward to buying it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Object Oriented Javascript
 
Similar Threads
DOM
Why is the book titled "Object-oriented JavaScript"?
For the author (Frank Zammetti)
OB or OO?
wich ide is the best suit for developing with ajax