Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

0
votes
1answer
16 views

Battleship Game in Java

I wanted to make a very simply Battleship game in Java, any feedback is welcome. Nevermind the getters / setters. Just assume they are there. ...
-2
votes
0answers
9 views

Creating 45 variables and properties for CRUD program

I'm new in OOP world, I've been using functional paradigm in vb past 5 years and I have a task to link a vb form to a table which has got 45 fields. It's a Form with Textbox, comboxbox, richtextbox......
4
votes
0answers
16 views

Free body diagram generator using MVP for VBA

Based on my understanding of Model View Presenter (MVP) I have it generate a diagram. Is this a correct implementation of MVP? What deficiencies are there in my implementation? UI Generated diagram ...
-2
votes
0answers
24 views

I'm trying to make a collection class in C# [on hold]

As a side project i'm trying to remake one of my favorite games from the old days, moria/angband. I'm doing it from scratch and in C#. In order to store the inventory I have the following classes, ...
2
votes
1answer
43 views

Query builder with OOP design

I am designing a query builder, where the user can just add conditions or groups, and each group can, in turn, have conditions in it. I came up wit the below class design. Can this design be improved? ...
3
votes
0answers
39 views

Metaclass to run a __first__ method for the first instantiation of a class

I had an idea for a __first__ special method for a class. It would be run after __new__ and before ...
-1
votes
0answers
19 views

Updated quiz code, how to imlement C# OOP classes to accomplish the same thing [on hold]

I asked for help on a C# Quiz program I am writing for my ENGR115 class in this thread: Original Question Roland replied with some good advice for me, which I followed, and came up with this revised ...
2
votes
0answers
59 views

Feels like I have no clue what I'm doing in my “project” - “GAME”

Never had any programming course. Am not programmer. Does not plan to be. If anyone has a lot a time to lose, I feel like I have no clue what I'm doing / that a lot of my code is very badly ...
-2
votes
1answer
47 views

How to correct this OOP? [on hold]

I have 2 classes user and topics, a user can follow/unfollow topics, but i don't know where to add the follow function, in User class or Topic class ? ex:- ...
5
votes
3answers
89 views

Student grade calculator using classes/ structs in C++

I am trying to teach myself C++ and using Problem Solving in C++ by Walter Savitch. This is a program project from the book that I used to practice using classes/ structs and would like some feedback, ...
4
votes
1answer
89 views

Word Chain Implementation

The idea originaes from the CodeKata19, find a word chain for two words of a wordlist example 1 turning lead into gold: ...
3
votes
1answer
54 views

Design of a Tic Tac Toe program in Python

Here is a program I wrote to reproduce the known win proportions for random Tic Tac Toe games (X always moving first). It takes about a minute to play the one million random games that will be played ...
4
votes
2answers
71 views

Follow up Implementation on Monty Hall Simulation

I have taken your inputs on my original question and formed a new implementation of the Monty Hall Simulation: Again keep an eye on CleanCode and OOP The Price to be won: ...
1
vote
0answers
35 views

PHP project with Google Calendar API

I'm playing with a simple (for now) project in PHP with Google Calendar API. I have posted the code here in order to improve my programming style about whatever you think it's worth suggesting. Thank ...
2
votes
0answers
28 views

Simple Flappy Bird Clone using Kivy (with very minimum physics)

This is a very simple clone of Flappy Bird using Kivy, to be used for programming class for teens. The game consists of 3 classes: Bird, ...
3
votes
1answer
40 views

Reproducing the known results for random tic tac toe play using Python

