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)

0
votes
0answers
8 views

Shopping Cart Handler Class - PHP

I've written an eCommerce shopping cart handler class in PHP. Please review the code and inform me of any errors and/or badly written code and/or badly handled logics. ...
1
vote
1answer
25 views

HttpSession Wrapper Class

Are there any aspects I could improve of my HttpSession wrapper class? Other suggestions are also welcome. ...
5
votes
2answers
203 views

Database Handler Class

I've written this DB Handler class. Please review it and suggest any code edits or point out mistakes and security loop holes. Please also suggest a better way to handle things, if there is a security ...
3
votes
0answers
30 views

Simple slideshow with jQuery

I've made a very simple slideshow that works by appending and prepending images (on click and every 3 seconds). This is my first time trying to use classes or objects so any help would be great. I ...
2
votes
1answer
26 views

Form data handler class

I've started to write a form data handler class in PHP. Can you please review it and point out any mistakes or logic errors, or perhaps if a method can be written in a better way? ...
5
votes
1answer
39 views

Object.extends in JS

I built an easy inheritance implementation for JavScript that works similar to other OO languages and wanted some feedback on it. This works perfectly how I'd like it to, but I've read a lot of ...
1
vote
2answers
191 views

PHP Session handling class

I've written a custom PHP session class for handling sessions across the web app. Please review the code and point out mistakes and suggest better handling techniques. ...
6
votes
2answers
271 views

Simple PHP inheritance using an abstract class

I have created simple class inheritance of an abstract class Pet which is basically the skeleton of all other children classes. ...
11
votes
1answer
202 views
+50

My final sign up controller

I've asked a couple of questions here before regarding my controller, but I think I've finally gotten to understand controllers completely, but I'll never be sure unless I get my code reviewed. I've ...
8
votes
3answers
162 views

Scorekeeper for a game

The code is not for any project, I just want to know the best coding practices. The code is also on GitHub. ...
4
votes
0answers
58 views

JavaScript/jQuery Image Slider

I've just wrote this class for an image slider (it cross-fades rather than sliding, so a class rename may be beneficial). It's my first proper attempt at JavaScript OOP. Can anyone see any real issues ...
0
votes
1answer
39 views

Improving design for a CustomerDAO with DatabaseManager object

I'm learning about SRP and had to reduce the responsibility of a customer object, which contained too much info. So I turned that into just a Pojo and pulled out the database logic. I'm trying to ...
2
votes
2answers
54 views

User authentication class for basic user service

This is where I got the idea for most of the code. I think this is pretty decent. I want this reviewed for security. Any criticism is welcome. ...
0
votes
1answer
35 views

Optimize setting parameters from query string

I am currently setting over a hundred global variables by performing individual checks against the URL string. ...
-1
votes
0answers
38 views

Improving OOP design for interfacing with database API to insert and delete domain objects [closed]

I'm trying to create a good OOP design especially conforming to SRP for interfacing with a database to insert and delete Customers. My focus is on design rather ...
5
votes
1answer
44 views

Decoupling Presenter from “child” Repository

Still pursuing the white rabbit, I had an IPresenter interface implementation featuring this method: ...
1
vote
0answers
15 views

Effective usage of multiple joins in Eloquent dependent on variable

I have an Eloquent model that has multiple types of joins that is used to filter out different request to grab the data of movies e.g.: Actors, ...
2
votes
0answers
28 views

Parallelizing some model fitting code using multiprocessing

I'm trying to refactor some code for fitting parametric models that are defined symbolically using Theano. My goal is for all models to expose a common interface so that, as far as possible, they can ...
7
votes
3answers
83 views

Design of class hierarchy for a object formatter API forces derivatives to know too much

While learning object oriented design I'm judging my own design critically. This framework should be able to print objects in either XML, or JSON, I've stubbed in a basic implementation to avoid ...
8
votes
5answers
478 views

Program for finding Fibonacci primes

I think it could have been designed with more object orientation. I don't like how one of my methods calls another from within the method, but I wasn't sure how to return the result because it is a ...
3
votes
3answers
128 views

Complex if statements in authentication method

I had asked questions about my entire class which I'll flag for closing soon. It appeared to be a little too broad for 1 post so I chopped it up and will be asking a little more specific questions ...
1
vote
0answers
59 views

Setting up a global site search using typeahead

I've written a "clever" bit of javascript that sets up typeahead and bloodhound for use as a global search facility. To make this even more clever, I've stashed a date for when the search JSON that ...
1
vote
1answer
36 views

Simple autoloader, but trying to make it psr-compliat

I made this class, just to understand what PSR autloader is. I didn't want to download and use it without knowing how it works. So, the one I built is very simple, but I would like a review on how to ...
3
votes
1answer
45 views

Game Balance and where to store Variables

I have been thinking about this aspect of my game for a little while, and I have come up with the following solution. I am sure that there are problems with the way I have implemented it so any kind ...
4
votes
1answer
75 views

Cart mover- OOP usage and learning design patterns

Firstly, I would like to say that this site looks fantastic... I haven't tried it out yet, but I'm coming from SO, so I think it will be great. My code is for a simple "cart-creation" class and ...
4
votes
1answer
43 views

A simple dictionary tool, extensible with plugins

