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
0answers
5 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 ...
4
votes
0answers
17 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
28 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 ...
-3
votes
0answers
16 views

JavaScript Code Construction for recording Node Tree Changes [on hold]

I have a node tree structure that renders database information in the browser using vis.js - see this. I won't use the actual table entities, but suppose it's something like: ...
1
vote
0answers
18 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
17 views

Solving exercises using methods [closed]

1) Extend the Exercise developed in class (attached) with a new datatype Degree which allows a coordinator to store all the students (CV) enrolled in a Degree providing the following operations (...
4
votes
0answers
40 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 (...
0
votes
0answers
37 views

LinkedHashSet Implementation

There's an implementation of LinkedHashSet in Java. Although this is limited with its functionality, it will do the basic job. I used interfaces so then I can use that interface for BST. Set ...
0
votes
0answers
28 views

Parking lot system design

Problem Statement I own a multi-story parking lot that can hold up to 'n' cars at any given point in time. Each slot is given a number starting at 1 increasing with increasing distance from ...
1
vote
0answers
71 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 ...
-4
votes
0answers
17 views

Static factory method vs adapter [closed]

I have a problem which approach is best. Please imagine system written in a hexagonal architecture where each service method accepts class or classes. Let say for example my method create User. 1. ...
0
votes
1answer
38 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
124 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
39 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
46 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
45 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
117 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 ...
-1
votes
0answers
22 views

PHP code to return JSON data for various kinds of charts

I need some input on how to go about refactoring my PHP code. It's a big if else that looks ugly. But its implemented with MVC so I'm finding it very hard identifying what classes should be required. ...
2
votes
0answers
51 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: ...
0
votes
0answers
17 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
31 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 ...
4
votes
1answer
67 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
31 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 ...
0
votes
0answers
34 views

Rotate Algorithm making the picture fit

I have made this algorithm myself based on how to rotate an image. ...
4
votes
2answers
64 views
-1
votes
0answers
56 views

Reactive Tic-Tac-Toe

I'm trying to learn React and, as most other people, I decided to start from the React tutorial where a TicTacToe game is built . I tried to rewrite the example by myself and one thing that I did ...
4
votes
2answers
70 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
58 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
44 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
39 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
71 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
119 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 ...
0
votes
0answers
25 views

Entry point of a micro-service application

This is the main entry point for the my application (a micro-service). I feel like I'm doing a lot of things outside of main(), but even if I brought them all ...
5
votes
3answers
421 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 ...
1
vote
1answer
36 views

Class with predefined ellipsoids

I am creating an Ellipsoid class and I then want to instantiate a few constants (pre-defined Ellipsoids). Below is my current implementation. I am not really ...
1
vote
0answers
18 views

Encapsulating simple license backup to a disk

I am enapsulating my license backup to disk, using an interface ILicenseProvider and the implementation is DiskLicenseProvider. Also i am throwing an unchecked exception LicenseProviderException which ...
2
votes
2answers
88 views

Four-function calculator with buttons for digits and operators

I would like make this calculator program more Object Oriented but I'm struggling with how to do it. The calculator works perfectly but I would like to have another class that does the calculations ...
0
votes
0answers
21 views

Join model that constantly has to reference parent(s)

I have a situation where there are restaurant dishes that can be served at many different locations. An example would be somewhere like McDonalds where the Big Mac is served at locations nationwide. ...
2
votes
1answer
88 views

Object-oriented student library 2

Follow up of Object-oriented student library Question: How do you refactor this code so that it is pythonic, follows OOP, reads better and is manageable? How can I write name functions and classes ...
1
vote
0answers
34 views

Design a system for renting digital movies/books

During an interview I was asked to do an OO design for a digital renting system for books/movies. This is the design that I came up with. My assumptions: When the customer has downloaded a list of ...
4
votes
3answers
59 views

Print the first, last, and in-between integers of a range

Given our spec from Code Golf: Given two integers, output the two integers, and then the range between them. The order of the range must be the same as the input. Examples: ...
4
votes
1answer
67 views

Implementation of Singly Linked List

I'm a data scientist attempting to build stronger CS fundamentals, particularly in Data Structures & Algorithms. Below is my attempt at implementing a Singly Linked List. Looking for advice ...
1
vote
0answers
31 views

Mixed Duo String Generator Part 2

Mixed Duo String Generator Hello again; Previously my code was critique and I applied this feedback to form my new revised code for the Mixed Duo String Generator. In the code below I revised it to ...
0
votes
0answers
23 views

License Manager PHP Class

I'm workin on this code that will be a licensing class integrated with an electron app. For now it's a simple object who will generate and check for a licence stored inside the electron app folder. I ...
1
vote
3answers
64 views

Mixed Duo String Generator 2 [duplicate]

I've create a program that finds mixed duo within a string. It removes characters from a string that do not form the first mixed duo. It does not rearrange the order of the string, it ony remove ...
3
votes
2answers
76 views

Mixed Duo String Generator

I've create a program that finds mixed duo within a string. It removes characters from a string that do not form the first mixed duo. It does not rearrange the order of the string, it ony remove ...
5
votes
1answer
96 views

Linked List implementation in Python

I'm a data scientist attempting to build stronger CS fundamentals, particularly in Data Structures & Algorithms. Below is my attempt at implementing a Singly Linked List. Looking for advice ...
7
votes
2answers
135 views

Object-oriented student library

This library management program can do following functions: Add a book to the library Display all available books Lend books to students Return books to the library Display students who have ...
1
vote
1answer
76 views

Template matrix class, second version

This is my first matrix class which I updated after already asking here already. The updated code is below. Are there any suggestions regarding member function parameters? Is there a convenient ...