I'm reading "Code Complete" by McConnel and I'm practicing using object oriented programming to "reduce complexity". (By that McConnel means, among other things, that it should be very easy to read ...
3
votes
0answers
28 views

Generic router in Rust

I am trying to make a router in Rust using Rocket.rs. I'd like to devise a way to use a default router for my more simple db tables that don't require different logic, to prevent rewriting the same ...
6
votes
1answer
85 views

First OOP in Python 3: Pygame Pong

I have been studying Python for a few months and just recently decided to stop avoiding OOP and reworked a Pong game to a more object oriented style. Please tell me how I should improve my code. Some ...
-1
votes
0answers
15 views

Extend interface or create new? [closed]

I have an abstract class Car and some child classes as CarOne, CarTwo. Each car can ...
3
votes
1answer
84 views

Clean Code / OOP on Monty Hall Simulation Implementation

can you review the this code for the Monty Hall simulation, mainly on the aspects of OOP and CleanCode ...
0
votes
1answer
46 views

Polymorphism and inheritance in C99

In the following code I have created the something like the behavior of inheritance and methods in C99 (without vtable). The code compiles without any warnings even with ...
7
votes
3answers
148 views

Standardized and automated Class block generation for VBA

I recently developed a tool which automaticaly generates VBA code in order to smoothly create class templates. I wanted to share this tool with the community, hopefully this is the right place. The ...
1
vote
2answers
75 views

Item class/system for RPG/DND type game

Thanks for the enormous response on my last question! I've returned with another question, hoping for more insight. I'm developing an Item class and system, and I ...
2
votes
1answer
59 views

Stopwatch utility class in Java

Looking for input on my code for a Stopwatch utility written in Java. ...
2
votes
0answers
39 views

Database code for Python-based URL shortener

I had implemented a URL shortener with Python and a database. Please review the database part of the code. The idea is to create an MD5 hash of the URL in question and then store it in a database. The ...
3
votes
2answers
38 views

Chip8 emulator memory map

I am making a Chip8 emulator and I started out with making a class for handling the memory map. So main the execution will read from this memory object and write to it. /include/Chip8.h ...
8
votes
3answers
789 views

Binary Search Tree implementation using smart pointers

I have implemented below code for binary search tree implementation using shared pointer. At present, I have considered only integers. It supports insertion and deletion of values. Also, a print ...
1
vote
3answers
64 views

Password generator class and CLI

I made a password generator class in C++. I am not as familiar with C++ as I am with C, so I am looking for ways to move to a C++ mindset. I am also trying to use embedded practices like avoiding ...
8
votes
2answers
444 views

Hunt the Wumpus game in C++

I have created a simple version of the classic game Hunt the Wumpus in C++. The rules for the game can be found on Code Golf SE. The rules of the game are (from PPCG): The player starts in a ...
3
votes
2answers
302 views

Implementing different types of light sources in a Graphics project

Edit: I got asked a lot why I need to have the LightSource base class or why do I keep one vector of all the light sources, so here's my explanation: In many ...
2
votes
0answers
31 views

Python logging setup for a package

I'm running a package that downloads data from the internet. This package makes logging calls from different modules. Suppose I have a package 'demopackage'. Here is how my logging is currently set ...
1
vote
1answer
44 views

Basic playing card objects for games

I wrote classes to model a playing card, a deck, and a player to be used in multiple playing card games. I originally posted a Card class here, and now extended the ...
4
votes
1answer
47 views

Uploading songs from website to database and then to Spotify

My Python program parses songs from a website, corrects song titles and artists with the Last.fm API, searches for the spotify uri using the Spotify API, stores all the information in a SQLite ...
1
vote
2answers
60 views

ORM class for Posts

I'm new to PHP OOP and I'm making some tests. I have 2 classes: database and posts and the two interact with each other. Class Database: ...
2
votes
2answers
91 views

An account/banking system in C++

This is just a basic accounting/banking system with the user being able to register an account, check their balance, make a withdrawal and deposit money etc. There is a few things a staff account can ...
2
votes
0answers
62 views

Game tournament service - core logic for matchmaking and results

We have a little tournament in our company between coworkers and I decided to write an application for managing games, results and rankings of players and teams. The base logic for application is ...
3
votes
0answers
43 views

Playing card object

I am writing this class to eventually create a playing card game (Spades) and also to utilize the object oriented paradigm. This was my attempt to model a card as an object. Each card has a suit and a ...
2
votes
0answers
35 views

Thread-safe sensor interface with observer and strategy patterns

I have a thread-safe API for an observable Sensor. The concrete type of the Sensor is chosen in the ...
1
vote
1answer
44 views

Python 'Cashflow' object

In the code shown below, I have created 3 classes. The first of these are an 'Payment' class and a 'Annuity' class, which allow the user to create objects representing individual or recurring payments ...
1
vote
0answers
24 views

Simple Serial Port Windows Interface

I implemented a very simple blocking uart interface. Most of the serial instruments I interface with are master/slave and I have to wait on data to proceed forward. I am contemplating add some ...
1
vote
1answer
54 views

Creating objects from xml-data

I've got an XML file with some info about hosts connected to my home network and I would like to create objects containing that info in a neat way, so that I can make some nice front-end application ...
1
vote
1answer
61 views

Basic orbiting planets in P5.js

I started studying JavaScript about a week ago and I would like some opinions and advice on my code. This program just creates a canvas and instantiates 5 planets that orbit around a sun, giving them ...
0
votes
0answers
22 views

Class to create and send a PDF form with attached documents

I'm currently working on building a class to create a PDF form application with attached documents and sending that file to an endpoint in Box Api. I have found extremely difficult managing ...
1
vote
1answer
33 views

Gather list of all IDs ordered by submission date and ID by parsing file path

This code is to gather a sorted list of IDs (first by ID, then by date) recursively from a directory that submitted a particular type of file (that, as you can tell, includes the word "Magic") and ...
1
vote
1answer
35 views

Simple local cache that checks by date else get from db

I'm looking for feedback on how this can be improved, basically what I'm trying to do is check if the cache has the object else check from the database. I have list of ids, then I separate them based ...
0
votes
0answers
30 views

XLSX to CSV script with column re-ordering

I am still learning Ruby and object oriented programming. I wrote an Excel Export CSV Parser script, which does the following: reads an XLSX file creates a temp file re-orders columns generates a ...
1
vote
0answers
64 views

Image capture client - multi-threading + sharing data between services

I'm working on a small side project at the moment - like a homemade CCTV system. This part is my Python Capture Client - it uses OpenCV to capture frames from a connected webcam and sends the frames ...
1
vote
1answer
56 views

Reusable webdriver framework using SOLID design principles

I am trying to design some classes which I intent to use as a framework. I would like them to be compliant to SOLID design principles. I had a basic structure and then I implemented Strategy design ...
0
votes
1answer
67 views

User class: getting user data, logging in, secure CSRF session handling, logging out

In reference to my previous code: User class: getting user data, logging in, secure CSRF session handling I re-wrote my SystemUser class, without the DI container (for now), I'm still trying to ...
0
votes
0answers
18 views

Go interface design for a cluster provisioner application

I'm fairly new to Go and working on an application to create VMs in a some cloud provider. I'm trying to design interfaces and I'd love some reviews. The application creates a cluster (group of VMs ...