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.

1
vote
1answer
25 views

Simple console based car array

I have recently started coding in Java and I had to do this assignment in college. Develop a menu driven application called TestCarPartc that allows the user to ...
2
votes
1answer
43 views

Object-oriented model of a machine gun using Pygame

I just started to use classes in Python, so I don't know all concepts, rules and conventions about it. I made a little program of a machine gun, which simulates firing by user's action. Here it is: <...
0
votes
0answers
17 views

Deferred Iteration in TypeScript

I've published a new TypeScript library currently in beta, and was hoping to get feedback on certain aspects of it, particularly implementation details for improving the performance of deferred ...
0
votes
0answers
29 views

PHP User management class

Here is my code for a class that is responsable to manage some common users task like registration, login and logout. It implement also a sub class that can be used to check the session of a logged in ...
-2
votes
0answers
24 views

Design a class to have several attributes or one attribute as dictionary with many keys, Python3 [on hold]

I have class for calculating temperature of an object at different positions, based on ambient temperature. ...
0
votes
0answers
18 views

Loop each items are the unique solution to retreive one specific property from one collection object?

with this code I add item/properties into my collection: ...
2
votes
0answers
54 views

Simple Hand Cricket Game in Object Oriented Way

The rules of the game are pretty simple. I'll put it here in case people don't know them It's a two player game hand game where they alternate being a batsman and a bowler. Who decides to do what ...
2
votes
1answer
47 views

Basic Connect Four game

Here is a simple text-based version of connect four I made. I have been building this in an attempt to improve my Java skills (and possibly mention on my resume). My goals with this project are as ...
-3
votes
0answers
42 views

How to enforce parameter is a CONSTANT in python [on hold]

I am writing a data preparation class that should work differently on different database types. I would like to assert that the class is instantiated with allowed database types. This would allow me ...
1
vote
1answer
51 views

Flip coin Game in an Object oriented way

I started out creating a simple game in an Object Oriented way to practice. The rules are pretty simple There are two players You let one player choose if they want Heads or Tails. You assign the ...
0
votes
0answers
14 views

Logical flow for user verification process

I've provided methods to determine what stage user is at in verification process. This will determine the appearance of the view or what progress user has made. Its pretty straightforward, but I think ...
1
vote
1answer
45 views

C++ wrapper for GLFW window object

I'm creating a window class in C++ to provide a bit of abstraction for a GLFW window. window.h ...
0
votes
1answer
42 views

Control the input of the user according to a sample string and get some info from it

I made this Python code that prints a sample string and ensures that the input of the user agrees with the sample, and then do an action with this inputted string, in this case a multiplication table. ...
-6
votes
0answers
24 views

Is the #100DaysOfCodeChallenge literally an hour a day? Including the part where we get stuck on code? [closed]

Pardon if this question is very poorly formed but I'll give a background. I recently started my #100DaysOfCode Challenge and I spare out some time from a really hectic routine. An hour. Everyday. I ...
-3
votes
0answers
28 views

First solo python project, text based game. After 'fight' method the game doesn't return to main [closed]

So I've been learning python myself from online course and wanted to practice everything I had learnt so far in a fun way, so started a text based game. Now I've gone through quite a few iterations of ...
3
votes
0answers
37 views

Amateur Python Sudoku Solver

I'm self-taught in Python and would have a lot of room for improvement. I made this basic Sudoku Solver mainly in order to practice the use of Class creation. I would greatly appreciate any feedback ...
2
votes
1answer
34 views

C++ - Astar search algorithm using user defined class

