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
4
votes
2answers
60 views

JavaRPN (Updated)

I have previously worked on this program in this question, and have gotten some very good answers and help! Now, I have done some more work on the program, and would love if you could give me honest ...
-3
votes
0answers
23 views

Is this a reasonable way to represent a test instrument that supports SCPI? [on hold]

I work with electronics test equipment. I like to be able to automate tests using their remote control interfaces. I have built a pattern, a few base classes, that I can apply to all devices that ...
17
votes
4answers
2k views

Hero battle game

This is my first attempt at OOP/classes: a game where you will select a character and use attacks and abilities to defeat the enemy character. I have a few specific questions: I was told that having ...
7
votes
2answers
874 views

Displaying characteristics of the Hero in a console game

I am beginner in OOP. And i want you to analyze my piece of code and give me some recommendations. My task was : RPG game give a chance to choose race of Hero : Argonian, Breton, altmer, nord. In ...
-1
votes
0answers
31 views

how do I keep this from going past the ascii values for upercase [closed]

Im currently trying to figure out why my encoder/decoder doesn't add or subtract the right amount. Any help is greatly appreciated. ...
3
votes
2answers
92 views

Implementation of tree with different node types and faux-polymorphism in C

I'm currently learning C by working on my first project. It's a calculator with a parser that transforms input into an operator tree. These trees consist of nodes of different types: Operators (inner ...
7
votes
4answers
180 views

Code that reads/writes to bytes of an ascii-encoded hex string

Problem Statement Given a hexadecimal string (hascii) and its binary specification (a list of byte field names, their offsets, and byte lengths), design classes to parse all byte-fields, cast bytes ...
2
votes
1answer
80 views

Interface and inheritance; creating download types for a download manager

I'm creating a download manager in C# (in combination with Unity 2019.1.8, running the .NET 4.x equivalent (MONO) scripting back end). To accomplish this I decided to start using interfaces and class ...
3
votes
2answers
60 views

Binary Tree Sort Algorithm (Python)

A Binary Tree Sort is an algorithm that builds a binary search tree from the elements to be sorted, and then traverses the tree (in-order) so that the elements come out in sorted order. Average Case ...
1
vote
0answers
44 views

Anti XSS code encapsulated inside model class, does it belong there?

I had some XSS protection code I wanted to add into my Web API/MVC application, the model that was used to bind was EditLocationViewModel as below. My initial plan ...
4
votes
0answers
78 views

Extending VBA classes with Behavioral Patterns

I want to learn about Design Patterns and be able to apply them in Excel VBA. So to learn about patterns I bought a book that seems promising: Head First Design Patterns; it presents the material ...
0
votes
1answer
103 views

Shell Sort, Insertion Sort, Bubble Sort, Selection Sort Algorithms

There are seven sorting algorithms in the code copied below. The first five algorithms have been previously reviewed in this link. Selection Sort The Selection Sort algorithm sorts a list by ...
3
votes
0answers
59 views

God-class which controll CNC machine

I have a god-class (GodClass) which work with class-adapter. Class-adapter (OldController) work with old api-class which can't to use directly cause it has bad api with low-level parameters. God-class ...
12
votes
4answers
1k views

Shell Sort, Insertion Sort, Bubble Sort, Selection Sort Algorithms (Python)

There is a follow-up question available: shell-sort-insertion-sort-bubble-sort-selection-sort-algorithms-python. Selection Sort The selection sort algorithm sorts a list (array) by finding the ...
4
votes
1answer
130 views

Factory pattern for creating embossing machines

I'm working on a program that creates a file for a specific embosser machine (machine that creates plastic bank card for example). I have 3 embosser machines and all of them create different files. ...
2
votes
1answer
63 views

Sorting Algorithms (Python)

Selection Sort The selection sort algorithm sorts a list (array) by finding the minimum element from the right (unsorted part) of the list and putting it at the left (sorted part) of the list. The ...
6
votes
3answers
94 views

Battleships OOP python

This is my first attempt at some basic OOP programming. A version of battleships played within the terminal. Any feedback would be great; especially in regards to readability and proper naming ...
1
vote
0answers
26 views

TypeScript Salesforce client library wrapper

I have made a class which wraps the JSForce Salesforce API Client: ...
8
votes
2answers
809 views

Selection Sort Algorithm (Python)

Selection Sort The selection sort algorithm sorts a list by finding the minimum element from the right unsorted part of the list and putting it at the left sorted part of the list. The ...
5
votes
1answer
53 views

Bank account balance program

Would my code be considered fairly optimal and efficient? If not, where can I look to improve the code? The program works just fine. Would this method scale well if the dictionary containing the ...
2
votes
1answer
59 views

Simple JS OOP - Clicking the box to fetch and display object content

I'm relatively new to OOP with JS and want to find out: If my code can be improved somehow, and key question Identify how and where I can typically use OOP more in my job (as I can usually just use ...
5
votes
4answers
157 views

A C# struct representing a string that can be neither null nor white space

I've written a C# struct in order to encapsulate the idea of a string being neither null nor ...
3
votes
1answer
46 views

Many parameter curve-fitting

In my project I have to make curve-fitting with a lots of parameters, so scipy curve_fit struggles to find the answer. For example: \$\ c_0 + c_1 \cdot cos (b_0 + b_1\cdot x + b_2\cdot x^2+ b_3\cdot ...
1
vote
1answer
56 views

Bank account class

Simple object-oriented, money management code where a user can deposit money in, withdraw from, show, and exit the balance. ...
3
votes
2answers
58 views

FAMILY.PY | OOPython

Simple code where family and person instances can be created. There is a method where any instance of Person can be added to any instance of Family. ...
5
votes
0answers
40 views

Properly Structuring a Tkinter Application

I'm fairly new to object oriented programming and while I understand the basic concepts, I'm still having some trouble organizing my applications. I'm building a small Tkinter application as a ...
5
votes
2answers
116 views

Wrapper for Python's argparse class

I'm just trying to learn python: I tend to write my own customized wrappers arround "more complicated" python functionalities so that i can use them more easily, more consistent, easier to change in ...
5
votes
1answer
107 views

Plain-text file encryption and decryption

I have created an Encryption and Decryption Algorithm that encrypts plain text using a given cipher and also decrypts it back to the original notation. It works great. This was my code for a coding ...
5
votes
3answers
327 views

Wrap a js function with a fixed this arg

If I use node.addEventListener('click',Wyg.Editor.nodeClickedEvent); then when node is clicked, ...
8
votes
3answers
649 views

Weapon class firing logic in JavaScript

I'm making a program to compare Borderlands 3 weapon damage over time in a graphic. There's still some work to be done, like implementing elemental damage, but I'd like to know if I'm doing a good job ...
2
votes
1answer
100 views

Modelling a Call Center in Java (multithreading approach)

I wanted to give a shot to Modelling a Call Center from Cracking the Coding Interview. The problem statement is as follows: You have a call center with three levels of employees: Respondent, ...
2
votes
1answer
53 views

Locker Manager app c++

good afternoon. I'm learning c++ and I made this app to "manage" lockers. I would like you to review it please, you can find the source code at my github: https://github.com/VitalZero/lockermanager ...
1
vote
0answers
23 views

TypeTrainer OOP Tkinter program [closed]

I've been developing my first real python gui-program for a while now. Having watched some tutorials to tkinter and OOP I've gotten quite far, but now I just can't get my code to do what I want it to. ...
3
votes
0answers
97 views

Product Filters wordpress plugin: implement single responsibility principle for elements classes

Plugin is a small editor that allows to create a filter such as a price slider, checkboxes of "brands", a drop-down of "seasons". An example of how plugin work can be seen on page: http://demo-...
4
votes
2answers
59 views

Random line remover from file

This asks the user for the file name and the number of lines they want to remove. It then stores each line into a vector. A dynamic array is used to hold the random line numbers (generated by random ...
5
votes
2answers
119 views

PHP classes with functions used for building a web application

The following class is set of functions I use for web development(examples below) and I was wondering how to structure it. Examples: ...
4
votes
1answer
57 views

Meta-circular interpreter for lambda calculus in Python

For learning purpose, I've written a simple lambda calculus interpreter (plus 'Add'). I would like it to be the cleanest and most idiomatic possible. Can we make it as neat as the Haskell version? <...
7
votes
2answers
61 views

TaskScheduler in python

I have found the need to schedule a few simple functions in a first-come-first-served way so I developed a small task scheduler based on multiprocessing and I thought it would be a good candidate for ...
2
votes
2answers
136 views

C# classes for system health metrics

My company wants me to build a serverless component (AWS Lambda) that checks every minute for our system components health. The data model (classes structure) I have devised so far is as pasted below....
5
votes
0answers
30 views

Python wrapper to PSUtil

The class below provides a set of utility methods to currently running process. It is a wrapper around Python PSUtil to check status of a process in localhost as well as remote host. Please help me ...
8
votes
1answer
127 views

Convert to dictionary

Earlier I did post with full code about Prepare and export data to MS Word file. The user t3chb0t recommended me to separate some part of full code to this post. Context The task of code for review ...
6
votes
1answer
199 views

java - Basic snake game

This is a snake game I made, Note: at this point, I would like to hear any thoughts/ reviews about it. Thank you Game class: ...
5
votes
1answer
51 views

Prepare and export data to MS Word file

The task of the code that is presented for review is to prepare all the data for the export of the selected contract and create a file on this basis. This is one of the first experiences with a ...
1
vote
1answer
70 views

Single Linked List in Python

I'm following a tutorial on Single Linked List (SLL). There are so many methods in the code, if you had time please feel free to review any part of it and I can work on it and repost it. I'm ...
4
votes
2answers
55 views

Generic wrapper for single value or array of values

I'm writing a chart.js port for c# blazor (you can find it here) using C# 8.0 with .NET Core 3 (latest preview). In chart.js there is this thing called indexable options. It let's you use either a ...
2
votes
1answer
41 views

Merging Two Bubble Sorted Linked Lists

I'm following a tutorial on merging two bubble-sorted Single Linked Lists in Python. merge1 creates a new list and does the merging. Other than naming ...
4
votes
1answer
89 views

Global configuration object [closed]

For my project I have a configuration class which will hold all of the global configurations for the project. This class if subject to change constantly (adding more config parameters) and I did not ...
1
vote
0answers
33 views

PHP Doctrine - shared properties between discriminator classes

I have a single table inheritance type on a class (Resource) that can be one of 3 classes: SingleDay MultiDay Accommodation SingleDay has properties: QTY ...
5
votes
0answers
97 views

Factory class that uses reflection to instantiate objects by class name

In this SO post Dynamically choose class from string Alexander Platonov creates a Function on the fly and then uses Application.Run() to instantiate an Object by ...
6
votes
1answer
95 views

Generate music notes by specified key and scale

As a follow-up on isosceles' question, I have created a small API to generate the notes of a scale given the pitch class set and key note. I've added the reinventhing-the-wheel tag because I know ...