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)

1
vote
1answer
19 views

Predicate builder

I have a predicate builder that initially evaluates to false. Because of this, the very next expression should be a logical Or. ...
2
votes
0answers
17 views

Comparison of sprite movement implementations

I've come up with two ways to do sprite movement with CreateJS, and I'm wondering if one is better than the other as far as performance and maintainability. The player data is saved in a json file ...
1
vote
1answer
37 views

Creating and sending a Fixed-Width file

This function will run every x seconds. PAN: The name we are calling our fixed width file we are transmitting. ...
3
votes
1answer
43 views

My Google Maps Script v3

My Google Maps Script v2 I re-factored my code to be more OO. Does it have any more room for improvement (naming, readability, oop, etc.)? I'm importing ...
-1
votes
0answers
50 views

Java: Program control with OOP thoughts [on hold]

I'm currently developing a console application, where you can add a dataset, edit/delete a dataset and printing a pdf file, with dataset information. I programmed already on C, but not with the OOP ...
3
votes
2answers
68 views

Assembler for Hack Assembly Language - Take 2

I have been reading this great book and I decided to do the Project in Chapter 5: Writing an Assembler for the Hack Assembly Language. You can find the specification for the Hack Machine Language and ...
3
votes
2answers
49 views

My Google Maps Script v2

My Google Maps Script v1 Using the Google Maps JavaScript API v3. Does my script have any room for improvement (naming, readability, oop, etc.)? I'm going to pair it with some live time ...
3
votes
3answers
71 views

Simple list comprehension

As far as I can tell, there is no network access happening at this stage in the code. I am accessing Reddit's API via the PRAW module. However, it is crawling, and I think it should be faster, ...
4
votes
0answers
52 views

Building Data abstraction and ADT for rectangle using “objects”

For the below given exercise: Exercise 7: Abstracting Rectangles Implement a representation for rectangles in a plane. (Hint: You may want to make use of your procedures from exercise 5). ...
0
votes
0answers
24 views

User Management OOP [closed]

I'm trying to figure out how to properly work this out. I don't know if I'm applying things correctly. I think it's a good thing to separate the User object, from the database operations, meaning that ...
8
votes
2answers
252 views

Decomposing the animal kingdom

I have implemented a Mammal class hierarchy in Java. Is it an intelligent approach, with respect to decomposition, locality and procedural abstraction? ...
1
vote
0answers
25 views

Simple Java MIDI player followup

This is my second iteration of a simple Java MIDI player. I've made several amendments and would like to see if the code is now correctly implemented and readable. This follows on from the first ...
3
votes
1answer
42 views

Form builder class

I am trying to learn OOP in PHP. My PHP knowledge is pretty good, but haven't tried OOP before. I'm currently building a formbuilder class. Can you take a look and tell me if this is the right way? ...
6
votes
1answer
43 views

Simple Java MIDI player

I created a simple program that allows you to create and play MIDI sounds. I've used the MVC approach and I’d like to know if there are any improvements to be made regarding the design and structure ...
1
vote
1answer
38 views

Building Data abstraction for line segments using “objects”

I follow this definition of "object":...
3
votes
1answer
41 views

Matchmaking system - sorting musicians by skills, genres, and location

I'm making a matchmaking system using PHP and MySQL which allows users to search through a list of musicians so that they can find people with the right skills and interests who are near them. It ...
2
votes
2answers
51 views

Fraction Class in Python

I decided to train myself in OOP with a simple perfect precision Fraction class. ...
0
votes
0answers
28 views

Object Oriented design - connection to multiple databases

I have a Python application which uses both SQLite and Postgresql. It has a connector class for each database: ...
11
votes
7answers
921 views

Mathematical functions on fractions

I have been challenged by @nhgrif to write a Fraction class to better my understanding of OOP. I have found an interesting challenge here (I apologize that the source is not mentioned, I was not able ...
1
vote
1answer
52 views

Serializing user data to send to another API

I'm trying to improve my OOP skills in PHP. One of my projects requires me to get user info from one API and send it to another API with a different structure. I will use a simplified situation, but ...
17
votes
2answers
572 views

Designing another Coffee Machine Application

After reading Designing a coffee machine yesterday, I decided I could also give the same problem a try. I have used the following problem statement (copied from the given question): Design a ...
27
votes
5answers
3k views

Designing a coffee machine

I was recently rejected from what looked like a really promising string of interviews. I did very well in a questionnaire style review, and then they handed me this assignment (more or less): ...
1
vote
0answers
23 views

Imgur API implementation using Retrofit

I've recently (an hour ago) started a project for making a wrapper for Imgur's API using the REST client Retrofit. I've only implemented a single endpoint so far as I'm questioning my design. While ...
2
votes
1answer
87 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
45 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
129 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
54 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
287 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
41 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
19 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
46 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 ...
2
votes
0answers
75 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 ...
20
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
174 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
36 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
96 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
203 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
34 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
47 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
193 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 ...
6
votes
0answers
52 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
62 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
32 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
35 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
92 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
79 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
60 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
44 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 ...