Object-oriented programming is a programming paradigm using "objects": data structures consisting of data fields and methods together with their interactions.

learn more… | top users | synonyms (3)

2
votes
0answers
24 views

Window Creation Wrapper Class

I don't think that there is any new technique in my code but in my opinion it's ok all in all (with a bit of magic). Maybe you can find something to improve or provide some hints on what's good and ...
1
vote
4answers
69 views

Java Rock/Paper/Scissors Game

For my computer science class I am tasked with writing a rock/paper/scissors game. I understand how to write the game, but I was wondering if someone more experienced than I could give me some ...
11
votes
1answer
60 views

Options, options, options. None for JavaFX?

I was looking through the JavaFX library, and I spotted that JavaFX DOES NOT HAVE A JOptionPane EQUIVALENT. (Or at least not in my version - as @SirPython has said ...
0
votes
1answer
68 views

Data Structures C# Dictionary<int,user> and user has a property that is a list<numbers>

1st time posting here. I am about to post a question to StackOverflow about how to do a better job adding a Number to the list inside the User class. But I feel if I refactored this I might solve my ...
1
vote
1answer
25 views

My library for 2 dimensional shapes

This is my first OOP PHP library and wanted to get advice on how I can improve what I wrote. This is what I needed to do: I'm also not sure on what it meant by "proportionally resize the shape up or ...
3
votes
0answers
36 views

Twitter clone in Golang

I have built a Twitter clone in Golang, using object orientation principles. I wish to know the design mistakes I have made. ...
1
vote
0answers
45 views

Reading an SSH config file for an IP

I wrote this class which reads an SSH config file and checks if an IP exist. If not, it adds a block for that IP address. Header file: ...
2
votes
1answer
39 views

Printing polynomials

I am taking a class on ruby and our assignment is to take user input and print out a polynomial. Wondering if I can get any feedback to how to improve my code. ...
1
vote
2answers
35 views

Ruby OOP convention/layout

I am new to programming and I have just written my first program. It takes files from an SD card and copies then into a new named folder and has the option to name the files themselves or simply move ...
-2
votes
0answers
31 views

Storing students' data in an array using class [closed]

I'm trying to store data (Name, roll no, and marks) of 5 students using array of objects. The program doesn't let me enter the marks of the 5th student and just prints the output. Also, the marks of ...
2
votes
4answers
203 views

Making a better Engineer

I have an Engineer which doesn't look very good. How can I make him better organized? What about good practices? Interface: ...
0
votes
1answer
23 views
1
vote
0answers
70 views

Overlay on an image

This is, for instance, used on this page, and it overlays the main product picture with some DIVs: ...
3
votes
3answers
80 views

An immutable person

I am trying to model person in OOPS using immutability. I have created an object bond with age as 25. To change the age I have created a new object and returned it. ...
2
votes
1answer
68 views

Sorting polymorphic classes

I'm learning from "Jumping into C++" by Alex Allain (sample chapter and TOC) and solved the first problem in Chapter 26 "Inheritance and Polymorphism". I'm especially concerned about my use of ...
-1
votes
0answers
22 views

Problems figuring out minesweeper code [migrated]

I'm trying to populate a 2-dimensional array with values (numbers) that correlate to the number of mines adjacent to it. My thought process would be to compare ...
1
vote
2answers
25 views

Assign object keys to another object's keys dynamically

I have an array called viewObject.terms. This array can contain up to 3 items, I need to iterate through this array and save the values into a data object. ie: ...
2
votes
3answers
352 views

Demonstration of inheritance with some shapes

I had a job interview take home test where I was asked a series of questions on object inheritance. In addition to answering the questions, I created the following application to demonstrate ...
2
votes
1answer
50 views

Refactored to use polymorphism in place of case statements

The purpose of the below code is to return different types of job objects based on an argument named "jobType." The original code for the below methods was implemented as a switch statement. I ...
7
votes
1answer
75 views

The Yahtzee Game

I am designing two methods to be used in a Java implementation of Yahtzee. For those not familiar with the game: Players take turns rolling dice and acquire points based on the face up values ...
1
vote
4answers
91 views

Update extremities losses when selected type changes

The following code works, but is it a good idea to call another method in a setter? ...
1
vote
1answer
51 views

Node.js drawing game based off of my state diagram

I really want to have a nice design pattern for my Node.js project. This is my state diagram. As I'm coding this, I'm wondering if it's better to separate state logic from the class? So instead I ...
1
vote
1answer
60 views

Networking layer module

These two classes are part of a networking layer module that I am building: ...
0
votes
0answers
16 views

Extended Laravel Eloquent models to add filters to model setters

One of the tasks I find myself doing repeatedly is to filter the incoming inputs that will be stored in models. Examples of this include trimming, removing repeated or unnecessary pre/suffixes, commas ...
1
vote
1answer
27 views

JavaScript class for a GameRoom

I am new to object oriented design with JavaScript and am trying to make a PublicGame class with some methods that puts itself in a map of games. It calls ...
2
votes
2answers
35 views

Member function to turn class into dict

I'm working on a project where I often want to turn class instances into dictionaries to write them to MongoDB. I'd like some feedback on the following: ...
6
votes
1answer
40 views

Login validator class

I'm trying to learn more about object oriented programming and I have a few questions about the class below. I'm working in Visual Basic.NET My questions are Is there a better place / way to show ...
4
votes
1answer
33 views

Grids, Cells, and Inheritance

I want to build a grid and I have 2 concepts: Grid which is consist of Cell. Grid class is: ...
-2
votes
1answer
57 views

Which way is better (matching Onion Architecture in MVC pattern) for using Provider?

In onion arch. we have multi layer structre: UI (User interface). BL (Business Logic / Services). RE (Repositories). UI uses BL to get data from RE with some conditions, my question is which is ...
1
vote
1answer
76 views

Class to represent playing card

I admit I'm sort of stuck on this. I couldn't think of a better way of representing the card value that will be used in a playing card game. How well thought out is the casting an enum value to an ...
5
votes
1answer
127 views

Kinematic Equations Calculator

The program allows user to enter values for 3 of the following initial velocity final velocity acceleration displacement time and to specify an unknown (one of the previously mentioned ...
6
votes
1answer
458 views

Creature generator

Originally posted this here, and it was helpfully suggested to post in this forum. In the past couple of years I've returned part time to programming after a 15 year gap. I was C/UNIX. So, I've ...
4
votes
2answers
57 views

OO structure for holding and scoring exam data

I'm writing some code to administer and grade multiple choice exams. I'd like this to be easily reusable, and I don't really want to have to do things like lay out quizzes and score them with a bunch ...
3
votes
1answer
49 views

Web crawlers for three image sites

I'm very new to python and only vaguely remember OOP from doing some Java a few years ago so I don't know what the best way to do this is. I've build a bunch of classes that represent a crawler that ...
7
votes
2answers
436 views

Java - Something similar to Abstract Factory?

I have many repositories stored in a map. User chooses some of them and then a downloading begins. Repository may be one of 4 types (see code below). ...
4
votes
0answers
25 views

Separation of concerns in graph theory project

I'm making a project to help learning graph theory and I'm having problems in the separation of concerns of the directives which uses d3.js to draw the SVG on the screen. The following directive code ...
6
votes
1answer
67 views

GitHub (and Bitbucket) Pushing Events

This code is for dispatching and handling certain events from GitHub (and also Bitbucket). Things like pushes, issues, etc. can be handled by this system, and strongly-typed objects will be returned. ...
1
vote
2answers
24 views

From scratch pub sub definition and implementation

I am finished with my implementation of PUB/SUB or Observer pattern, however I just want to see any ways that I may be able to improve this pattern. I wanted to be able to use the typical ...
1
vote
2answers
42 views

“Time Conversion” Python implementation

Problem Statement You are given time in AM/PM format. Convert this into a 24 hour format. Note Midnight is \$ 12:00:00AM \$ or \$ 00:00:00 \$ and 12 Noon is \$ 12:00:00PM. \$ Input Format ...
4
votes
2answers
67 views

Simple Translation Gem

I have a small gem that I've been maintaining. This gem provides a simple way to do translation using an alternative Google API. I've been working with Java last year and recently did some ...
10
votes
3answers
490 views

Google reCAPTCHA Validator: Iteration III

This is the third iteration of my reCAPTCHA validator. Iteration II can be found at: Google reCAPTCHA Validator: Iteration II It does almost everything required to do reCAPTCHA validation on anything ...
3
votes
3answers
100 views

Tic-Tac-Toe classes according to SOLID principles

I have these classes for my Tic-Tac-Toe game project. I am very new to object oriented analysis and design. Can anyone help determine if SOLID principles are preserved in this code or if it is ...
6
votes
1answer
70 views

Multiple file upload class

I've written this a few days back, which is not too big. Do you see anywhere I can improve my logic? ...
6
votes
3answers
368 views

Money class with overloaded operators

I have program that uses a Money class which has several constructors for different methods of input and overloaded operators to add, subtract, and compare values. ...
1
vote
1answer
60 views

Laravel API design

I've been designing and coding my Laravel API boilerplate for couple days now, and I'd like to hear some advice/improvement hints! I'm pretty satisfied with the result, but I'm also aware, there ...
6
votes
3answers
126 views

Filter a list of persons by age and write the results to a relevant file

Let's say I have a class: ...
6
votes
3answers
87 views

Python OOP shopping cart

I am a new Pythoner, and don't have good knowledge of OOP. I completed the following task, but I feel the code is not good. I welcome recommendations to improve the code. You need to create the ...
13
votes
1answer
256 views

Three in a row: Tic, Tac, Toe

The other day, I started thinking of a new personal project to start that I wanted to do in Java. As I started to do it, I realized that I was constantly deleting classes, creating new ones, merging ...