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)

3
votes
3answers
96 views

Object Interaction in OOP (especially Python) [on hold]

Say you have a number of similar objects (e.g. instances of the class Person). Each of these instances can belong to a number of Groups, also represented by a class. To stick with the examples of ...
0
votes
1answer
50 views

Aliasing utility class method in extended class

Consider this setup: ...
2
votes
1answer
70 views

Fractions in Java

Part I-IV recommend code changes as mentioned in link 1, for the initial code given at link 2. Can you please review the code changes for Part I-IV? Part I: Constructors (1 point) Modify the ...
3
votes
1answer
50 views

Authentication cookie handler class improvements

I just finished the following application service class that handles all my HTTP cookie authentication processes. It is the best I could come up with. Although I don't think I'm violating the SRP, ...
4
votes
2answers
51 views

PHP Session Wrapper Class

I recently worked on a system for the company I work for and would love some feedback on the following class for managing sessions. I don't claim to be a PHP guru but I like to think I gave it a try! ...
8
votes
3answers
322 views

Singleton Database wrapper

Before everybody yells at me about why I wrote a PDO wrapper class, it's to avoid writing try/catch, ...
2
votes
1answer
34 views

User entity of my domain v2

I would appreciate a thorough review of my updated User entity class. It's still an anemic domain model, but behavior (like ...
3
votes
3answers
148 views

Is SList class an ADT?

As per the definition given in lecture, ADT is, With reference to this definition, I would like to call SList class an ADT following 6 invariants: Multiple ...
1
vote
2answers
44 views

Putting all desktop items into a new folder

I'm quite a newbie with Python, but I wanted to try my own little project, so I made a small script that puts all the desktop icons/folders into a newly created folder (called "Desktop1") if there are ...
6
votes
1answer
57 views

A hacked-up testing framework

Inspired by this post, I wanted to be able, in any vba project I could be working on, to create a test class and write test methods. Like this: ThisWorkbook Workbook | class module (client code) ...
2
votes
1answer
54 views

Encryption/decryption of a string with a salt

I have a new job coming up soon and want to increase my PHP knowledge. This is my first attempt at creating and using a class. I just want to know if it's the correct way to do things. It's very ...
0
votes
0answers
30 views

Values are null [closed]

I am working on a contact list. I've just about got it working, except for two problems. The output value for the user input prints as null and the Email Address output line contains the null values ...
1
vote
1answer
15 views

Create virtual host + MySQL tool

This tool adds a new OS user, create directories and configuration files for Apache + NGINX, MySQL (MariaDB) database and user. I tried to take into account the comments from my previous post. Hope - ...
9
votes
1answer
76 views

Unit Testing in VBA

