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
27 views

Users CRUD in fastapi using pymongo

I am building users API with CRUD operation in fastapi and i'd love to hear feedback about it. I have been exploring fastapi in the past weeks and im trying to create API with best practice (scalable -...
Paul's user avatar
  • 11
5 votes
2 answers
192 views

2048 game in Java

I am a beginner learning Java, and I coded a command line version of the game 2048 for practice. Any feedback, especially regarding best practices, object-oriented principles, and tidying up the code ...
smwt's user avatar
  • 187
2 votes
3 answers
1k views

Math calculation JavaScript. Am I using Objects correctly? Can I use methods / functions to shorten my code further? Also error logging?

Context- CRM system, front-end form. Requirement- Within a form users have to give a rating to a section based on user inputs, each rating has different weighting. The rating is stored in an option ...
BenDev21's user avatar
5 votes
2 answers
69 views

Geospatial application in python using OOP

I'm working on a tool that performs some computations using elevations from a DTM file retrieved from a WCS service. These computations will be done on predefined regions of Europe. I'm trying to ...
stray_dog's user avatar
0 votes
0 answers
56 views

Designing Multiprocess signaling and communication

Originally I meant to discuss my entire project on stepper motors for Raspberry Pi. But I see that's out of scope. If you'd like to provide high level feedback, welcome to do so in github. The lack of ...
juanmf's user avatar
  • 121
0 votes
1 answer
71 views

Reassure user that python code is running during long imports

I have created a large module for downloading data from SAP and editing and displaying it on a plotly dashboard. While the code is running as desired there is one problem that bugs me: The submodules ...
Jan_B's user avatar
  • 109
1 vote
2 answers
79 views

Java Queue data structure

Could you review this implementation of a queue data structure according to the principles of Object Oriented Programming and Clean Code? ...
Cardstdani's user avatar
2 votes
3 answers
190 views

Java Clean Code, use of enums in data structure

I have defined a data structure in Java that allows to manage certain type of elements like a Queue, with the special feature of using 2 inner rows (windows) to attend elements: ...
Cardstdani's user avatar
4 votes
1 answer
61 views

Terminal Graphical Visualizer, using a queue of different matrices

I built a project in which I provide a string input or a whole matrix to configure a frame, create a bunch of different frames and push them into a queue and finally print them in order of the queue. ...
Ellie's user avatar
  • 497
2 votes
0 answers
35 views

Barebones Qt/QML app that generates a list of dishes and then a shopping list with ingredients

I have written a simple app that generates a menu in the form of a list of recipes. It furthermore generates a shopping list, given a menu, consisting of the (unique) ingredients in the recipes that ...
Michele Bolognini's user avatar
2 votes
2 answers
102 views

Alternate **kwargs for class __init__ function [closed]

I want to set up a Python class so that it can be constructed with one set of parameters or another. I'm trying to mimic C++ function templates. I tried alternate constructors. In the actual code I'm ...
JDT's user avatar
  • 81
3 votes
1 answer
80 views

Random generation of points for the graphs of 3 stock share parameters

I currently studying OOP and related design patterns, and tried to implement random data generation for some stock charts using OOP as an exercise. This code randomly generates data points for 3 ...
Jin22's user avatar
  • 33
2 votes
3 answers
125 views

Othello (Reversi) in C++17 and CMake

Othello is a two-player strategy game typically played over the board. I implemented Othello in C++17 with CMake as the build system. I'm looking for feedback on cleanness, readability, and ...
aadithyaa's user avatar
0 votes
1 answer
39 views

Object build while sequential read user input [closed]

The implementation reads sequentially the user's input changing the type to build according to user choices. There are two main components a conditional structural sharing (...
user avatar
3 votes
1 answer
108 views

Simple blackjack program in Java

I wrote this blackjack game for my APCSA class (already submitted) and was wondering if anyone had feedback on what parts of it are improperly written. My main concern is the fact that I am printing ...
nohgo's user avatar
  • 31
7 votes
4 answers
1k views

Matrix Class Implementation

I have written a minimal matrix class. I would like to utilize the latest C++ features, follow best practices, and utilize multi-threading in some of the operations. I have also setup a GoogleTest ...
Space Gaori's user avatar
1 vote
0 answers
37 views

Train Dispatcher in Java [closed]

I am developing a simplified train dispatch system as a final assessment for my CS major, first semester. I have a user interface class, with the TrainDispatch instance as a UI class variable. ...
Mikael Stray Frøyshov's user avatar
0 votes
3 answers
140 views

Declaring type definition once for all variables

To avoid the use of magic numbers, I created a static class to store some integer values that are represented inside a database. I avoided using enums because I need to cast them every time I use them....
Abcd's user avatar
  • 103
2 votes
2 answers
103 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
  • 39
3 votes
1 answer
91 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
4 votes
1 answer
130 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
2 votes
1 answer
143 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
  • 21
0 votes
1 answer
52 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
143 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
155 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
87 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
124 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
3 votes
2 answers
121 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
137 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 ...
yrjarv's user avatar
  • 141
13 votes
3 answers
4k 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
108 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
  • 349
1 vote
1 answer
76 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
  • 39
4 votes
1 answer
173 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
-2 votes
1 answer
242 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
  • 55
5 votes
1 answer
101 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
78 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
173 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
64 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
275 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
81 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
100 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
86 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
129 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
234 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
4 votes
1 answer
202 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
310 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
102 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
167 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

1
2 3 4 5
76