Object-oriented programming is a programming paradigm using "objects": data structures consisting of data fields and methods together with their interactions.
3
votes
0answers
38 views
Moving buttons is very slow
I have a very simple app which removes buttons and re-adds buttons to certain layouts when a button is clicked. The problem is this process is taking a very long time. How do I speed this process up?
...
4
votes
2answers
37 views
Batch Processing : Design check with SRP and OCP prinicple
I have to create a batch process which reads data from DB , process it and saves it in db . The batch data is fetched organization wise ( each organization has set of data to be processed) at once.We ...
3
votes
1answer
40 views
Php Login Class - Security and Logic check
I write a simple php login class that only operate on php sessions to login user in the system.
My Question is that this class is secure enough to be used on production environment ?
NOTE : Die ...
1
vote
4answers
185 views
Matrix operations using classes
So I recently had a practical exam in which I was told to execute a function of a menu oriented matrix operation program using classes. The code I made was supposedly wrong as I hadn't used classes ...
0
votes
1answer
33 views
Mixing in-class initialization and initializer lists [on hold]
From this question, I do know that initialization list and in-class initialization are different things.
The class in the following code has members with in-class ...
3
votes
1answer
32 views
Test cases for an elevator simulator
I'm trying to test an elevator simulator program that runs in the console and requires user interaction. At the moment, my tests look like this:
...
-2
votes
0answers
61 views
Python OOP composition [closed]
Below is code with basic composition implementation in Python. (This is a simplified version of the real code, because I am most interested in review of the approach.)
We have barrels with apples. ...
1
vote
1answer
50 views
Checking if a user can withdraw money
This is purely testing my skills; I am not actually coding for a bank. This is part of a bank account class.
...
0
votes
0answers
24 views
is it the correct way to create Classes in Javascript? [closed]
I made this way to create classes in javascript.
is it the correct way to create Classes in Javascript?
What do you think about this?
...
0
votes
2answers
81 views
IoC.Resolve deep in the project or Constructor Injection on entry point of app
I'm building cross-platform application (every mobile/desktop OS + web in ASP.NET). I'm using Xamarin, so I can do everything in C#. But before I start working on UIs, I want to build soild, flexible ...
1
vote
1answer
18 views
1
vote
0answers
20 views
Recursively merge objects with corresponding property names
I have such objects that I need to merge:
...
1
vote
3answers
100 views
1
vote
1answer
77 views
Price calculator for motors and pumps
Note
This question was born in request to post more details from this question on Programmers. Since details may uncover new/different complexity, I'm asking another question here. I also will use ...
-1
votes
1answer
35 views
Returning a tuple utilizing this script [closed]
The script below is taken from this site. It doesn't currently work, but I have made it work at my own computer (not currently accessible) by changing what BeautifulSoup looks for.
The script is ...
2
votes
1answer
41 views
JavaScript ajax formquestion editor
This is the JavaScript file that i use for my editor that allows people to edit questions from a form.
I'm wondering if this sort of approach to use JavaScript objects is good or that I kind of miss ...
4
votes
2answers
43 views
Python object-oriented pipe cooling simulations
Here is my code simulating liquid in a pipe cooling under different conditions. How did I do approaching this in an object orientated way? Is there any way I can improve this code?
...
2
votes
0answers
52 views
Class that generates records after performing business logic
I wrote a small class that does a database lookup and it generates a collection/Array. The Collection is resorted based on values returned from the database. Finally, the records can be retrieved ...
1
vote
2answers
83 views
1
vote
0answers
50 views
Geocoder Webservice client
I have been writing/fixing Java code, but just getting into object design/architecture. I am writing a webservice client in Java to integrate a commercial Address Validation Geocoding Webservice into ...
3
votes
2answers
45 views
Custom event handler in Javascript
In my web projects I often need a simple way to trigger callbacks defined somewhere else. Leaving jQuery finally behind me, I was missing their simple event system and tried to create my own. I'd like ...
0
votes
0answers
60 views
PHP autoload class design for a framework
I'm developing a php framework called Stack. I just created the autoload.php as follows.
...
1
vote
0answers
31 views
Simple login and authentication app
so for school I had to do a real simple login and authentication system on an android app and I'm wondering how my code can be optimised to reduce code duplication and how it can be more object ...
0
votes
2answers
49 views
Custom MySQLi connector class for PHP
I have written a class that connects to a database using MySQLi and has methods for the connection itself and returns the instance of the MySQLi class.
This works, but feels a little "clunky" and ...
2
votes
1answer
110 views
Is there a cleaner way to write this code?
The code works as it is but it's very messy. Is there a way to clean up the null checking in the if statement?
...
3
votes
0answers
31 views
Angular OOP services and caching
I've created a caching service using OOP techniques combined with the revealing module pattern and the angular-cache library. New CacheDataClass objects are ...
2
votes
1answer
58 views
GitHub Auto Copy Committer via API
I did write the GitHub Auto Copy Committer.
The purpose is to copy an existing public GitHub repository to in
another repository - commit per commit. It's reason is not a full copy
of a ...
5
votes
1answer
59 views
Auto-complete using Tries in Python with OOP
I am working on a problem to develop auto-complete functionality to practice different applications of Tries. The auto-complete function will return all the possible words in the wordlist given a ...
4
votes
1answer
34 views
Simple plotting abstract base class and example subclass
I came across a CocoaControl ZFPlot and wanted to extend here. I ended up writing a base class (ZFPlot shown below) as well as several extensions (ZFLine, ZFScatter, ZFBar, none shown here for ...
0
votes
1answer
60 views
Uploading photos: Domain Model and Repository classes
In the database, I have a table with name photographs with the following columns:
id
...
3
votes
2answers
47 views
Classes, one responsibility principle and magic methods
I am currently building a small application that allows users to create a slideshow, each slideshow consisting of slides that are either videos or images. Although this will be relatively small at ...
1
vote
2answers
62 views
Adding new articles
Following is a working program to add new articles. The only thing I want is to check if there is any way to write it in a better way, or if the architecture is good as it is.
Maybe I did not have to ...
2
votes
0answers
17 views
jQuery Toolbar Module
I'm fairly new to JavaScript, and wanted some critique on some code I've written based upon what I've learned recently. I have a strong background in OO programming (C/C++, C#, Java), but recently ...
3
votes
1answer
24 views
Configuring a DataTable using CoffeeScript
I am working on a simple Rails app. For the Expense resource I use a DataTable. So, in my CoffeeScript for this resource I basically do several things:
initialize ...
4
votes
2answers
61 views
Wrapper class for PHPMailer
Is this a right way to use/implement an external library into a project? If it's not how do you do it?
...
8
votes
2answers
83 views
Yet another lightweight Enum for Python 2.7
I'm trying to develop a lightweight enum for Python 2.7. This question is downstream of the SO question here; for context, a streamlined version of the bulleted addendum to that question is ...
1
vote
0answers
29 views
Follow-up: Window Creation Wrapper Class
This is the revised version of the Window Creation Wrapper Class. I tried to improve the code due to the remarks of @user1118321 (see posted link) and I hope for further reviews. For instance, you ...
1
vote
2answers
41 views
Return array of objects with matching keys
For an exercise, I've written a function that, given an array of objects and a key (2nd argument), returns a new array of objects that contain all properties from a key. How'd I do?
...
6
votes
2answers
111 views
Super Market Pricing Model
I have modelled the task of super market pricing as per the below task.
http://codekata.com/kata/kata01-supermarket-pricing/
Please review my code and suggest any improvements.
...
1
vote
1answer
52 views
Bowling scorecard app
This is one of my first attempts in writing a bowling scorecard app. It can have more than one player. I would like to know if anyone has suggestions to improve the code. I am trying to make it as ...
5
votes
1answer
103 views
Simulate a person who is working in a quarry with classes
I build my first "bigger" program with classes. Does this look good? Or do you see something, which I could do better?
Do you think I could use a delegate for changing the stones to money here? And ...
2
votes
2answers
86 views
Returning a different but similar “increasing” string depending on instance argument
I have to work with a function that takes an instance of a class as an input, and depending on that instance, I have to return a specific string. It works, but it has a lot of repetitive code. How can ...
3
votes
2answers
34 views
Moving a clock forward
I am taking a Ruby class and our assignment was to write a class that takes two users inputs (1. the time, 2. the amount of minutes to move forward). Then based on the two inputs forward the time by ...
1
vote
1answer
56 views
Gathering metadata on files in GitHub
I am a relatively new programmer and am currently working on something with the egit GitHub client library which requires me to iterate over a bunch of values and if a condition is met, add a bunch of ...
4
votes
1answer
116 views
Animal inheritance hierarchy
I'm trying to figure out if I'm doing superclasses right. Also, I welcome critique on Java structure/syntax etc.
Animal.java:
...
1
vote
0answers
72 views
A wrapper class for Telegram bot API in PHP
I wrote a wrapper class in PHP to use Telegram bot API. What do you think about it?
I used this class in some projects and it doesn't have any problem but I want to know if it is optimized?
...
4
votes
2answers
24 views
Multiple server FTP download class
I've written this a short time ago. Do you see anywhere I can improve my logic? This is my first python script.
...
7
votes
1answer
95 views
Simple console Snake game following GRASP
I would like to know if there is anything that I missed following the GRASP patterns.
The Main Controller class:
...
4
votes
1answer
107 views
Window Creation Wrapper Class
This Question now has a follow-up here
I don't think that there is any new technique in my code but in my opinion it's ok all in all (with a bit of magic). Maybe you can find something to improve or ...
-1
votes
1answer
50 views