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 (1)

2
votes
0answers
22 views

Database Access Object Class

I learned of the Database Access Object design pattern from a friend and decided to implement it recently to my MySQL database. The code uses MySQLi to connect to the Database, and uses prepared ...
3
votes
1answer
31 views

OOP Blackjack game

I made this Blackjack game to help me learn the syntax of JavaScript classes and objects. As I was writing the game I felt like I was misusing the idea of oop. By that I mean I felt like some of the ...
2
votes
1answer
109 views

Indexed Properties in C#

I was challenged to implement a mechanmism to support indexed properties in a class structure. I wanted to avoid the need to implement an abstract property indexer class every time you want to ...
3
votes
0answers
16 views

Laravel controller for a commenting system

Can someone review my Controller? I should follow these guidelines: Code should be written with MVC pattern and to use OOP. The code now works fine, but I need to improve it. Also, should I use ...
4
votes
2answers
265 views

Amazon web scraper

I am trying to improve my programming and programming design skills (poor at the moment). I created a small Amazon scraper program. It is a working program. I would be very grateful if you could ...
1
vote
1answer
36 views

Interface injection and common functionality between classes

I'm trying to get my head around the OOP principles and coding my own classes. As a means to learn, I have decided to convert a couple of functions I have written in Wordpress to OOP classes. These ...
1
vote
0answers
16 views

Conway's Game of Life in Python3 (follow-up)

I asked for a review of my code, and after making the suggested changes I feel that now the OOP version is clearer in its meaning and overall the code looks cleaner. ...
1
vote
1answer
43 views

Wrapper classes for objects returned by 3rd party APIs

I am building a WPF application which uses a third party library to fetch objects which I want to allow the user to interact with. The objects are returned as interface types. Am I right in thinking ...
0
votes
0answers
23 views

Calculating the determinant of a matrix [closed]

I am working on a project that I needed to calculate the Determinant of a matrix. Usually, I would just have a class "Determinant" and just calculate that way, but, things have changed and I have had ...
-1
votes
0answers
7 views

merging array of objects based on common property [closed]

I need to merge two arrays of objects and I know there are many ways to do it but I am just curious what would be the best way to do it. e.g - I have the following arrays, ...
-1
votes
0answers
12 views

WLP (Weakest Liberal Precondition) Transformer implementation in Java? [closed]

Input for our program is array of instructions (Expression [] instructions). Then iteratively starting from last instruction, and going backwards we searching for weakest pre-condition of single ...
2
votes
0answers
71 views

Multipurpose command-line utility to manage a web application

I'm creating a command-line tool which is supposed to work on both Windows and Linux OS. It will be used to manage our application - start, stop, deploy etc. We have it in bash scripts now (and it ...
19
votes
4answers
2k views

Calculate distance using speed of sound

I've been working on learning Java and this was a challenge as part of a chapter on data types: Create a program that computes how far away, in feet, a listener is from a sound. Sound travels ...
1
vote
0answers
101 views

Laravel 5 Dependency Injecting a Repository into a controller, and depedency injecting an entity into repository

Overview:: I have a Restful API that pushes all /api/{version}/{Repository} into my ResourceV{1}Controller depending on the ...
1
vote
1answer
27 views

Saving model's data in the model vs an external data manager class

I have a bunch of models (using activejdbc) Person, Company, Health, .... etc (I have 8 models). I'm showing an example of just one model Person In the first approach I have a data manager that ...
4
votes
1answer
95 views

Class responsibilities OOP design [closed]

I'm having some questions on creating a design for simple approval workflow. Some arbitrary thing (ItemToApprove) needs approval process. Approval process begins ...
8
votes
2answers
195 views

Video Store Rental Application

I'm in the middle of developing a video store rental application for a school project but am starting to question whether I'm going about things in the correct manner. Although the application is ...
-2
votes
0answers
33 views

Better way to build an object (multiple methods)?

I've inherited a method that populates/builds an object (ReportSchedulesVO rsVO), and is about 300 lines long. At an overhead view, the purpose of the method is to ...
3
votes
0answers
40 views

Custom session handler

I'm new to PDO and haven't been coding in a while. Is the following custom session handler industry-acceptable? ...
5
votes
1answer
30 views

Binding events in constructor

I am trying to get familiar with OOP JavaScript, in particular working with the prototype pattern and would love some pointers/suggestions on how to improve my code. I think I have understood the ...
6
votes
2answers
188 views

Checking for existence of URL parameters

I'm busy rewriting some from my spaghetti code into OOP classes. I'm still learning OOP and very new to the concept. From help from this answer from @EliasVanOotegemto on a previous question I've ...
5
votes
0answers
40 views

Memory Segmentation Simulation

I recently have been working on a project to simulate segmentation in memory. I wanted to create everything from scratch; not use pre-built data structures. I create a memory object that allows for ...
1
vote
0answers
55 views

JavaScript OOP with virtual, private, protected and public members

Everything you need to do OOP in one neat little package without having to do all the work by hand. Almost like C++. Here is how you would use it: ...
2
votes
0answers
28 views

Session flash class

I've created this class, for flashing variables like validation errors or success messages. But I'm not certainly sure about it. ...
1
vote
2answers
32 views

