Questions tagged [class]
A template for declaring a type of object.
306 questions
1 vote
3 answers
223 views
Calendar modeling in class diagram
I am creating a cinema website focused on client services, where clients can reserve tickets for movies and browse the cinema's schedule (both daily and weekly). The schedules will be managed by an ...
-2 votes
1 answer
329 views
What is a component in C#?
Introduction Components are an important building block of software. In terms of software architecture, there are a lot of principles regarding components that should be adhered to (high cohesion, low ...
-2 votes
1 answer
524 views
Defining functions inside vs outside a class
Say I have a class with a function do_thing that is comprised of multiple steps, which themselves segregate into functions (first_process and second_process). At what point would this be considered ...
2 votes
1 answer
2k views
In Python when is absolutely preferable to use a class instead of a module?
Python is the language I use most in this period. My background in Java Before start learning Python I have programmed in Java language. In Java all code is written inside the methods of a class and ...
0 votes
5 answers
2k views
Comparing Java objects with different member variables
I have a base class "People" which two other classes inherit from: Employee and Student. The Student class includes a GPA (type double) and the Employee class does not. I have an ArrayList ...
2 votes
2 answers
157 views
What is the threshold of "usage" of a parent class member that should move to child class?
For example, for base and child classes, if all child class need a class member, eg: baseHp, which represents the base hp to calculate the actual hp of monsters in a game: public class Monster{ ...
2 votes
3 answers
1k views
Why do we need factories in the first place?
I went through various blogs but nowhere I can find the reason of having virtual constructors in C++. Why is virtual constructor needed and lets say if we go through the wrong way of creating virtual ...
9 votes
4 answers
4k views
How to analyze and understand the use/application of a "class" in a colossal million-line legacy code base?
I am working on a huge code base (more than a million lines of code with a sophisticated architecture) written in C++ over the span of a couple of decades. The task on which I'm working at this point ...