Before I begin to write summary, what is "Object-Oriented Programming concepts?"
"Object-Oriented Programming" is a programming paradigm that views a computer program as a combination of data structure.
So what we learned in csc148 about "Object-Oriented Programming concepts?"
We learned about formatting parent class with several methods such as __str__, __eq__, __init__, and etc, and formatting subclasses based on its super class.
Basically when we write the super class, sometimes several methods in super class are written as 'NotImplentedError'. This is because super class does not specify only one specific subclass, but it is a 'general class' that contains several subclasses' general information at one time.
For the subclasses, now we write the code that what we need to implement. If the method is already existed in its super class, and it does not need to extend, then you can simply skip it. However when you feel it needs some extension, then you write the code, and sometimes a new method for only itself.
Designing class and subclasses is not hard;
First before you start to write the code, draw a big picture how you are going to write.
then think what code you will need, and the appropriate names for each method and classes.
If you can do these two things, then you will be safe in "object-oriented programming."
I also feel difficulties designing classes at first time, but the practice helped me a lot.
Assignment 1 really helped me, and first two labs too.
No comments:
Post a Comment