Database fetch class

The active column in the database only contains a boolean. The country column contains ISO 3166 A2 codes (2 char). Do you have any advice on improving this class? ...
0
votes
1answer
14 views

Creating object Nodes an easier way

I am required to create a bunch of object nodes to an object: ...
3
votes
1answer
88 views

Memory leak using UserControls

I seem to have a memory leak on this method but can't figure it out. This method is called every 10sec by a timer which acts like a refresh. ...
5
votes
3answers
72 views

Design of a remoteControl class for connecting to electronic devices

In a course that I'm taking on learning object oriented programming in java, I have completed an assignment for modeling a home entertainment system and the ability for a user to be able to use a ...
8
votes
2answers
58 views

Adapting a bilingual program to support users with learning disabilities

I have a very large class which serves as the BaseClass for many AdapterClasses. The base class consists of methods that can be ...
2
votes
1answer
42 views

Method for parsing floats and adding totals

My intention is to create a nice DRY method (add) which will take care of parsing floats and adding totals internally and will be called by other methods. I feel ...
5
votes
3answers
57 views

Performing database interactions

I wrote this CRUD class in PHP that has methods to do database interactions, but I want to know if it is good/secure/elegant? It works fine and all and it hasn't ever given me any troubles, but I'm ...
0
votes
2answers
53 views

Questionnaire design puzzle

I am designing a small questionnaire web service application but however I would like if someone can look at my design and see if it good approach I am taking. The application has the following ...
7
votes
3answers
264 views

Rocks, Paper Scissors game

I wrote a Rock Paper Scissors game and was hoping to get some feedback on issues like: Am I utilizing object oriented techniques correctly? What can I do better? Am I using ...
3
votes
2answers
145 views

Correctly coding an OOP object

I have a couple of functions in WordPress that I'm rewriting to OOP. All these functions are interlinked in some way and also reuse code from other functions. This is an example of the first class ...
4
votes
1answer
41 views

Custom dropdown selector

I'm working on improving my knowledge of OOP in JS. I just created this custom dropdown selector. It's working nicely, but I'm not super happy about the Filter ...
4
votes
2answers
937 views

Switch statements in Rock-Paper-Scissors game

I am very much new to design pattern. I'm trying to modify the Rock, paper, scissor game from an example book where I try to add more various design pattern. But I am encountering two similar switch ...
2
votes
2answers
49 views

Quickly filter an object by keys

I am trying to optimize an object filter function. Given an array of keys, I need to filter an object. I feel that creating a new object each time may degrade performance. Is there a way to mock the ...
4
votes
0answers
34 views

Brute Force (and not) Bejeweled AI

My approach to solving the problem of selecting the best match on a bejeweled board is a fully object oriented approach. Some of the other relevant code can be found in my previous questions ...
2
votes
4answers
89 views

User class and 'generic' Database class

This may be a bit overwhelming, but me and a friend of mine have written a Database class with methods for our queries. All of these queries should be generic so we can use them in multiple ways. We ...
4
votes
2answers
98 views

TCP chat application with both server and client logic in same application

Here is my simple chat program. I'm wondering whether it has an acceptable design (both object oriented design and network design). If you want to run it, I can provide the solution folder. ...
4
votes
1answer
81 views

Calculator - C++ operator-overloading

I am new to object-oriented concepts. The following is my attempt at creating a basic calculator using class and operator overloading concepts. Please review it for improvements. Also, how do I make ...
1
vote
0answers
12 views

Javascript custom event hub

I'm creating an event hub object in for a large project I am building in Javascript. The project will have modules in charge of the UI, commands, and rendering. Each module will use this hub for ...
2
votes
1answer
368 views

Controller for repository of members

I am still new to Laravel, just learned the Repository pattern. I tried to implement it on my project, here's the result: MemberController.php -- this one is a bit ...
4
votes
1answer
70 views

Serial port for Node.js

I am trying to create a class for serial port using Node.js, but I want to know if there is a better way to write my data class code. In my sample code below, in the ...
4
votes
2answers
105 views

OOP Blackjack in C++

I finished my Blackjack OO game and I'd like to get my OO skills reviewed. ...
4
votes
1answer
50 views

Data-checking class supporting letters

I'm starting to learn OOP with PHP, and all I've learned so far is just by searching and reading. So I have this need to check input data for certain things like min of chars, max of chars, spaced or ...
5
votes
1answer
67 views

OO Blackjack game design

I have set up card, deck, hand, player, ...
2
votes
1answer
67 views

TicTacToe in OOP

I'm trying to learn some OOP programming using Java, so I've created TicTacToe. Could you give me some advice on how I can improve this code? Player.java: ...
5
votes
3answers
422 views

Does this Tic-Tac-Toe game follow abstraction and encapsulation?

This below program will be further enhanced for TicTacToe game with Human and Computer as players. Currently this program is written for choosing best move for a ...
15
votes
2answers
230 views

Hangman on the C++ommand line

I'm wondering if my code is just a tad too long to post here, but if the only consequence seems to be getting high-level reviews, then that's perfectly fine. This is my implementation of Hangman in ...