Object-oriented programming is a programming paradigm using "objects": data structures consisting of data fields and methods together with their interactions.
2
votes
0answers
15 views
First time using ES6, looking for feedback on a cron module I created
I just created my first ES6 module in node, and first time using promises. And I was hoping to get some feedback on it. I am the only developer at my current company, so I cannot get feedback here. I ...
3
votes
1answer
50 views
Shape area computer
I've builded a 2D-shape area calculator. Currently it can only calculate:
Circle
Rectangle
Triangle
Originally I was thinking how to encapsulate the parameter(s) into a class, Parameters, so that I ...
1
vote
0answers
30 views
Pomodoro Countdown Clock
I would appreciate feedback on this Pomodoro Clock. I tried to use straight
Javascript for the logic instead of JQuery and I would be interested in any observations of
where that was a good or bad ...
3
votes
1answer
74 views
Create an object when you need it! in PHP
Well Iam trying to learn OOP for a while now, My idea here is to create a simple CMS kind of thing.And I did something like this:
App Class:
...
0
votes
0answers
16 views
A Base Controller (parent) class based on flask pluggable view
A controller based on flask pluggable view. the base controller is made as parent for the routing controller. the goal of this BaseController is to make my routing controller become OOP.
...
-1
votes
0answers
31 views
Java Command Pattern prepopulate list of Invoker class [on hold]
I have number of classes that parses String. These Strings are sent by LAS (Laboratory Automation System) machines after performing sample's tests and then parser classes are responsible to parse them ...
1
vote
0answers
29 views
Organization of modular code. Not a service and not a model, where should it go? [closed]
I currently have some code, which I'd rate as modular / loosely couppled, mainly because Seperation of Concerns is paid attention to:
Its not Uploads job to ...
8
votes
3answers
145 views
Vending Machine
After doing a lot of reading and practicing, I've come up with a simple program that implements multiple OOP techniques, principles and several design patterns such as Observers, Factories and ...
1
vote
0answers
38 views
Socket.io Node.js Object Oriented Code Structure Approach
following application:
Users can join Rooms. A Gameroom inherits from Room and has a queue where Users can queue for a game. If enough people queue they get thrown into a game lobby. Lobby also ...
7
votes
2answers
61 views
0
votes
1answer
34 views
Improving Design for structured Keys
On several occasions I had to use a fixed set of keys (constants in the sense of static final String) with some additional logic (grouping in different keySets). After some more or less lefthanded ...
0
votes
0answers
31 views
Avoiding redundant data members and inheritance in c++ [closed]
element is an abstract class. quadrilateral and some other classes inherits from element
...
-3
votes
0answers
28 views
Modular Javascript [closed]
I am writing my javascript in a modular pattern. Below I am writing the code for a review so that I can know that I am in right path or not.
I have instantiated slick slider in a private function to ...
7
votes
1answer
95 views
Coffee machine that adds condiments dynamically
I want to make a coffee machine class which can produce coffee with condiments I like, and the price of the final coffee can be easily calculated.
I chose decorator pattern in my design. I've tried ...
0
votes
3answers
54 views
Grading students: proper encapsulation [closed]
I am discussing with one of my peers about proper encapsulation. We had to write this code. One of the specifications is: "The Student object has to have a Grade object called finalGrade. Code hint: ...
4
votes
0answers
17 views
Excel VBA object with validated bounds for an interval
I'm working through a problem I have with Excel VBA. I have two object classes. Class clsLoadStep stores three copies of class clsLoad objects. Class clsLoad simply stores a value and a string stating ...
3
votes
2answers
52 views
Implementing operations for Number classes
I'm currently working on a library that provides a mathematical interface for different operations. Operations like solving an equation or calculate derivatives of a function. With a recent update in ...
3
votes
1answer
50 views
Tic Tac Toe in Python, converted to use classes
I am new to using Classes and Objects, and as such thought i would edit a previous Tic Tac Toe game i created, this time using Classes. I found it easier using entirely public (Class?) variables (ie, ...
6
votes
2answers
108 views
A simple program which returns specific value from array
After researching for an hour regarding SOLID Principles, I tried to do it myself. Please note that most of these codes were from the ideas of others.
I created a simple program which returns ...
1
vote
0answers
18 views
What is best using of OOP in Java in this example
I created example for simple calculator depending on Scanner object to ask from user to choose any of the four standard Math Operations, I divided it on two class (SelectOperation and ...
1
vote
1answer
58 views
multiple instances of maps and markers using object oriented javascript [closed]
This is my first attempt at object oriented javascript code. I have been writing JavaScript code for few years now but this is first time I am trying to write OO javascript code. I have read about OO ...
1
vote
0answers
35 views
Basic demonstration of sprite class in pygame
I recently created a general purpose sprite class that allows me to easily create and render sprites to the screen, and test for collisions among other things. That class can be found here. So in ...
3
votes
1answer
51 views
Multifunction sprite class for pygame
I've written a class that allows me to easily create sprites on the screen, and then do things like: setting an image or an animation; move the sprite as a platformer or as a top down game; and test ...
5
votes
1answer
101 views
Conways Game of Life in Swing, using OOP
I'm relatively new to coding and was wondering if anyone could review my code? I'm trying to get my head around the concepts of Object-oriented programming in particular. This is an implementation of ...
3
votes
1answer
32 views
Library to verify GTINs of various lengths
I'm writing a library to verify GTINs (GTIN-8, GTIN-12, GTIN-13, GTIN-14) and calculate their check digits. The calculation of the check digits don't differ from type to type, so I can use the same ...
11
votes
2answers
188 views
Solve a set of “restricted” linear equations efficiently
I was recently asked to solve the following challenge (in C++) as part of the interview process. However, I haven't heard from them at all afterwards, and based on past experiences of unsuccessful ...
1
vote
1answer
36 views
Method that remove duplicates from a list of words in Java [closed]
Today, I took a coding challenge with this question:
Given a List of Strings, write a method removeDuplicates that removes duplicate words from the List and returns an ArrayList of all the unique ...
1
vote
1answer
43 views
Creating custom control in Unity3D that has same UI but different behavior
I made some custom control named Range Control in Unity. It has two buttons a "plus" and a "minus" and an input field that shows the current value. The control has (for now) two implementations:
None-...
1
vote
1answer
46 views
CMS controllers, from procedural to object oriented
I made my own extra slim flat file CMS with PHP, for a website that needs simple updates. You can have a look at its functional current state here (username is Username, password is Password).
I ...
3
votes
2answers
35 views
Configuring an editor for various languages using Factory Method Pattern
I need to know if my code is a valid implementation of the factory method pattern. Also, if the Configuration and Editor were interfaces would this still be a valid implementation of the Factory ...
1
vote
1answer
59 views
Php class for url generator
I wrote a class to generate URL as I need. (Using http or https and switching off the rewrite rules)
That is my first OOP code. It's the right approach, any suggestion?
inc/class.urls.inc.php
...
5
votes
1answer
672 views
Create shapes in a console
I've done a job interview assignment on shapes (surprising ah?!) which is a C# console application which creates a list of shapes basically. It's available here, but for my question the only relevant ...
2
votes
1answer
38 views
Design for class which accepts large array in constructor [closed]
Let's say we have the following class which performs interpolation on irregularly spaced data:
...
7
votes
1answer
72 views
Modelling employees in Go as a basic OOP exercise
I am learning Go and have the following working code:
$GOPATH/src/mvctest/main.go
...
2
votes
2answers
71 views
Make use of Object Oriented Design in an Android App with multiple activities
First off, I'm no Java programmer(but I do know the concepts of OO programming), I have this project I need to work on but I currently don't have a lot of time to spend in learning Java and then ...
4
votes
1answer
75 views
Convert number from base-10 number system to any number system
I wrote a small method for convert number from base-10 number system to any number system (code is not perfect but that is not the point).
My question is if I get right single responsibility principle....
8
votes
3answers
123 views
Immutable Object class in VBA – Creatable only through constructor and not via “New” keyword
Goals for the class
Create Immutable objects – i.e. only Getters – no Setters
Object creation only possible through a constructor, not via New keyword, to ensure ...
6
votes
1answer
91 views
App to manage a football tournament database
My question is all about class design.
I have this app that is connecting to a SQL server, retrieving some tables, the user works on the data, and then it updates the database.
I should say that all ...
3
votes
2answers
90 views
Loading data from a web API to be displayed in a tableview
In my object Dish xxx.Dish, I want to access the Choice class price and name to display . ...
1
vote
0answers
34 views
bullet-proof way to generate a list of object attributes (if object has them)
Background
I wrote a a couple functions that make it possible to generate a list of attributes for any given object that has them. I use the list that is ...
6
votes
0answers
45 views
OOP Critter caretaker program from Learning Python for the Absolute Beginner
I'm currently learning programming and python from python programming for the absolute beginner, third edition. I've been doing the challenges set out at the end of each chapter but I'm never sure if ...
1
vote
0answers
38 views
Amplitude and Frequencies of sound Analyser
As I'm beginner with mobile/OO programming, I reached a situation that confused me and made me wonder if I was coding correctly...
The main class:
...
3
votes
1answer
20 views
Adapter for querying incompatible systems
I made an interface for constructing an abstract query against a data set.
For example if I have an array of objects, and I want to filter it and return only the objects that match certain criteria, ...
5
votes
1answer
39 views
Iterator to generate all the words (of a given words) that are one change away
I'm trying to create an iterator, that will generate all the words that are one change away.
For example, if my input is "sam", I should get the following words:
"aam", "bam", ..."ram","tam",...."...
5
votes
2answers
178 views
PHP MySQL PDO Database Class
Please let me know if any improvements could be made to my PHP PDO MySQL Class.
...
7
votes
2answers
63 views
OOP Sudoku solver with minimal guessing
Having only had experience with programming in Matlab I started this project to learn a real programing language, object-oriented programming and a proper coding style.
I wanted to implement a ...
2
votes
0answers
65 views
C++ Snake Object-Oriented
So I've made a snake game with object-oriented approach. I would be glad if you could take a look at the code and give me any advices/tips/point out errors/etc. :)
main.cpp:
...
2
votes
1answer
86 views
Hackerrank: KnightL on a Chessboard
Problem statement
KnightL is a chess piece that moves in an L shape. We define the possible moves of KnightL(a,b) as any movement from some position (x1, y1) to ...
2
votes
1answer
39 views
JS composition - Components depend on others
NOTE: I am not familiar with a lot of terminology. If I am naming things incorrectly, please correct me!
Making small game engine for learning. Mostly using inheritance, but the more my project grows,...
5
votes
1answer
80 views
Wrapping libusb library in C++
I want to use libusb library in my C++ application. I have created classes which wraps libusb functions. You can see that libusb API is split into 8 sections:
http://libusb.sourceforge.net/api-1.0/...