Questions tagged [object-oriented]

Object-oriented programming is a programming paradigm using "objects": data structures consisting of data fields and methods together with their interactions.

Filter by
Sorted by
Tagged with
1 vote
0 answers
19 views

By creating an architecture, it is better to have many classes that handles different scenarios, or a single one that handles all?

During my limited professional experience, I have been involved in microservices projects with a common structure: The Controller takes a request and validates it using the jakarta.validation....
Paul Marcelin Bejan's user avatar
1 vote
2 answers
82 views

Domain Driven Desing aggregate for ticket booking

What do you think about this aggregator (DDD) for booking and cancelling tickets? Is it ok, or would you do it differently somehow? ...
Nofenak's user avatar
  • 11
2 votes
1 answer
55 views

Data structure to hold elements for script execution

I am building a solution to iterate over Python scripts in a folder and execute them. Each script will return a Pandas data-frame which needs to be saved as a Parquet file. The first stage is the data ...
Imtiaz's user avatar
  • 55
3 votes
1 answer
83 views

Sequentially find the indexes of an element into a collection

Util class to find into a collection the indexes of a given element with multiple occurrences from the first index or relative to a given index. ...
user avatar
2 votes
1 answer
106 views

PHP CSV Parser: Separation of concerns and SOLID principles

I implemented a CSV Parser with Separation of concerns and SOLID principles in mind. Does that code match the principles? Here a sample data (CSV): ...
dev-chicco's user avatar
1 vote
1 answer
134 views

Interview task model implementation(Event Source Java)

I've got a task to implement simple event source and i did: project Events structure ...
verbedt's user avatar
  • 11
0 votes
1 answer
51 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 ...
SumNeuron's user avatar
  • 271
0 votes
1 answer
132 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 ...
Jyothish Bhaskaran's user avatar
2 votes
1 answer
91 views

Metronome app with GUI

I have a working metronome app with a GUI, built using Python. I use an Android app called Pro Metronome which I like, and I wanted to build a simplified version of it as a project. My goal was to ...
dg0802's user avatar
  • 51
1 vote
2 answers
79 views

Verification job with multiple type of batch verifiers

I have a use case where a verification batch job (non-generic) verifies domains based on its input e.g domain_type, batch_pointer etc. The verification handles it based on the domain type which uses ...
user3239193's user avatar
1 vote
1 answer
118 views

Business logic verification template

I have a use case of template design pattern with generics as mentioned below. I have AbstractVerificationHandler that provides template for verification business ...
user3239193's user avatar
2 votes
2 answers
114 views

Defining hardware components structure

I'm writing firmware for my Arduino project, and I'm struggling with a clean, scalable hardware mapping structure. Initially, I had the following namespace: ...
Dead1nside's user avatar
3 votes
1 answer
135 views

Highly flexible tic-tac-toe terminal game in python

I have created a two-file tic-tac-toe game, with board.py containing most of the internal workings of the playing board. I intended to have ...
norway-yv's user avatar
  • 141
13 votes
3 answers
2k views

A Simple Tetris game made with C++ and ncurses

I made a Tetris game with C++ and ncurses. The game implemented the most core rules of the game such as 7-bag system or familiar rules you know about the Tetris, but lacks some features - for example, ...
Doyoung Kim's user avatar
5 votes
1 answer
96 views

Bank account class simulator with possible exception

I'm a newbie to python object oriented programming, Unfortunately in all the ways, Classes that I write turn into a true mess. I'd be glad if someone would be able to point me some of my mistakes. <...
KhodeNima's user avatar
  • 167
0 votes
1 answer
56 views

DDD Aggregate for seat booking in cinema - is my model correct?

I created a DDD aggregate for booking seats in cinema. Is it corect or it should be model in other way? Business rules: 1.Seat can be booked at least 1h before screening 2.Screening can has only 1 ...
Nofenak's user avatar
  • 11
4 votes
1 answer
131 views

Cellular Automata Python Class

I've been working on creating a simple Class for a Cellular Automata. It generates a grid of NxM dimensions populated by Cell objects - Pretty straightforward class to save the state of the cell-. It ...
Athansya's user avatar
-3 votes
1 answer
219 views

Design a set to classes to report battery/power status of different Alexa devices

