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)

3
votes
0answers
8 views

Simple Notification class that models database

I'm updating a website I made awhile ago from a functional design to an OOP design. There are still a lot of functions below this class that I haven't implemented yet but I'm getting to it (such as ...
-2
votes
1answer
19 views

Implementing Arrays in Java Class

I have the following code to write: Modify the Student class so that instead of 3 tests you will now have an array of 100 tests. However, not all of the scores may be set. You need to add an ...
2
votes
1answer
16 views

Screen of chars

So its a class that lets you make a 'Screen' which is a n x n grid of chars. Your able to move a cursor by chosing the row and which column in the row and using that you can insert into into that ...
2
votes
2answers
311 views

Medical diagnosis selector

Alright, so my code is 'all over' and missing some fundamentals as regarding to the MVC design pattern.I should separate my concerns and I don't have a model layer and i'm clueless to how to implement ...
4
votes
3answers
47 views

Coding Button functions in separate classes

I've been trying to separate my button functions from my main GUI class The code works but as an programming beginner i want to hear if i'm doing things the 'proper' way. Point out what am i doing ...
0
votes
1answer
72 views

Simple Gender Guesser

I have made a simple gender guesser for an app and thought that this simple bit of code may be useful to other developers. It takes in a string and returns an 'f' for Female and an 'f' Male depending ...
1
vote
1answer
62 views

Object-oriented implementation of a real-world scenario of using a bathroom - follow-up

This is revised code for the previous question: Object-oriented implementation of a real-world scenario of using a bathroom Is there any object oriented way or design pattern I can use to make this ...
8
votes
3answers
91 views

A Text-Based Fighter - Like Pokemon

Okay, I'm a newb to programming/Python. To get a better understanding of objects/methods, I wrote a text-based, turn-based fighting game. I want to expand by adding new characters with new moves (one ...
2
votes
1answer
31 views

Monster Buff/Debuff System Design

Below are a collection of classes that compose my buff/debuff system. The largest flaw in my design that I couldn't overcome is the base class Effect having an ...
1
vote
2answers
35 views

Splitting code to modules

I'm trying to reach good understanding of how to build scalable modular application structure. Recently I've been practicing with canvas and rewriting one of the popular snake game realizations. I've ...
4
votes
2answers
39 views

Library assistant

HackerRank currently has '7 days of JavaScript' going, a quick intro into the JavaScript language. Every day a couple of challenges will be made available. One of the challenges of today was this: ...
3
votes
0answers
43 views

Demo for playing around with HTML canvas

I'm a beginner in JavaScript and I want to improve my skills. I decided to write a simple application that adds a GUI to CanvasRenderingContext2D. I have just ...
4
votes
2answers
111 views

Event timers database interaction layer

I've just started with the basics of OOP. At first it looked complicated, but once I just started with it, it seemed so easy and everything seems to work like a charm, and that's why I'm unsure if I'm ...
0
votes
1answer
57 views

Connect4 With AI

I have made a connect 4 console application in C++ and would love some feedback. In this project I have learned about inheritance and using virtual functions. At the moment my AI is entirely random ...
6
votes
1answer
93 views

Object-oriented implementation of a real-world scenario of using a bathroom

Is there any object oriented way or design pattern I can use to make this code better? How can I avoid casting in this code? What if I add new Object like WaterTank ...
2
votes
2answers
56 views

Bookshelf with Sorting, Categories and File I/O

I've been working on a project originally for school regarding object-oriented design, where I was supposed to write a class for a book and a bookshelf, and then have a driver class to add a couple ...
0
votes
0answers
15 views

Creating Numeric Battle System Backend in Java [closed]

I've been trying to debug this simple battle system I've been attempting to achieve. I'm at a severely basic level and have made a debugging main file to figure out the source of the problem. The main ...
1
vote
2answers
29 views

Web crawler class

I'm using my crawler class in the following manner and I'm beginning to think it's bad practice: crawler.py ...
0
votes
1answer
39 views

Symfony2 (2.7), Embedded Forms, Persist failure [on hold]

I am trying to implement Embedded Forms (Symfony2, 2.7), with a three layers situation: Job, Task and Tag entities, One2Many relationships. So, what I am trying is just to develop a very basic web ...
5
votes
1answer
119 views

Wa-Tor simulation

I tried this as a programming exercise. It's working as intended, but I feel like the code is a mess and I could have used the advantages of object oriented programming much more (like inheritance for ...
12
votes
5answers
854 views
+50

Enter my Matrix

Here is my next Java assignment: create a Matrix class that can add and multiply two matrices together. I was given some code as a skeleton and then fleshed it out ...
-3
votes
0answers
55 views

C++ Interfaces and Design Principles [closed]

How does a SOLID compliant interface in C++ could be implemented? For example, is this design below SOLID compliant? I have several questions: In the Car ...
-3
votes
1answer
65 views

Message validation rules

I wonder if I should divide this class into two, since it contains two "ifs" with different messages. Would breaking it down be in keeping with the "S" of SOLID? ...
1
vote
2answers
45 views

Sorting an object array [on hold]

I've created a class called Box that is pretty much what it sounds like. I want to sort these box objects, and I have created a function to do so. ...
0
votes
0answers
51 views

