Polymorphism, Overriding, & Overloading

Here, Helen, Anu, Ryan, Preston, Fabio, Jeremy, Sid, Robert, and Edmund set on the path to learn the complex method of how Angular JavaScript is implemented to program applications. Specifically, we are introduced to NodeJS, Visual Studio Code, TypeScript (ES6 JavaScript) and (most importantly) the MVC design pattern to build web applications. This is a big topic and this course might not make us into Angular JavaScript programmers; yet, it will give us a "high level understanding" to succeed at further "code" lessons that are available on the Web. Lots of theory along with nitty-gritty syntax details will be addressed.
Post Reply
Posts: 2
Joined: Wed Jan 09, 2019 6:40 pm

Polymorphism, Overriding, & Overloading

Post by ryanpenn » Mon Mar 18, 2019 11:41 am

Great article written by a Java developer explaining the complex concept of polymorphism in more simple terms. Basically, this article refutes what is written in the book as the INCORRECT definition of polymorphism. As a seasoned veteran, I agree with what's written in the article instead. A good 5 minute read...

https://www.programcreek.com/2009/02/ov ... -examples/

User avatar
Posts: 148
Joined: Mon Apr 16, 2018 1:03 pm

Re: Polymorphism, Overriding, & Overloading

Post by james » Wed Mar 20, 2019 3:45 pm

I absolutely love (like) when we programmers disagree on some of this shit.... (Can I say that?)

No Really: The above post draws on some interesting aspects of polymorphism.

(From https://www.webopedia.com/TERM/P/polymorphism.html)

Polymorphism: In object-oriented programming, polymorphism refers to a programming language's ability to process objects differently depending on their data type or class.

It would be fun to see what the book actually says about this idea of using the same name for a method that was already defined in a higher class....

But, In defense of the messed-up, weird-ed out, loosely-typed, interperupted (not compiled), hodgepodge, JavaScript Language ... well, oh boy; nothing it does in the area of Class based OOP is standard. So, yeah, JavaScript-Polymorphism is not standard. And this brings out an interesting (General) aspect of TypeScript. It doesn't do Class OOP very well. Classes and higher order Classes don't perform very well...NOTHING like they do with more efficient Languages like Java, C++, PHP, etc... .

An error was found in the TypeScript chapter that goes against conventional Class based OOP ???

It doesn't surprise me .... good find.

Let me mention one aspect of TypeScript Classes that was mentioned earlier in the class:

Think of a Class returning a set of Types.

This is a weird thought because we sometimes think of a Class as being the mold that makes a variable kind of structure... and it returns stuff. Stuff that fits into a Class based OOP structure. An Object gets instantiated and created by the internal Constructor. To put stuff into that object we gotta use a SETTER function ... and to get stuff out of that object we gotta use the GETTER function.

THAT's logical. THAT makes sense.

(enter TypeScript)

One more time:

Think of a JavaScript Class as something that returns a set of TYPES.

No values, no variables, no functions, nor events ... but TYPES. From these "types" we can build new Objects.

... it would be great to look at this during our class-time!



Post Reply