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
0 votes
0 answers
30 views

Television and channel modelling

I wrote a simple project to train my beginning knowledge of OOP. My class represents a Televisor that has two types of channel list: the first one is global, that's applied to all objects of my class ...
user avatar
2 votes
1 answer
41 views

Using methods to get and display userInput

Would like to know if I could have done anything better with the code that I wrote. Want to also know if I could have avoided using a static variable. ...
user avatar
  • 23
2 votes
1 answer
98 views

Small shopping cart application - Solid Principles and Clean Code

I've recently had a technical interview where I had to identify code smells and refactor an existing code by applying the SOLID principles and implementing unit tests. It is a small shopping cart ...
user avatar
-1 votes
0 answers
29 views

Domain modelling of data intensive applications (crawler) [closed]

I am refactoring various microservices into a single monolith, this application is first and foremost a crawler, but which then will process the crawled data in various ways and will extract features, ...
user avatar
7 votes
2 answers
109 views

OOP PHP form builder with validation

Yes, another PHP form builder... I wrote this solely to demonstrate OOP principles. My questions are: Could this be written better? OOP-wise. How could I better implement error handling? Index.php <...
user avatar
  • 73
2 votes
1 answer
50 views

Design Tic Tac Toe Interview Problem [Python 3]

Practicing objected oriented design. This time, it's designing the TicTacToe game. One difference between the real TicTacToe game is that I've made my TicTacToe game to have variable sized board. ...
user avatar
  • 155
0 votes
1 answer
50 views

API Data Load method advice- too many parameters per method?

This is my first question so please let me know if this is too vague/broad and I will do more research on question asking. I have implemented a handful of data loaders in C#, and have come to the ...
user avatar
  • 1
3 votes
1 answer
268 views

Design Shopping Cart System Interview Problem [Python 3]

Just practicing some objected oriented design questions. Please let me know what can be improved to be more OOD and extensible. Thank you. Functional Requirements Cart can hold multiple products A ...
user avatar
  • 155
2 votes
2 answers
54 views

Accept an array, erase some elements and print the array

I'm trying to learn about OOP, specifically encapsulation, and use of static. My goal is to improve my coding skills, I am just looking for feedback specific to encapsulation, the use of static, and ...
user avatar
1 vote
2 answers
91 views

Minesweeper implementation in C++

I have implemented minesweeper in C++. You can get a box by entering the coordinates -row number, then column; starting from 0- of said box (eg: "0 0"); you can mark a box as a bomb by ...
user avatar
0 votes
0 answers
67 views

Generates all pairs (combinations of 2) up to a limit (exclusive)

Any improvements on this combination generator. Seen a lot of combination generators online, but none like this. Found pseudocode at: https://www.baeldung.com/cs/generate-k-combinations Fastest I ...
user avatar
1 vote
1 answer
49 views

Adapter pattern in C++ via Inheritance and Composition

Any suggestions on how the implementation of the C++ Adapter pattern could be improved here? Implemented via: Composition Inheritance What needed to be adapted was the ...
user avatar
4 votes
1 answer
128 views

Blackjack game in C++

I developed a blackjack game. I am relatively new to c++ and OOP, so I am asking for feedback on what could be improved. This game features betting, taking a card, standing, and splitting a hand. ...
user avatar
4 votes
1 answer
269 views

Create and view a family tree

I have an assignment due Friday to make a family tree. Started to code in January. My reviews from the teacher for this code was that the use of pointers was horrendous and it wasn't OOP enough. This ...
user avatar
  • 43
2 votes
0 answers
30 views

JavaScript Linter in Java

I wrote a simple Linter that checks for matching opening and closing braces for one line of JavaScript. It utilizes a stack to store opening braces found in the line, then compares the first closing ...
user avatar
1 vote
0 answers
14 views

Transferring values from a json-string into an object-instance in nim

While writing a web application I've stumbled upon the following problem: I have a relational database. For each table with n columns I have an object-type (called ...
user avatar
0 votes
0 answers
27 views

Execute a sequence of instructions