Class for easier localStorage use

As simple as the title, the following code is just a simple class for ease of use with localStorage. I'm just looking for recommendations in clean up, ideas of things to ad, constructive criticisms ...
2
votes
1answer
43 views

Custom countdown second timer

I'm making a card game and I found useful to include a 60 second countdown timer. Here is my approach: ...
29
votes
4answers
4k views

OO coffee dispenser

This picture inspired a contest between a few of my friends to rewrite this code in more proper OO style. This is what I have come up with. Any thoughts: ...
1
vote
0answers
88 views

Does my code still break encapsulation and uses getters/setters instead of the TellDontAsk principle? [migrated]

I and one guy have been discussing potential solution of a problem on an unrelated board, regarding the typical getter/setter hate, ie. using getters/setters leads to procedural programming. I ...
3
votes
1answer
74 views

Object-oriented web scraping with Python

I usually write function-only Python programs, but have decided on an OOP approach (my first thereof) for my current program, a web-scraper. Here is the working code I wrote which I am looking to have ...
10
votes
3answers
1k views

PIN class with SOLID principles

I wrote this Pin class as a part of a project to learn SOLID. What do you think about it and what can be made better? Interface ...
3
votes
2answers
50 views

Data Table Report Class

Most of the VBA I write is to produce tabulated reports from spreadsheet data. So, here is my attempt at creating a CLS_Data_Report class. Properties: a ...
4
votes
1answer
45 views

Simple Ruby program to model a prepaid transit card system

I have written a simple Ruby program to model a transit card system which aims to address the following user stories. I wanted to see whether I could get any feedback on it. My main interest is ...
0
votes
1answer
34 views

Implementation of bridge design pattern for a web scraping app - follow-up

Earlier today I tried to implement an example of the bridge design pattern, but I ended up misinterpreting it. I made a lot of changes: ...
0
votes
1answer
48 views

Application container design

I'm putting together a simple application container for learning purposes, and I would like to hear how you see this code. The application is the main class that will contain services, configuration ...
4
votes
2answers
77 views

Search word in multiple files

I am writing a brute-force method to search for a word. Please review my code and tell me how I can improve it. ...
4
votes
2answers
80 views

Binary search tree in Java with only one class

I have written a BST using one class. Is my code okey or something could be better? ...
1
vote
2answers
58 views

Calculating unknown parts of a right triangle

I am in the process of creating a program that allows a user to input known parts of a right triangle and the calculates all of the unknown parts if it is possible. I am using a class that I wrote in ...
1
vote
0answers
29 views

Use of HTML (view) in a constructor

I have this constructor (from a Service) where I'm setting a few variables, but two of them include HTML. Is there a best way to set those values, maybe by creating a method in the class to set them? ...
2
votes
3answers
62 views

Calculating a payment price based on a selected phone

The program shows three phones with prices, and you need to select one of them. The program will then calculate the price based on the payment type you selected. I'm very new to the world of OOP, and ...
1
vote
1answer
31 views

Keeping object consistence at its creation

Let's assume I have 2 objects Product and Volume. 1 Product must have at least 1 ...
3
votes
1answer
65 views

Creating a lightweight strongly-typed parameter infrastructure

I'm looking for some feedback on some code, designed to allow me to strongly-type parameters, which get passed to functions. I'm only really looking for comments on making my parameters more strongly ...
3
votes
1answer
70 views

Implementing a Time class in c++

Design a class TIME which stores hour, minute and second. The class should have the methods to support the following: User may give the time value in 24-hour format. User may give ...
7
votes
1answer
58 views

Assembler listings parser components: Operands parser

I'm building the above mentioned parser. It reads a string of assembler instructions. I want to become a better coder, so I wanted to get a code review to start learning to do things property. As we ...
2
votes
1answer
39 views

Using a class to create a custom wrapper for including files

I am using PHP in order to create a custom wrapper for including files, for this I have written this class: ...
8
votes
2answers
290 views

Bridge, We've Got a Problemo

Now that we can move across the bridge, it's time to finally set up the problem so that it can be solved. A reminder of what the assignment is: Welcome to the Bridge Crossing Problem. Person Pn ...
2
votes
0answers
41 views

Object-oriented WordPress plugin

Note: This plugin is / was never intended to be submitted to repo just for personal use but the questions still apply to general Plugin Development. This plugin listens for ...
-2
votes
0answers
34 views

Solving a system with 2 linear equations with 2 unknowns

This code finds the solutions of a system of 2 linear equations. I used Kramer's rule to find the unknowns, but I wanted to do this using classes. I don't know if this is the right way to use ...
3
votes
1answer
27 views

Classes for attributes validation

I have two classes responsible for attributes validation: ...
2
votes
1answer
91 views

Singleton Class for WordPress Plugin

I'm developing a WordPress plugin using the singleton pattern with the following requirements: There should ever exist one instance of the plugin Another instance of the object should never be ...
6
votes
2answers
109 views

Moving across my (sturdier?) Bridge

Building on top of the classes in this question of mine, I've made this class to support the moving of the entities for my given assignment: Welcome to the Bridge Crossing Problem. Person Pn can ...