The objective of the post is to improve design and improve command on C++. Given a map, start point and end point, the shortest path to end point from the start point has to be found out using Astar (...
1
vote
0answers
27 views

Kotlin DAO with Exposed: How to reduce redundancy in classes?

I'm writing a Kotlin app that uses Exposed (https://github.com/JetBrains/Exposed) as a SQL wrapper to write and read objects from databases. The problem I'm facing is that I end up with 3 classes ...
3
votes
0answers
41 views

So what if the “View” in an MVC isn't a Userform, but is the Worksheet?

So I've been following the discussions around VBA as an OOP language and the applicability of various design patterns, such as MVP or MVC. Excellent postings on these topics are extremely informative ...
1
vote
0answers
42 views

PHP OOP front controller pattern

I've started a course about the MVC pattern applied to the web. I want to improve my PHP programming skills so I've decided to write a simple boilerplate for my webapps that use the front controller ...
1
vote
1answer
67 views

Tic tac toe game using C++

I wrote this C++ code for Tic-tac-toe for an interview (The basic skeleton was pre-provided) and got rejected because the code was too complex and inefficient. I'm not an expert programmer so I'd like ...
1
vote
1answer
51 views

C++ Breakout game using SDL

I did a big mistake to create procedural C++ breakout game on start and now im having trouble converting it into OOP. As far as I can see I need classes: Loptica (eng. Ball), Splav (eng. Paddle), ...
1
vote
1answer
45 views

Function that performs a test of whether a number is greater or less than some expected result

The program that contains the function I'm asking (handle_non_exact_answer) about has several instances of a class Test, with ...
3
votes
3answers
240 views

Get collection of objects from CSV string and vise-versa

A generic class to get object collection from csv string. I would like to know if there's any better way? Converter class ...
0
votes
4answers
117 views

Simple OOP Blackjack game in Java

I've created a relatively simple Blackjack game in java. The reason why I decided to do this specific project was to improve my object orientated programming in java. I will post my code so feel ...
2
votes
2answers
52 views

Finite State Machine in C++

I made a state machine. You can press 0 and 1 to switch between the hypothetical menu and playing state. I hope you can help me improve it further. StateManager.h ...
0
votes
0answers
42 views

Representing data retrieved from an API

I am using using an Entity class to represent data retrieved from an API (using guzzle). There will be many Entity classes such as Note, ...
5
votes
0answers
97 views

Web Battleship -The Unofficial Battleship UI

I've written my own UI for Mathieu Guindon's VBA Battleship (Battleship UI: GameSheet) which uses a webpage in a WebBrowser control for the View. Webform: Userform ...
4
votes
2answers
108 views

Space Invader Style Game - Model / Presenter Decoupled From View - Functional Again Too

Thank you for your patience. The game is fully functional again! I have tried to incorporate all the advice I have received so far. Thank you for taking the time to review and comment. I have now ...
1
vote
0answers
29 views

Ruby - Create a bitmap editor that accepts user input to plot a matrix grid, points and lines

I recently didn't pass a take-home code test for a job interview - and one of the reasons for this was that the code was not as idiomatic as it could be. The premise is in the title - but below ...
2
votes
1answer
37 views

Check values in datatables, with validation rules that vary according to the data source

Background I receive dataframes from several sources (below I call these sources s1, s2 and ...
2
votes
1answer
81 views

Python tkinter Snake

I have made a little Snake game with Python tkinter. It's my first Python program with one GUI. What can I improve? ...
2
votes
0answers
51 views

Dependency Inversion in constructor

Currently I'm learning OOP and meanwhile I'm trying to keep the SOLID principles. Is it right to inject dependency (GenName - generate file name) on File ...
4
votes
1answer
113 views

Hangman Game in C++

This is my version of Hangman Game, written in C++. How could it be improved? what should I avoid using/doing in future projects? ...
1
vote
1answer
50 views

Space Invader game written In VBA, 3rd iteration [closed]

Here is a link to the workbook, classes, modules and forms: https://github.com/Evanml2030/SpaceInvader/tree/master Positive: I have decoupled the view from the control / presenter. I have ...
2
votes
1answer
66 views

C++ - Object Oriented File System Design using Composite Design Pattern

I am trying to come up with a good File System Design using C++ / OOP. This is being done to gain an understanding of System Design and Design Patterns. I have some basic functionality, like reading ...
1
vote
0answers
22 views

AVL Tree with delete method in Python 3

Just a general code review. I'm looking for my first developer job so anything constructive is awesome. Please, and thank you very much. I've written this implementation as an exercise and to add to ...
0
votes
0answers
32 views

Insert into database from three different queries

I have 3 tables: user_group_insurance user_insurance user_policy_group How could I ...
2
votes
2answers
58 views

PHP login/signup validation class

I am working on a blog with PHP, specially in order to practice OOP. Since the blogging system will handle users, i thought that a Validation class would be a good idea in order to not repeat code ...
2
votes
0answers
19 views

How to connect a propery class/object with a collection (its database class)?

I'm struggling with organizing my code regarding 'best practise'. In particular how I link a class with its collection class. I've 2 classes: ...
2
votes
0answers
36 views

Method for creating and traversing a BST while also getting its depth and width

This is a class for creating and traversing a BST while also getting its depth and width. I feel like this can be factored down into something more elegant and shorter I also feel like the overall ...
0
votes
0answers
14 views

Node.js: User model and DB insertion queries

I have written the following user model for an app I am working on to encapsulate some raw SQL queries and insert rows into a PostgreSQL database. I need some input on how I can refactor and extract ...
2
votes
2answers
116 views

Discrete Event Simulator

I'm an undergraduate student and I have this assignment on a Discrete Event simulator. Currently I have completed to the end of v1.2 here. Attached also, is an algorithmic overview. I have wrote my ...
0
votes
0answers
25 views

Is this a 'proper' use of a trait in PHP? [migrated]

In Laravel 5.6 an Illuminate\Database\Eloquent\Relations\BelongsTo relation was given the ability to support default models. This allows a model that will be ...
2
votes
2answers
67 views

Java converter from Arabic to Roman Numerals

I am learning Java and would like to get feedback on the code I wrote. I have written an implementation of an algorithm (found here) for converting any decimal Arabic number to Roman numeral string. ...
1
vote
1answer
46 views

Custom serialiser with object factory

A couple of years ago I wrote a serialisation library for my project. By the time it worked well, but recently I thought it could be modernised. Back then I needed something that looks similar to ...
-4
votes
1answer
36 views

Conditionally grab vehicle data depending on criteria specified as key-value pairs [closed]

Here is the case of ugly condition for the "if": ...
1
vote
0answers
55 views

Text-Based Adventure RPG with PyGame

I'm creating a text-based adventure game using PyGame. I plan on also implementing kind of a Pokemon/Final Fantasy style combat system that works with menus instead of commands, but I haven't started ...
3
votes
2answers
127 views

Replace a #define/template “Variable Wrapper” system with a pure template/OOP solution

I have an inherited code base that I am looking to improve. Below is a "variable wrapper" template class and #defines that i would like to replace with a template only solution, or redesign ...
0
votes
0answers
10 views

Pass data from SOAP(WSDL) to ExpressJS endpoint

I'm currently learning how to use node on simple projects. This time I'm fetching data from a SOAP service and passing it to an ExpressJS endpoint sort of like a REST endpoint. The following code ...