I'm working on a simple dictionary tool, with a base class that can be extended by plugins to represent different dictionaries. The base class does most of the heavy lifting: it keeps the index of all ...
0
votes
0answers
46 views

Am I breaking Open/Closed Principle with the factory method? [duplicate]

I believe I'm implementing a factory method for my DAO. I have three different types of DAO: SQL, Serial, RAM, and each have their own subtypes. Would I be better off with an abstract factory method ...
3
votes
1answer
39 views

Implementing an “Add Company” section in a project

I'm working on avoiding JavaScript that either directly modifies the DOM a ton, contains a ton of anonymous functions, or is encapsulated in giant ...
7
votes
1answer
138 views

PHP Form Builder Class

I would like my form generator class to be reviewed. I want to know about the following topics: Is this efficient? Does this have any flaws? Is this using the concepts in the proper way? Are there ...
6
votes
2answers
73 views

Convert numbers into a textual form

So this was originally inspired by @nhgrif's Int extension for translating integer to plain English, however the code is mainly a port of @rolfl's Converting a number to the text representation; ...
4
votes
3answers
118 views

Object-oriented widget for reuse

I have been using a pattern similar to this basic structure below. Can anyone please let me know if this is a correct way to code an object-oriented widget for reuse? I am looking to make code than ...
7
votes
3answers
156 views

Trading Card Game Prototype in OOP

So I am sure there are better ways to set this up, but I wanted to see how something like this would work in Objective-C, so I went ahead and built a prototype of a Tradeable Card Game. I've never ...
2
votes
1answer
72 views

Is it a good idea to have a public inner class as a runner for a service?

I have a service class that handles recipe management using a piquetteClient (piquette is a web app with a rest API that can run puppet scripts). The thing is ...
6
votes
2answers
77 views

Basic Imitation of C# Enumerable in VBA - or any other static class

Since implementing static classes in VBA actually seems possible I came up with an idea to try to imitate C#' Enumerable class (well, to some extent...). This is ...
2
votes
3answers
100 views

Basic terrain generator

I've decided to try and start programming using Object-Oriented-Programming, so I built a small terrain generator that could be done using something as simple as this: ...
4
votes
1answer
69 views

Trying to grasp OOP Rock, Paper, Scissors program

I'm trying to wrap my head around OOP but so far I feel like I'm just moving functions into classes and calling them methods. I am trying to create a "Rock Paper Scissors" game using OOP best ...
3
votes
1answer
46 views

Simple IRC bot with plugin support

I'm looking to see if there is anything in this I could have done better or see if could have structured the code better. Here is the project on GitHub. ...
7
votes
2answers
74 views

Ability Cards that trigger Game logic

I want to ask this question because I have been thinking about it for a while and I haven't discovered a solution that I am very happy with. When coding games, I've frequently run into the situation ...
2
votes
1answer
89 views

Statefull Strategy pattern [closed]

I have a situation in a class tries to create a group of same type of components and if some component fails then it needs to decide whether it should continue or throw the exception. Now the behavior ...
6
votes
1answer
83 views

Game of Life - OOP and Best Practices

I always have a problem figuring out what good JavaScript coding practices and conventions are and if I'm following them, especially concerning OOP. So I implemented The Game of Life and wanted to ask ...
0
votes
2answers
84 views

Validating basic data objects

I'm playing around with trying to do things in a better way, and in a class I have for sending emails, I have the concept of a recipient. This gets passed into my other classes essentially as a struct ...
3
votes
1answer
74 views

PHP e-mail sending class design

I'm working on a class, what will be able to send e-mails for our customers. I need to help with review of my classes design. I'm trying to do it to be easy extendable in future. I'm thinking about ...
8
votes
1answer
65 views

Object-Oriented FizzBuzz in Ruby

I don't use Ruby on a regular basis, but I felt inspired to write an extensible, object-oriented version of FizzBuzz to sharpen my skills. I welcome all feedback. The main class: ...
1
vote
1answer
51 views

How can this autoloader be improved?

I don't understand the concept of autoloaders, other than the bare minimum, which is that to load a class file when the class is being called. Or as the PHP manual cites it, to avoid having to ...
4
votes
3answers
90 views

Program structure to be checked according to OOP

I am building my first application based on the OOP model. The application basically responsible for sending XML Soap requests. Model contains couple classes - Server.cs which contain servers IPs, ...
4
votes
2answers
87 views

Class refactoring including changing instance methods to class methods and adding singletons

My main goal with this refactor was to change instance methods that should have been class methods in the first place into class methods. My secondary goal was to add singletons to these classes ...
7
votes
4answers
600 views

PHP OOP Login Class

This is a login class I made for my personal website. What I don't care about, is how secure this login class is, because I know it's not. But it keeps out the rare unwanted guests because I do not ...
6
votes
2answers
120 views

Basic domino game architect

I am trying to write a simple domino (five-game) with 2 players. I must say I am very bad as OOP design, and so I don't want to get myself too deep into coding then realize I have a bad design to ...
6
votes
2answers
153 views

Database layer class

I'm trying to get familiar with database handling. Can you point out my errors and what I should change? I want to learn new methods, but just don't want to learn it the wrong way. I do realize ...
8
votes
1answer
62 views

Honey I shrunk the view

Going down the rabbit hole, I wanted to be able to change the size of a form, and not have to worry about the layout of the controls. vba doesn't support user-resizeable forms, but forms still have a ...