Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

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
2 votes
1 answer
82 views

Semi-generic data loading utility class

The following implements a relatively generic and modular data loading utility. It loads images from a local storage given a lookup table. The data loader is parametrized via dependency injection to ...
lo tolmencre's user avatar
1 vote
1 answer
83 views

Blackjack optimization in python (Update)

A little while back, I made a post on blackjack using object oriented programming. I've begun running simulations under it, it runs fairly quickly but I know there is always improvements to be made. I ...
Joseph Beegle's user avatar
2 votes
0 answers
49 views

Classes for Config and logical operators

I have a spring cloud gateway application with this yml structure for request validation: ...
Q2Dev's user avatar
  • 21
4 votes
2 answers
391 views

Poker bets on Python

I'm writing poker for my bot in discord. So far I'm presenting an incomplete version of the project, which is only a betting system. The development took a lot of time, so I decided to ask for help. ...
Cat met's user avatar
  • 43
2 votes
2 answers
120 views

BlackJack in python

I began creating blackjack in python; however, I'm looking to simulate it, so I'm thinking I'm going to need to optimize it so that I don't just leave my computer running for three hours waiting for ...
Joseph Beegle's user avatar
3 votes
2 answers
220 views

Tic-tac-toe OOP Minimax Algorithm

I wrote a module that I intend to use in my next tic-tac-toe project. All it is is a class that stores the boardstate along with some methods/properties. The biggest thing is the minimax alg. As shown ...
flakpm's user avatar
  • 55
7 votes
3 answers
993 views

Is this Python/Pygame that draws a maze well structured?

I'm not very confident about this piece of code I created, it basically takes a file like this: ## # ## ## # #B # # # ## ## ## A###### Then proceeds to ...
José Gomes's user avatar
4 votes
2 answers
319 views

Optimizing Multiple Subplot Visualization and Navigation in Matplotlib

I have implemented a class in Python using Matplotlib for visualizing multiple subplots along with navigation buttons to move between different subsets of data. Each subplot displays a contour plot ...
Cold Fire's user avatar
3 votes
0 answers
70 views

Text-Based Multiplayer RPG Engine using Flask & React

As a final project for a software engineering bootcamp, I decided to make a text-based multiplayer RPG game engine. Using Python, Flask, & Flask-SocketIO for the backend and React & TypeScript ...
Thomas Makurat's user avatar
1 vote
1 answer
81 views

My C++ implementation of the Factory Pattern

Please review my implementation of the factory pattern; it gives a trivial example. Feel free to point out anything I've missed or any code styling tips. ...
Archie Payne's user avatar
3 votes
1 answer
198 views

A library management system

Following is my code for a library management system. I am pretty new to OOD and trying to learn it. I am specially looking for ways where any design patterns can be useful here. I tried to make ...
Pankaj Kumar's user avatar
2 votes
1 answer
52 views

A selenium web scraper to package NBA data

I'm building a selenium web scraper for basketball-reference.com that takes a player name and returns data in either a JSON format or Pandas DataFrame object. The class in question is one of many that ...
BluffShove's user avatar
1 vote
2 answers
93 views

simple Text Table utility

A small utility to print data in an ascii table TextTable ...
Martin Frank's user avatar
  • 2,838
2 votes
1 answer
57 views

Return a set of geodetic coordinates for a particular moment in time

Use case The user is interested in supplying a timestamp of a particular moment in time. This python application will perform two astronomy calculations for a set list of planetary bodies: Calculate ...
Hunter's user avatar
  • 259
5 votes
1 answer
564 views

Calculate Earth-based planetary positions given a date, time, and timezone

I have a project where the user supplies a date, time, and timezone, and my code will calculate a bunch of coordinates on the Earth. There are four sets of coordinates setA, setB, setC, setD. ...
Hunter's user avatar
  • 259
1 vote
1 answer
54 views

Handling HTTP requests in existing Web Api

I am working in a Web Api project that has the following project structure: Root Controllers Orchestrators Managers Services etc The ...
Yiannr's user avatar
  • 119
2 votes
1 answer
55 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
  • 23
5 votes
2 answers
226 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
77 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
3 votes
1 answer
84 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
  • 151
0 votes
1 answer
73 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
86 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
223 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
65 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
  • 549
2 votes
0 answers
37 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
115 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
83 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
140 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
40 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
208 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
0 votes
3 answers
147 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
108 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
93 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
136 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): ...
friday-json's user avatar
2 votes
1 answer
147 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
160 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
201 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
126 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
123 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
5k 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
121 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
  • 399
1 vote
1 answer
82 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
202 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
260 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
131 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

1
2 3 4 5
76