Now that you know what to expect from this set of articles, it’s time to summarize the topics covered in the last one. In that part of the series I started developing a basic example to demonstrate how to build a couple of polymorph classes that inherited most of their functionality from a base abstract class. To extend this explanation, the aforementioned base class encapsulated most of the logic required for creating generic HTML elements. This made it very easy to derive a subclass from it and provide this child entity with the ability to render basic HTML divs. Of course, it’s also fair to note that this example in its current state doesn’t clearly show how the class responsible for displaying divs on screen really behaves as a polymorph structure. However, if another child class is spawned from the corresponding parent, and it does display a different behavior when one of its methods gets called, then it’d be easy to demonstrate the polymorph nature of these classes, right? Well, that’s exactly what I’m going to do in the next few lines For this concrete example, the brand new subclass that I plan to build next will be tasked with creating some HTML paragraphs. Now, to learn how this will be done, click on the link below and start reading!
blog comments powered by Disqus |