I was asked below quesion in Amazon sde2 low level design interview recently and I have shown below my solution during the interview. I was rejected in this round. ...
sachin's user avatar
  • 45
5 votes
1 answer
68 views

Metaclass Wrapping Builtin to Enforce Subclass Type

This metaclass utility is written to make subclassing builtins easier, such as int, str, and most importantly, ...
ToAskOrNotToAsk's user avatar
-2 votes
1 answer
58 views

C++ compile time polymorphism example [closed]

I found an example using std::variant to provide compile time polymorphism as a possible optimisation to runtime polymorphism in 'Software Architecture Using C++', https://github.com/PacktPublishing/...
arcomber's user avatar
  • 2,449
1 vote
1 answer
110 views

Username and Password checker for invalid entries

I'm very new to programming and coding and "wrote" my first program from scratch as an at home exercise after doing some online courses. My question is not necessarily a problem I'm having ...
FloorSign's user avatar
1 vote
1 answer
63 views

Flowers in the Window: An Exercise in Using Classes and Objects in Rust

The Problem As part of my doomed efforts to learn Rust, I decided to get to grips with how the language handles classes and objects. But, instead of taking on some well-known exercise, I thought it ...
Tom Hosker's user avatar
3 votes
0 answers
173 views

A vehicle database in Excel

I'm looking for some help. I'm new to coding and have started creating this Vehicle database program in Excel for a friend to use. He is wanting to be able to see all vehicles he owns, when ...
Kendall Briggs's user avatar
-1 votes
1 answer
79 views

Continuous Delivery : Maintaining Feature flags and Newer Implementations behind feature toggles [closed]

Problem Statement I have a class named Mapper and with a method mapTo which goes through a map of rows and checks types of key and do a casting and store it in a ...
SRJ's user avatar
  • 237
1 vote
1 answer
84 views

Improved Component-Entity-System Using C++

Introduction I am a newbie, so please take me easy :). I am writing a low-level game engine using C++, GLFW and also OpenGL. This is a continuation of Entity Component System Using C++ I've ...
Andrei Rost's user avatar
1 vote
0 answers
47 views

Python CLI tool - automatic mapping from models to parameters with Click

I was working on a small python CLI tool using the Click library for the first time and realized I was defining parameters and mappings from them to objects/classes in multiple places and anytime I ...
Coupcoup's user avatar
  • 1,067
-2 votes
2 answers
126 views

Applying the __add__ operator on all fields of a Python object

I have a class for which I want to overload __add__ to mean adding all fields between obj1 and ...
Alexis Drakopoulos's user avatar
2 votes
1 answer
164 views

Entity Component System Using C++

Introduction I'm a new to C++ so please take me easy :) I am currently working on a low-level game engine using C++, OpenGL, and GLFW; I've implemented the Event System and the Input Manager, which ...
Andrei Rost's user avatar
3 votes
1 answer
165 views

Improved Event System & InputManager Using C++

I am new to C++, so please take me easy. I want to make a low-level game engine only using C++, OpenGL and GLFW. This is a continuation of Event System using C++ ; I added the suggestions from there. ...
Andrei Rost's user avatar
0 votes
2 answers
203 views

Printing the elements of a linked list [closed]

An absolute beginner here who is practising linked list problems in hackerrank. Stumbled upon this question which is categorised as easy. Given a pointer to the head node of the linked list, print ...
brucey's user avatar
  • 19
1 vote
0 answers
50 views

Event System in C++ [duplicate]

I am excited to share that I have developed an event system in C++. I have always been passionate about programming and have long aspired to create a low-level game engine solely using C++, OpenGL, ...
Andrei Rost's user avatar
3 votes
2 answers
2k views

Event System using C++

I am excited to share that I have developed an event system in C++. I have always been passionate about programming and have long aspired to create a low-level game engine solely using C++, OpenGL, ...
Andrei Rost's user avatar
3 votes
2 answers
93 views

A Python class for handling mortality (and lapse) probabilities

I'm developing a model in Python which produces IFRS and SII balance sheets for a hypothetical life insurance company. To value the hypothetical company's insurance liabilities, I need to project the ...
M Smith's user avatar
  • 147
4 votes
2 answers
150 views

Create classes for matrices, including inheritance

