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.

2
votes
0answers
43 views

Simpler version of BlackJack game - first oop

I am learning Python for a few weeks. Last time I started object-oriented programming and I feel like it is really hard for me to write relation between methods and attributes different objects. I ...
2
votes
0answers
32 views

Object Oriented Tic Tac Toe Python

I've been learning to code in my spare time for a couple of years. I have covered object oriented stuff before and can usually understand other people's object oriented code. This is the first time I'...
0
votes
1answer
49 views

Experimenting with a OOP design pattern in JavaScript

Initially, I was using the class syntax to structure my code. While it sure did feel nice to work with, I found it lacked some important functionalities, like ...
3
votes
1answer
33 views

Snippet to get all local classes from a module

I'm working on a project which due to the complexity of the business logic has had to pull out some classes to do computation related to some values in a database. To link the code and database, both ...
2
votes
1answer
91 views

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

I wrote this class a few months ago and noticed from a few examples that it's better to break down these classes and separate them. I am not so sure what is the proper way to break it into parts. It ...
2
votes
1answer
69 views

System_user Class - all in one class including login functions

I wrote this class a few months ago and noticed from a few examples that it's better to break down these classes and separate them. I am not so sure what is the proper way to break if to parts. It ...
1
vote
1answer
63 views

PHP user class usability

I'm new to PHP OOP programming and I'm trying to make a user class with login, register, logout and some other methods. I'm concentrating in the login method that will be used with Ajax. Session ...
6
votes
1answer
105 views

Tic Tac Toe Game in C++ using Classes

I made a Tic Tac Toe game using classes to show a better approach than the Tic Tac Toe game in Tic Tac Toe in C++11 which works not with classes. I already posted the code there as an improvement ...
0
votes
0answers
45 views

An iterator returning all possible permutations of a list in Java - follow-up

(See the previous and initial iteration.) My main attempt here was to get rid of monolithic code and split the implementation into smaller methods when applicable and do more extensive commenting. ...
1
vote
1answer
33 views

Create an Array of Objects for Patch Notes in React

I was looking to get some reviews of my code, so I can improve my writing. Functionally it works the exact way I want it to based on my patch notes .md file. I'm open to all suggestions for improving ...
5
votes
1answer
32 views

Scheduled file sorting with Ruby

I have a script running as an hourly cron job. It finds all screenshots on the Desktop and moves them to directories sorted by year/month/day. On MacOS, screenshots are automatically saved to the ...
4
votes
2answers
87 views

Program to calculate Hash and Size of a torrent

I wrote this small program to open a .torrent file, retrieve its info-hash and size. I'm still a beginner at Python so the main focus of this program was to try and utilize classes and objects instead ...
3
votes
3answers
90 views

Dynamic PHP PDO insert method

This is my attempt at making a class for dynamic PDO queries in PHP. The code works, but I would like the hear what I can improve to make it more secure and readable. ...
9
votes
4answers
801 views

Simple (Very Easy to Make) RPG Game Simulation in Python and Turtle

The code creates a very simple/easy RPG game, with 2 classes Jedi and Orc. The data is visualized using ...
0
votes
1answer
57 views

PHP OOP MVC Project Structure

I'm a beginner in OOP and PHP frameworks. I used slim skeleton to create a project and designed the project in this way. Project structure is given by the slim skeleton. Object Mappers are added by ...
5
votes
1answer
119 views

Polymorphic Data Socket Factory with Query Contingency Protocols in Python

I work on a small data team where we developed this tool when we began experiencing several job failures on our legacy big data systems. We have several data lakes, each with their own API, and until ...
3
votes
0answers
153 views

Design an object oriented parking lot

I solved this system design interview question. The problem description Design a parking lot Constraints and assumptions What types of vehicles should we support? Motorcycle, ...
0
votes
1answer
27 views

Factory to instantiate and configure Selenium WebDriver

I, also, need to know whether this is a valid implementation of the factory pattern. The amount of effort which goes into configuring DriverFactory to simply get a ...
6
votes
4answers
225 views

Chess game design in C++

I built a chess game in C++. My main concern is the design. For example, in the board class it has a 2D array of pieces. This array represents the positions of the pieces, but the piece class also has ...
2
votes
1answer
43 views

Java n-ary Tree class with custom made methods and nested Node class

I'm a beginner and I wrote this (working) code for n-ary tree. The specifics: Each node is to be built with an integer value. Each node has a variable number of children. The nodes should have an ...
3
votes
2answers
91 views

Beginner's user vs. computer Tic Tac Toe

I made a simply user vs. computer game on Tic Tac Toe. I used Object Oriented Programming to increase my understanding of this programming paradigm. Can you criticize any design flaws I have in my ...
4
votes
0answers
52 views

Tracker for object construction, copy, and movement

I made an object tracker for debugging and testing purposes called ccm_counter (construction, copy, move counter). It counts constructor, copy and move calls. It ...
1
vote
1answer
94 views

Simulate BankAccount in Java

I have been learning Java for the past two months, and started writing this task about simulating Bank and BankAccount to practise a bit of OOP and exception handling. Problem is I am not confident ...
0
votes
3answers
64 views

Represent a Class which holds translation Strings [closed]

I have a class which represents some translations of a keyword. ...
0
votes
1answer
64 views

Generic Binary Search Tree Implementation in Java