I wrote a quick POC application to execute a sequence of defined instructions and I would like some feedback if possible. This is purely a proof of concept and I wanted to implement a concept similar ...
user avatar
  • 143
1 vote
0 answers
30 views

How to parse existing functions to a Python class definition?

I have an implementation of a Quantum CNN on the MNIST dataset but right now, the code is just a bunch of standalone functions that call one another: ...
user avatar
  • 169
6 votes
1 answer
579 views

Abstract class with different derived signatures in Python

I don't feel too comfortable with the use of object oriented programming and the related advanced topics. That's why I went through this exercise of using Python's abstract class to implement an ...
user avatar
  • 225
-2 votes
1 answer
58 views

Insert row into database using static or non-static method [closed]

I would like to know if there are any benefits of one of the following 2 methods which insert an object into a database The first function calls the Model method statically, creating a new instance of ...
user avatar
5 votes
3 answers
788 views

Class to calculate values of equation ρ = m / v

Function: This is to calculate the values for the equation: $$\rho = \frac{m}{v} = \frac{mass}{volume}$$ what I need help with: I still can’t get my head around classes and want to know if I’m doing ...
user avatar
  • 191
2 votes
1 answer
52 views

Sudoku Tkinter generator

I made OOP sudoku generator - at this moment it generates only valid table. You can clear it and then generate over. The case is I struggled with calling "fill_board" and "clear_board&...
user avatar
2 votes
1 answer
84 views

Snake game as console app in c++

I made a snake game as console aplication. It was my first real little project I did all alone. I tried using best practices I learned but I've got lost few times so I suppose there will be some bad ...
user avatar
  • 23
2 votes
1 answer
57 views

UpdateCustomer - implementation in C++

I am trying to write a program that does the following: The application will read the customer and book orders data from a data file “BookOrders.txt” and load them in a customer linked list, each ...
user avatar
1 vote
2 answers
199 views

Tic-Tac-Toe vanilla JS Pseudo OOP

I'm working on building a simple game in vanilla JS (tic-tac-toe). Some weeks ago I created a functional MVP and asked some questions about it (Vanilla JS Tic-Tac-Toe). The code worked, but it was a ...
user avatar
  • 127
2 votes
1 answer
81 views

List all files and folders within a SharePoint document library

Background: I have made two classes. The first is SharePointHandler, and contains a few functions that I intend on using to automate some actions on SharePoint. A ...
user avatar
0 votes
0 answers
21 views

Range Sum of BST Leetcode - Python pass by reference?

https://leetcode.com/problems/range-sum-of-bst/ I'm trying to solve this question using Python and the solution is quite straightforward, start from the root and brach left, right based on the value ...
user avatar
0 votes
0 answers
25 views

Two different JavaScript implementations of the observer pattern using class inheritance and concatenative inheritance

To practice design patterns and JavaScript, I'm implementing the observer pattern in two different ways: One implementation using class inheritance And another implementation using concatenative ...
user avatar
  • 729
3 votes
0 answers
57 views

C++ OOP for BlackJack

BasePlayer.h ...
user avatar
0 votes
1 answer
95 views

C++ stack class design

I am trying some hands on recent C++ standards. For the purpose of learning, I have implemented a Stack class as below which can hold any type of data member. I would like everyone to review this ...
user avatar
3 votes
2 answers
120 views

Game of life with options like windows and board size

Mainly I am looking for a better way to control the user input in the game loop which is in the first file. Since the nested switch with many ...
user avatar
3 votes
3 answers
227 views

A refactored payment service, handling several payment schemes

I was asked to refactor a class, to make it adhere to SOLID principles, with testability and readability. I thought I had done a decent job, only my feedback was: a) Unnecessary introduction of ...
user avatar
  • 140
9 votes
6 answers
3k views

Conway's Game of Life Object oriented implementation in Java

I have designed Conway's Game of Life in Java, the solution follows Object Oriented design and paradigm, please review and let me know the feedback Class Cell Cell ...
user avatar
0 votes
0 answers
18 views

