I want to build some objects that have a little difference between them. But i wonder how would i do it - 1. build a class with some variables and build objects out of him, or - 2.build class for each object, with the functions dedicated to this 'only one' object.
Is there any difference between the two methods? It is clear that its much more simple to build a class for each object, and define the functions for this object in the class. What is the profit of make one class, and inherit many objects out of it, make it complicated to implement different functions for each object.
Jump to Post
I think that depends on your definition of "a little difference between them". Are there data differences, functional differences, or both? Do they have the same basic functionalities and just implement the functions differently?
This sounds like a generalization/specialization relationship, which would tend to imply an inheritance structure, but …
All 4 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.