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
137 views

Simple bank OOP structure in PHP

I don't have much experience using either OOP or PHP since this is probably my first thing ever written in this language. I've had some exposure to OOP but I'm not used to writing programs that way. I ...
1
vote
1answer
104 views

Combat game - character factory

I decided to improve my OOP design knowledge and learn python at the same time so I started to write a simple program which will be a fight "simulator". For now, there are only 2 character types : ...
4
votes
2answers
121 views

Find SuburbName from latlong or location

I have create one class and interface for finding SuburbName based on Location or LatLong coordinates. My interface ...
0
votes
0answers
20 views

Untangling a data class where annotations from different frameworks mix

The framework mix problem I'm using two frameworks -- PingIdentity's SCIM 2 SDK, which uses Jackson, and Spring LDAP -- to deserialise a SCIM resource (i.e. JSON) to a Java object then write it to an ...
9
votes
0answers
144 views

BattleShip - Ships & Players

I'm making a full-blown OOP Battleship game in VBA (previous post: Battleship Grid), and I want this code to be as good as it gets - and better, if I can. I've refactored a few things, introduced a <...
1
vote
0answers
70 views

Battleship game in python3 and the unicurses libary (oop)

In order to learn Python and Curses programming I am in the process of creating a Battleship game for the console. At the moment I struggle more on object oriented programming and structuring the ...
1
vote
1answer
71 views

Class creating dropdown options from MySQL data for multiple scripts

I created this class to handle some dropdowns that I'd been creating using a squirrelly combination of HTML, jQuery, and AJAX. This works much better in the one script that I've deployed it in: <...
2
votes
2answers
57 views

Modelling football teams and fixtures in Ruby (as compared to SQL)

