All Questions
Tagged with object-oriented inheritance
105 questions
2
votes
0
answers
71
views
Classes for Config and logical operators
I have a spring cloud gateway application with this yml structure for request validation:
...
1
vote
1
answer
72
views
Python 3.10+: an exploration of meta classes and subclasses through the lens of metric (SI) prefixes with subclass-able units and changeable bases
Problem Statement
From the National Institute of Standards and Technology's Office of Weights and Measures, one can find a handy list of all the metric prefixes:
e.g.
Purpose
Name
Symbol
Factor
Name
...
0
votes
1
answer
247
views
Calling the base method from overriden method to add some functionality
I have a small Linked list program which I created for just brushing up the concepts.
Following is my Node class
...
4
votes
1
answer
411
views
Abstract base class for binary serialization
Ensuring that some logic is always being run before the user's overriding methods.
I'm writing a library and I have some abstract classes that can be binary serialized (and users can subclass them and ...
0
votes
1
answer
483
views
Class that counts its instances
I'd love some feedback on the C++ base class shown below. It's basically a toy problem for a fake video game where the monsters that you have to avoid will all be sub-classed from the class shown ...
1
vote
0
answers
61
views
How was this python code analyze these classes with class diagram
Anyone please review my code and give some improvement suggestions.
I wrote code but not to the best standards. I think this site give some valuable suggestions
this code is for extracting xlsx or csv ...
1
vote
1
answer
482
views
Model animals using inheritance in Java
I was assigned the following problem:
You've gone back in time to 500BC Athens and Socrates wants you
to build him an app to help classify animals.
Build the classes ...
-1
votes
2
answers
88
views
Simple Vehicle speed representation [closed]
This code models two vehicle types, with a method to accept a string representing a boost to change speed.
How can I optimize performance in inheritance child class?
How can I reduce the code inside ...
1
vote
1
answer
2k
views
C# Coffee Machine
I saw this post and tried to do my attempt. This is the requirement of task:
Design a coffee machine which makes different beverages based on set
ingredients. The initialization of the recipes for ...
3
votes
2
answers
460
views
Alarm clock subclass of a clock
I have these two classes and they should remain separate classes, but I have a feeling that this could be implemented more efficiently and with less duplicate code. After googling around I still didn'...
2
votes
0
answers
95
views
what should be the best approach to follow DRY principle here
My first component
...
2
votes
3
answers
309
views
Builiding a Model from Stored Procedures
After reading that Data Classes can be considered a code smell, I am shifting from a pattern with many data classes and a single manager class that handles all the instantiation of the classes, to a ...
2
votes
1
answer
168
views
Noughts & Crosses (Final Version)
I've made a major update to my Noughts & Crosses program, this ISN'T a duplicate! I know it's not good to use system("pause") and system("cls"), however, I just wanted to make ...
4
votes
2
answers
385
views
Animal, Dog, and IDangerous - Using interfaces and inheritance with C#
I'm quite new to object-oriented C#. I wanted to test my knowledge by creating a Dog/Animal classes. I also tried to implement ...
4
votes
1
answer
3k
views
OpenGL Mesh Class
I've written a simple mesh class. The purpose of it is to build a mesh, draw it to the screen, and provide some means by which the mesh can be transformed/scaled, etc. This was done with GLAD, GLFW, ...