J
J
jtag2018-06-26 18:05:44
OOP
jtag, 2018-06-26 18:05:44

Whether to use inheritance?

There is a device class inside which there should be three sockets. Do I need to use the device inheritance from the socket class here? In the example below, it is implemented simply by connecting a file and declaring sockets.
5b3255730cba4916649261.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
D3lphi, 2018-06-26
@msa6886

Inheritance is applied if it is possible to say that something is something. For example, a developer is an employee; the computer is a device, and so on.

Ask yourself the question: "Is the device a socket?" and you'll understand right away.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question