The abstract computer class would have the methods for mounting all the components of a computer and
also a generic method that will call each and every method that is defined here in this class for the
two classes that are inheriting this abstract computer for for the first one for the tower computer.
We don't modify anything because essentially this will this will cover everything that needs to be done
for a tower computer.
However, for the quantum computer, we have a different implementation.
So for the processor and for the cooling, we require some special types.
So we have those overwrites for these two methods.
Over here, the upper class is pretty basic.
So basically we are instantiating and computer for our computer and we build it and we should see all
these systems that print the letters in the console.
However, when we instantiate the same computer as a quantum computer and we call this computer, we
should see the new implementations, the limitations that are specific for this type.
So this is pretty simple.
This is basic inheritance.
So this is what this template method is about.
Of course, this is an overly simplified example, but you can have many, many other examples.
So essentially, this can be used whenever you have such a type of inheritance.
So whenever you can have a basic product that can have some some methods for achieving something, for
achieving an action like building something, building a house, building a computer, any type of object,
and also when you have special flavors for the same types that that can be implemented in subclasses
that can inherit, extend this abstract object and implement their own version of that specific action.
So let's see this in action.
Let's start.
The main method here, so we would expect to see this, which is which is normal for the tower computer,
which doesn't have any any additional method, any additional action or any difference in what is expected
to to be mounted.
What are the components that are expected to be mounted here?
But the quantum computer, however, has to methods like we've seen that are different.
So basically these are the differences between the two computers and those differences are highlighted
in the two subclasses.
All right.
So that's it for this tutorial mean and this one where we are going to discuss about the visitor pattern.
Of course, you can download the code for for this pattern.
You can play with it.
I strongly encourage you to do this because this is the best way to actually get a firm grasp on on
this information.
So see you in a story on.