New answers tagged class-design
1
vote
For non-container classes, are "better naming" and "ready for commented codes" good reasons not to declare the most abstract type?
Your problems boil down to two things:
The "most abstract type" depends on what you do with the object
Variable names should tell you what the reader needs to know, not what the compiler ...
1
vote
For non-container classes, are "better naming" and "ready for commented codes" good reasons not to declare the most abstract type?
Type strategy has nothing to do with what kind of class you're dealing with, it applies to Containers in the same way as to non-containers. If all you do is drive(), then you should deal with a Car ...
0
votes
What is good practice when inheriting static classes isn't possible/allowed
I am very late to this party but will add an approach I often use in case it helps anyone in the future: The OOP principle of "composition over inheritance".
If I have multiple static ...
Top 50 recent answers are included
Related Tags
class-design × 442object-oriented × 135
object-oriented-design × 87
c# × 78
design × 59
design-patterns × 52
java × 50
c++ × 49
class × 34
python × 27
class-diagram × 23
inheritance × 22
uml × 19
php × 18
architecture × 16
programming-practices × 15
coding-style × 15
single-responsibility × 15
methods × 13
refactoring × 11
interfaces × 11
solid × 11
constructors × 10
database × 9
encapsulation × 9