I am trying to model information around football teams and fixtures. I am using the Premier League fantasy football API for my data. The fixtures API is here, and the team data (along with a lot of ...
10
votes
1answer
156 views

BattleShip Grid: Classes and Tests

In my ongoing quest to demonstrate how VBA code can absolutely be object-oriented, I've started implementing a game of Battleship in pure VBA. This is a rather large project, so I'll split the ...
0
votes
2answers
58 views

Simple implementation of nxn Dense Matrix in Java

So far this is what I have completed. Still working on these two methods boolean isIdentityMatrix(DenseMatrix matrix); boolean isInvertible(DenseMatrix matrix); Suggestions are appreciated. Thanks. ...
2
votes
0answers
266 views

Max Heap Data Structure Implemented with Python List

Created a max heap using a Python list as the base storage. The heap starts at index 1. Here is the heap: ...
0
votes
0answers
21 views

Normal Distribution and K-means clustering demonstration

I have two classes, the 1st one aims to display the Normal Distribution, and the 2nd one aims to perform K-means clustering. The emphasis is to build classes of the mathematical methods as examples ...
12
votes
5answers
2k views

Processing XYZ data from a large file

I'm new to programming (1.5 years experience at university), and I'm working on my first computer vision related project! My goal is to take a file which might have CSV (comma separated) or txt format ...
1
vote
0answers
36 views

Simple ruby program for AWS ruby SDK

I wrote a simple ruby program for interacting with one of my temporary AWS S3 using Ruby SDK. Below is the program I've written. Since I learned ruby by myself I need help/suggestions in following ...
2
votes
1answer
136 views

Image processing using Python OOP library

I am trying to learn OOP by refactoring my existing code (functions only). This example works but I am not sure whether it is pythonic and good practice. I have a shared library which consist of ...
6
votes
0answers
74 views

Using decorated methods in a subclass of deque to dump its state to a JSON file

I am sub-classing an object in python and I need to overload a bunch of the methods with very similar logic, essentially a call to super() and then some additional operations. I want to avoid ...
1
vote
2answers
153 views

Unit of measure class for mass in java

I was looking at this answer on SO to handle units in java. The concept was interesting to me, except I didn't like that it had to be per object that had mass, instead of encapsulating a ...
4
votes
1answer
153 views

Tic Tac Toe in Browser Console

Anyone remember "War games?" I have a very long way to go, but I thought it would be interesting to make a version of Tic Tac Toe which plays itself. At present the AI is "choose a random available ...
0
votes
1answer
110 views

Object for generating HTML for hyperlinks

I have a function that generates HTML for hyperlinks. It's arguments may be string literals or variables read from the database. An example call to this function looks like: ...
4
votes
2answers
109 views

Minimum difference between numbers in a file

I'm learning Java and I created a simple solution for the following problem: Given a file [filename].txt such that each line has the format ...
3
votes
2answers
57 views

Searching Online English Dictionaries - follow-up

This is a follow-up to Searching online English dictionaries: ...
4
votes
3answers
173 views

Java RPG battle simulator

I'm coding a turn-based RPG battle simulator (text based) in Java. I'm doing this as an exercise/project to learn OOP design. I've coded something similar in C, but just porting that code over to ...
-1
votes
1answer
108 views

PHP OOP registration with User class and singleton Database class [closed]

I created registration system with PHP. I have User class that will handle all the input and insert the user input into database, and i created Database class with Singleton pattern that will connect ...
8
votes
2answers
1k views

Python Output Class

I have the following Python output class that I'm planning to use across a number of modules in a terminal application: ...
1
vote
1answer
68 views

Should I add the “fetch_group” method to my user class or should I create a separate class for group

I have a table of users, where each user has a group (or multiple groups) he/she is part of. Currently I'm handling the users group via a Users class: ...
0
votes
3answers
76 views

“Human” interfaces with two implementation classes

The Helloworld class executes all of the methods. Human is the interface, and Nate & <...
0
votes
2answers
68 views

Implementing many-to-many

I'm looking for advice on implementing many-to-many. I'm modeling a site such as stack exchange: each Member has many Groups, each Group has many Members. I've introduce a Membership class. This class ...
4
votes
4answers
502 views

Initialized Array Template Class (C++)

The problem We want to use a very large array for some computations. When created, all the elements of this array have to be initialized to some value. We'll only use a few values from the array1,...
0
votes
1answer
105 views

Pomodoro timer in React

I created a simple Pomodoro timer using React JS. In my example: Timer should count down seconds until it reaches 00:00 Timers should switch between 25 and 5 minutes Timer should be able to start, ...
7
votes
2answers
93 views

A game of automated tag

This game has 4 people moving randomly, one unit in one of the four directions (up, down, left, right), with a fifth person as a designated tagger. If this fifth person tags someone, the person is out....
4
votes
1answer
304 views

Macau Card Game (with graphics)

I've already made a version of this game which was supposed to be played on the console. I got it reviewed and applied almost all of the recommendations I received in that topic. Thus you can consider ...
0
votes
2answers
282 views

Fetching data from your database in a constructor

I have this item (an item is an object linked to a xml view), to build it I need 2 things, get labels from codes, and get text from the strings.xml android file. please ignore the long to int and int ...
1
vote
0answers
68 views

DDD Best practices [closed]

I'm developing some test web-project for my self to learn DDD and good architectural practice at all. So application, basically, is a simple photo manager. I'm developing 3-tier architecture and for ...
4
votes
1answer
204 views

Supermarket app using OOP

I am going in a circle over and over trying to write a "supermarket" application using OOP. The app should be useful for the employees of a supermarket. The app reads data from a CSV file which looks ...
5
votes
1answer
330 views

Traversing the parent-child relationship between objects

I wrote this code because I was often annoyed that I couldn't get the parent object. This class allows you to traverse the parent-child relationship between objects, in both directions. It also ...
4
votes
2answers
471 views

Java Conway's Game Game of Life

I have implemented Conway's Game of Life simulation. What can I improve? How could I structure my programme better? All suggestions would be appreciated. World.java: ...
2
votes
1answer
48 views

Collision detection on Android

This is the same game code from my previous question. I split the code into smaller "logical units". The runnable code "Moon Buggy" is available in beta from the google playstore. It was previously ...
2
votes
1answer
285 views

Connecting 2 databases: one for admins and one for customers

I am working with 2 databases. One for admins ('backoffice') and one for users. Account managers: Use the 'backoffice' database to manage customer accounts. Customers: Whenever a users connects ...
2
votes
0answers
325 views

Netflix-like video recommendation system

I want to make my own Netflix in C#, without using sql, only using dynamic memory (omitting video-streaming support). I thought about this class diagram. What do you think? In my main program I have ...
5
votes
2answers
317 views

DSP-Quantizer class in C++

I have written a class to quantize values to arbitrary bit depths within a specified amplitude. It is meant to process one value at a time, and has two ways of quantizing values. I wrote the class so ...
2
votes
1answer
34 views

Implement metaclass for Maximumlikelihood estimator

For the purpose of defining a lot of Maximum Likelihood estimators, I think I need a metaclass. At the moment I have to copy/paste a lot of code for every new class definition and just substitute the ...
-4
votes
1answer
69 views

Use key as object in map C++: Check if the less operator is implemented correcty [closed]

Hello I wrote the following code. It allows me to use objects as keys in a map. I have a constraint though: In addElement function both arguments must be pointers ...
2
votes
1answer
278 views

Javascript Snake

I have implemented a little snake game with Javascript and Html. This is my first game with Javascript. I use a Linkedlist to represent the snake. Both code snippets are in snake.js file. It would be ...
5
votes
2answers
442 views

Tetris game demonstrating OOP principles

I've designed a basic Tetris game, and implemented it in Java language. I'll use it for demonstrating software engineering, designing. I'll re-implement it in many different programming languages, in ...
6
votes
0answers
121 views

Python class for organizing images for machine learning

I built a class to help me handle image data to use in machine learning. I thought that there would be a pre-existing package that did what I wanted but I couldn't find it so I wrote this. I am not ...
1
vote
1answer
89 views

Models for analysing Twitter data (*which based on tweepy package)

I have three modules here models.py, functionals.py, and adjustment.py. These three may be ...
3
votes
1answer
80 views

A Ruby script to generate random “people”

I'm working on developing a small Ruby program to generate random data for a Neo4J database, including people, addresses, phone numbers, etc. I'm a total beginner to Ruby, so I wanted to post my ...
0
votes
1answer
627 views

Object oriented design of chess game [closed]

I was trying to design a chess game in Java. I have just started learning design patterns and am not sure if my approach here is right. Could you please suggest ways to better this design ? Below is ...
5
votes
3answers
232 views

Python lexicon class

First time around Code Review so please be gentle (and I am happy for comments on which angles of this post are a good fit and which less so). I'm not pretty much used to software engineering in ...
1
vote
1answer
66 views

Write a class for Team which should have function to prints players details

I have written it using aggregation but i feel its not the best way we can do this. Please suggest is there any other way to do this. I think we can also built this without using player class, just ...