AWS CDK Node Serverless and Polymorphism classes

Investigating AWS CDK Serverless and polymorphism classes in lambdas. We've written a significant amount of AWS CDK Typescript code, just not much OOP stuff. So I've been dabbling in OOP to see if ...
user avatar
5 votes
1 answer
110 views

Looking for feedback on OOP for a trading bot on Kraken

I'm trying to build a Kraken portfolio bot and started out with a simple layout for loading the balances. If possible, I would like to get some feedback on this initial design. The API key provided is ...
user avatar
  • 59
2 votes
0 answers
74 views

Is this a valid implementation of Memento Pattern in C#?

I've been studying design patterns from GOF for a few weeks, especially in C#, and I'm struggling with Memento Pattern. I know there are a lot of C# implementations on the web, but I came up with my ...
user avatar
3 votes
2 answers
76 views

Reformatting strings according to different properties with OO

I had to write a cycle that loops a log file and assigns a given status according to some logic. I didn't post the whole code but this is the script that bugs me the most... why? Well, first: I ...
user avatar
1 vote
1 answer
65 views

Console-based number guessing game

I received feedback that my code was convoluted and written with very bad practices. Our tutor said explicitly that I should never write the code like that. I'm just trying to wrap my head around the ...
user avatar
  • 11
0 votes
0 answers
42 views

Learning UML and OOP, trying to make a game in python. What do you think of this UML diagram?

I'm working on refactoring a simulation that i started writing in python / pygame. The gist is, there's buildings scattered around a map, and units carry items back and forth from said buildings. I ...
user avatar
  • 61
1 vote
1 answer
94 views

Simple school bank project in C++

What is your opinion on this simple school project exercising OOP in C++? ...
user avatar
2 votes
1 answer
113 views

Basic Ticket booking code with Unit tests

I am going to run a session for a few other developers who are new to Junit, mocking, etc. I have designed a very simple application with classes and tests to demonstrate how to do unit testing. ...
user avatar
3 votes
2 answers
164 views

Blackjack implementation - Java

I have inspired from the recent blackjack question here and decide to code for simple blackjack console application Please review and let me know What can improve on the code? Rules for the ...
user avatar
1 vote
0 answers
102 views

How to make recursive a nested map function that takes info from different arrays JS

I am making an inventory application and I must create a function that allows me to perform different operations with the arrays that I have created, the application consumes data from an api and ...
user avatar
0 votes
0 answers
22 views

Testsuite for implementation of the command pattern

I've attempted to introduce the command pattern for my use-cases. I would like some feedback on my Test suite. I've tried to delegate as much responsibility to other classes/functions so the primary ...
user avatar
  • 163
4 votes
1 answer
38 views

Exporting a merged dataset from multiple source to a downloadable link

I'm working on a use case in hobby project where I am merging data from an external data source with an internal one and exporting that to a downloadable file The use case is exposed in an ...
user avatar
  • 163
2 votes
1 answer
212 views

Tic Tac Toe game v2

I made the changes that were suggested to improve the program in the previous version. I would like to know if there is anything to improve in terms of handling object oriented programming, variable/...
user avatar
3 votes
1 answer
207 views

Tic Tac Toe in Python with OOP

I programmed the tic-tac-toe game in Python using object oriented programming and I wanted to share it here to get some feedback ...
user avatar
4 votes
2 answers
124 views

OOP Matchsticks Game [Update]

I made the changes that were suggested to improve the program in the previous version. I would like to know if it is decent now or is there something to tweak. ...
user avatar
3 votes
1 answer
110 views

Device driver abstraction layer in C++

First of all, my knowledge in C++ are very limited but I have a good background in C. I'm currently writing firmware for an STM32 MCU using C++. I have to code a driver to communicate with an IC using ...
user avatar
7 votes
2 answers
351 views

Rock, Paper, Scissors game in Python with OOP

I am still practising object oriented programming and I decided to do the rock-paper-scissors game as a project. I listen to constructive criticism to improve the program. ...
user avatar

1
2 3 4 5
76