I've been learning C++ on and off, and recently learnt about overloading and templates. I wanted to used these concepts to create classes about matrices using ...
eccentricOrange's user avatar
3 votes
1 answer
94 views

Terminal Based Blackjack

This is my attempt at a terminal based blackjack game. Currently, the game does not support betting, although I intend to add it in the future. I would very much appreciate general feedback, but I am ...
Katie Grace Porter's user avatar
2 votes
2 answers
128 views

OOP tic-tac-toe

I have created my first personal project - tic tac toe game. It is my first time approaching code using Object-Oriented paradigm and I would like to get feedback on it and on aspects where I can ...
Ebrahim Al-Aghbari's user avatar
2 votes
2 answers
177 views

First app with JS in OOP

I've already started to creating apps in JS with OOP. I made simple TicTacToe Game in OOP and I want to ask you to review my code and point out everything that I can change about OOP. What is bad ...
Szymon Mińko's user avatar
3 votes
3 answers
184 views

Money class in python

I have recently created the Money class with a helper class Currency. What do you think about the following code? I created unit ...
lester's user avatar
  • 311
0 votes
1 answer
163 views

Python Logic Gate Circuit Simulator [closed]

I have recently become interested in simulating logic circuits because of a electronics class at school. I have created a functioning simulator for logic gate circuits in Python. My implementation ...
turt1edman's user avatar
1 vote
2 answers
179 views

Boolean Value Object

Purpose: I want to accept the value of a checkbox or database field and make a Value Object out of it. The input could be any of y, Y, n, N, Yes, No, yes, no, 1, 0, true, false, or NULL. In the case ...
Tim Morton's user avatar
3 votes
0 answers
99 views

Simple Network Time Server in C++ with improvements from prior code analysis

From code review: OO simple network time server with changes from a previous code inspection and added Windows support I made many changes as per the review comments. The code has been significantly ...
arcomber's user avatar
  • 2,449
2 votes
1 answer
96 views

QuadTree implementation in c++

I'm new on C++ and OOP. I wrote the following QuadTree implementation (I didn't wrote the remove object part yet). please take a look on it and provide feedback, mainly about C++ OOP design, ...
Joseph Hod's user avatar
6 votes
1 answer
290 views

C# Snake in Console

I've created Snake in Console. I've tried to make my code as good as I possibly could. (Code on github: https://github.com/bartex-bartex/SnakeCSharp) Question Is my coding style good enough, so I can ...
NeverDoomedEnough's user avatar
0 votes
0 answers
59 views

Multiple classes getting the output of a parallel process performing heavy computations

I have a python script with different classes performing various tasks. There is one class that performs heavy computations that are needed by other classes. I am using multiprocessing in order to do ...
firion's user avatar
  • 111
2 votes
2 answers
204 views

Complex numbers implementation in Rust

I am learning object oriented programming in Rust. I created my own struct for complex numbers. Could you please review and answer my questions: Is it possible to implement C++-like default ...
mascai's user avatar
  • 397
2 votes
1 answer
99 views

HTML form Class

After my previous question I revised the code to the code below. I am using PHP 7.0.33 and tried to accomplish PSR-12 as much as I could. In "condensed usage" in the docblock you can find a ...
julio's user avatar
  • 199
1 vote
1 answer
145 views

Version 2 of my Python Password Manager

I am still just starting out with python and just finished learning about classes, with no further understanding on many python modules. With this in mind, this is one of the biggest/hardest things I ...
Beginner's user avatar
  • 189
4 votes
0 answers
125 views

Python – RabbitMQ/Pika basic manager in OOP style

I created some classes for easier management of RabbitMQ and to practice OOP in Python. I would care about a few issues and any code advice would be appreciated :) is it a good practice to use the ...
TenSzalik's user avatar
4 votes
2 answers
79 views

A table backup application

The code works fine, but I'm not sure about the way I've created different functions and called them in others. I usually separate bigquery related functions to a utility module, but since there were ...
mankand007's user avatar
5 votes
1 answer
260 views

OO simple network time server with changes from a previous code inspection and added Windows support

I put up my SNTP Server code for review here: SNTPv4 server based on rfc 4330 in C++ a fortnight ago and since then I have made changes as per code review comments and also added support for Windows, ...
arcomber's user avatar
  • 2,449

1
2 3 4 5
75