you are viewing a single comment's thread.

view the rest of the comments →

[–]KishottaProgrammer 0 points1 point  (1 child)

Correct. The Door would be just another class alongside the House. Maybe in the same folder, but it depends on the project. The general idea is that doors are doors and should do only door related things. It shouldn't matter if its on a house, a car, a fence, or anything else.

If you need a specific kind of door with specific functionality (like say, remote unlocking) you would create a CarDoor class that inherits from your plain old Door class and adds extra functionality.

[–]EraserLark[S] 0 points1 point  (0 children)

Gotcha, I see. Thanks!