There is an implementation of Binary Search Tree. This is kind of based on Set Theory that duplicates are not allowed but an attempt to adding the same node twice will replace the older node. BSTNode ...
5
votes
0answers
61 views

Prototype GameManager for game written in Unity

I am self taught, so I'm consistently seeking ways to code better, and more efficiently. If anyone has the time, please advise me on what can be done better with explanations as to why the old method ...
0
votes
1answer
39 views

Tile and grid abstraction

This question is a small subset of the problem I am trying to solve. I am trying to learn to break problems into better abstractions. The original problem I am trying to solve is: Write a JS ...
1
vote
0answers
33 views

Use of inheritance using two Ruby libraries

Currently I'm working on parsing data from a form service into a pdf form. I created 2 classes one inheriting from the other one. However, I see that the classes I created are growing in lines of ...
4
votes
0answers
69 views

Two player snake game

I created a 2 player Snake game from my original one player version. I am looking for some feedback on how I made it. I think I could use improvement when handling input (...
1
vote
0answers
91 views

Scraping and printing titles from Craigslist

I've written a very tiny script using class to scrape some titles of products from craigslist. My intention is to make use of __str__() method so that my script can ...
0
votes
1answer
53 views

User Input in class sanitized

I want to sanitize my user input in my class. All is working as expected but first of all, I would like to avoid to set a default value for my digit parameter. ...
2
votes
2answers
137 views

C# classes for adding form components dynamically

I'm currently reading on how to implement design patterns. I'm trying to implement the design patterns but need help on whether my understanding is correct. I have a windows form in C# project that ...
1
vote
1answer
44 views

Request rate limiter

I'm looking for feedback on ways to improve the maintainability and readability of my code. I'm especially interested in hearing about ways I could improve the code's adherence to good object ...
2
votes
1answer
51 views

Managing different types of morphism and their compositions

Here's some code I wrote to manage the different types of morphism and their compositions in C++17. Let me know if you had any suggestions for substantial simplifications or improvements, or if I ...
3
votes
1answer
49 views

Python Rubiks Cube Object

I have made a Rubiks Cube object which builds a Cube out of Cubelet objects and then allows you to move it. Things I still plan to do is add tower cubes and triangles and other shapes as well as a ...
6
votes
2answers
130 views

Salary-calculating classes, supporting several types of employees

I develop this mini project as an exercise. It is a simplified employee salary calculator. Requirements: Employees are characterized by name, employment date, employee group and base salary. There ...
2
votes
1answer
44 views

Password generator + storage console app

This is my code to generate and store password localy hashed in txt file. I would like to kindly ask you whether you could review my code. Btw it is coded as console app. I am currently working on ...
2
votes
0answers
66 views

Object Oriented design for a live auction taking in bidders

My goal is to design an Auction that will take in data like this: ...
2
votes
1answer
44 views

PHP OOP: List management

I am trying to manage an "app list" in my app (I currently have "MS Office" app list, "Games" app list and "other" app list). lists table: ...
1
vote
1answer
50 views

Python A Star with fewest turns and shortest path variations

I had a lot of fun writing these. I haven't seen a version minimizing turns, so that was a neat challenge. Any suggestions are very welcome. Is there anything to gain by making more method variables ...
5
votes
1answer
146 views

Web scraping google trends in python

Question Recently I have tried to create a web scraping program to get data from google trends. It uses an RSS feed to do so. My question is as follows: How can I improve my code such that it is ...
1
vote
0answers
35 views

Get stacked game state in NHWC format

After reading this, I decided to transition my DQN code from the keras library to tf.keras library (code is located in this repo) and my original code used NCHW format, as it was faster with GPUs. As ...
4
votes
2answers
67 views
4
votes
2answers
174 views

Modeling a parking lot

Here is my code for the design of a parking lot in C++. The following assumptions are made. Referred from Geeks for Geeks The parking lot has multiple levels. Each level has multiple rows of spots. ...
2
votes
1answer
120 views

Simple Java OOP calculator with GUI

I'm learning Java and I've tried to write my own calculator with GUi based on this post. Here is the repo: https://github.com/MurDaD/java-calculator Could someone check my code and tell me how to ...
1
vote
0answers
54 views

Boolean expression generator and evaluator using Object-Oriented Python [closed]

I have been trying to get a handle on object-oriented programming and was recommended to try and create a boolean evaluator using these principles. My code currently can build an expression, print out ...
2
votes
1answer
98 views

OOP and connecting to multiple databases using PDO

I'm just starting to learn OOP and I've setup a class to handle the database connections and wanted to check if I'm going about this the right way. My website is already using PDO for prepared ...
1
vote
1answer
144 views

Graph implementation in C++ using adjacency list

there is my final code for implementing a Graph in C++ using adjacency list and Object-oriented. I got some help from StackOverflow and it was really helpful, but now I would ask about some advice for ...
0
votes
2answers
175 views

Laravel: Export customer record as CSV

Using Laravel, I need to export some value from the DB in a CSV and then upload the CSV via sFTP or return it in a Response. I'm trying to be use S.O.L.I.D. principles but with this scenario, I'm not ...
5
votes
3answers
437 views

Length units converter

I am creating a very small application to demonstrate solid principles and also a brief implementation of a builder pattern, does anyone have any feedback as to how this could be improved or how it ...