Unit testing in VBA is... lacking. (What isn't lacking in VBA though?) Since I've become more interested in unit testing lately, I decided I needed something better than ...
9
votes
1answer
56 views

Yet Another Fraction

A recent question inspired me to implement a Fraction class. I decided to write this one in vba, because I like writing tools for the poor souls that still have to ...
6
votes
1answer
97 views

Pokemon Type Evaluator part 2

I started anew and completely refactored the way I implemented Pokemon Type Evaluator. Also, first use of a lambda expression (Case of using it, but still don't fully grasp how it's working). I'm ...
2
votes
1answer
79 views

Any improvements for my LoginController class?

This is probably going to be my final question regarding controllers. I feel like I have a good enough understanding of them now and am able to write them cleanly. I've recently adapted a less error ...
5
votes
1answer
85 views

Improving an IRC bot

I've recently started working on a java project, and the main purpose of it is to get better at Java. I've decided to make an IRC bot for twitch. But after some hours of progress I already see my Bot ...
1
vote
2answers
36 views

Reading certain values from an object

I'm trying to read certain values from an object. What would be the best practise to do so? ...
2
votes
1answer
25 views

How should I tell Rails which of these content types to load for a given feed?

I have content management system for an iOS app built with rails. Right now there a are three different types of content. The first two are just strings uploaded into a textfield by the user. One is ...
4
votes
3answers
277 views

JavaScript constructor and namespace in object literal style

Is this a good way to create a class with a constructor and namespace in object literal style? ...
5
votes
0answers
109 views

Is my LoginView class valid?

I know the Model, Controller and View's purpose, but I have never really found a good concrete class example of a View class. Usually I see people having some small ...
2
votes
0answers
34 views

Creating a menu for widgets with editable settings

I'm trying to create a menu for widgets with editable settings. As of now I'm setting these settings per object by coding them in like you can see below. How could I make this shorter / ...
2
votes
2answers
70 views

Rock-Paper-Scissors in procedural and object-oriented

I am comfortable with the procedural style, and learning the object oriented, so I have done a small Rock Paper Scissors game in both styles. This script is in procedural style and this one is in ...
0
votes
0answers
6 views

DataMapper for a MMO game plugin to send packets [migrated]

I am working on an plugin for some game-server. The information about the plugin is not really necessary. Few points you might find helpful to answer to this question: The server The server is ...
1
vote
0answers
20 views

Liskov Substitution and SRP Principle violation - how best to structure this scenario? [closed]

While learning SRP and LSP, I'm trying to improve the design of my code to comply best with both of these principles. I have an employee class that has a calculatePay method on it. Firstly, I believe ...
2
votes
1answer
68 views

A wrapper class for Sessions in PHP

I have been using $_SESSION, $_POST, $_GET, $_SERVER ...
5
votes
1answer
100 views

Transforming jQuery form code into clean code

The following JS code handles when the form is submitted and some little extra stuff. I'd like to have it reviewed on the following aspects: Readability Efficiency Usability OOP It works exactly ...
6
votes
2answers
241 views

User authentication system

I'm new to OO PHP and I'm trying to create a simple properly-designed user authentication system. What am I doing right and what not? Is this right according to the MVC model? ...
9
votes
2answers
340 views

Project Euler #18 - Max path in a triangle

I've been learning Java for the past 6 months online and haven't had anyone review my code before. I'm worried that I may be making lots of beginner mistakes and was wondering if anyone could point ...
8
votes
2answers
256 views

MySQL class to add user/database

I'm creating tool to add new virtualhost on UNIX-box. One of tasks is to add a new user and database to MariaDB (aka MySQL) server. In fact - this my first 'real' attempt to use OOP. Here is class, ...
6
votes
4answers
216 views

Australian income tax calculator

I'm looking for some feedback on my first Javascript app. I've build an app that calculates tax for Australian tax payers. Would be great if someone could have a look over the code that I have ...
5
votes
1answer
128 views

Service class that handles form validations

I've made a (service) class to handle all form validation of my application. It contains a set of frequently used validation callables extracted into private methods that I use to build each ...
4
votes
1answer
60 views

Database and file backup script

I created a Backup class because I couldn't find one that worked well on Windows and remotely, to do this I have combined a lot of questions on stackoverflow with a lot of trial and error to get it to ...
0
votes
0answers
6 views

Redundancy caused by polymorphism [migrated]

I have two chat rooms, one has administration behaviour, and one doesn't. I have factored out all of the common code into a base chat room, but the ...
6
votes
2answers
68 views

Reorganize a maze game from one large class into smaller classes

I'm new to Java and I really don't understand how to make more classes work like one. So if anybody could explain and help me divide my large code into smaller classes (like Player.java, Main.java, ...
2
votes
1answer
39 views

Autoloading Class files and instantiating a class - Admin backend

At the moment I am auto loading my classes with: spl_autoload_register(function ($class) { require_once 'classes/class.'. $class .'.php'; }); And ...
2
votes
2answers
88 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
35 views

HttpSession Wrapper Class

Are there any aspects I could improve of my HttpSession wrapper class? Other suggestions are also welcome. ...
5
votes
2answers
224 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
47 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
29 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
50 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
223 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
286 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. ...
12
votes
2answers
353 views

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 ...
10
votes
3answers
198 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
68 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
42 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
61 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. ...