Core to Object-Oriented Programming (OOP), a class is a template for creating new objects that describes the common state(s) and behavior(s).
3
votes
1answer
15 views
PHP framework building: MySQL Connection and query class
I am building a PHP framework and would like to get some feedback on a few different sections of the project so far. I consider myself still a neophyte in PHP so I would like to ask if I'm going about ...
0
votes
1answer
65 views
4
votes
2answers
58 views
Console class that handles multiple buffers
I'm working on a 80x25 terminal that splits the screen into two. The top half gets the first buffer, the bottom half gets the second buffer. I'm concerned about readability and accessibility.
For ...
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 ...
2
votes
1answer
58 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 ...
5
votes
1answer
58 views
Programming Principles - Reading/writing from/to a Mifare card
Consider the following class (I've stripped XML doc for the sake of simplicity), which does several and slightly different operations through a serial port to read/write from/to a Mifare card. It has ...
0
votes
2answers
35 views
Single responsibility principle and tasks which perform multiple related functions [closed]
I have a task which will perform 3 main sub-tasks:
Download an Xml file.
Parse Xml file and import nodes in database.
Send a status email about completion.
I was thinking about naming the method ...
5
votes
1answer
88 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 ...
5
votes
0answers
110 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 ...
1
vote
1answer
79 views
Structuring a user authentication system
I'm new to the MVC model. This is where I started: User authentication system. After questioning, reading and thinking a lot, I was able to write a small framework (don't know if 'framework' is the ...
2
votes
1answer
67 views
Is my design achieving Separation of Concerns in this MVC implementation?
I've read lots about getters and setters being evil, unless there is good call for one, but I cannot figure out how to implement that knowledge into my Model layer.
Say in my Model layer I have a ...
1
vote
1answer
27 views
6
votes
2answers
242 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?
...
3
votes
2answers
92 views
Are my one-method (and a couple attribute) classes overkill?
I saw a talk by Jack Diederich a few weeks ago titled "Stop Writing Classes" and noticed that some of my code perhaps echoes what he argues against (to the effect of "classes with two methods, one of ...
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
40 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 ...
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.
...
2
votes
2answers
68 views
Simple class, solely for setting “globals”
I'm aiming for the best and simplest way to access "global" variables set in the config file for my website. So I can use them anywhere, even inside functions
It's for file versioning, and I use ...
2
votes
3answers
46 views
Calling a method outside class statically, passing other method's output as parameter
I have this class:
...
4
votes
1answer
80 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 ...
3
votes
1answer
49 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.
...
1
vote
1answer
107 views
Should this container be a struct or a class?
I have a class that serves purely as a data container for passing values from a parsing class to a class responsible for saving the data. I have been wondering whether it would be more appropriate as ...
0
votes
2answers
88 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 ...
2
votes
1answer
62 views
Simple Javascript state management class
So I needed very basic state management and notification for a small game-like thing I'm building. I decided to implement something like a finite state machine (but not quite, it doesn't transition ...
5
votes
1answer
53 views
Class for RegQueryInfoKey pinvoke
I'd like to make sure I'm following some basic coding best practices since I've had only little practice creating my own classes and using pinvoke. I've found this class to be pretty useful and I'd ...
11
votes
2answers
605 views
Too many objects, too “deep” class structure?
I have a pretty large model library I'm working on and it's turning out quite complex, or so I believe at least and I could use a second opinion.
The basic idea is that the user should only have to ...
6
votes
2answers
227 views
Blackjack game with classes instead of functions
To try out the concepts and tools I've been learning, I decided to write a Blackjack game. I wrote it entirely with functions, so it hasn't helped me at all with the concept I really lack ...
3
votes
3answers
75 views
Working with Classes (inheriting), @ properties and Initialization
I'm working on this Objective C programming assignment I found online. I'm not sure if I have met all the requirements, especially part C. Any help or suggestion will be appreciated.
Part 6
...
5
votes
2answers
99 views
Initiating class objects and arrays
I have a class that always has 14 instances. I'm just wondering if there is a better or more effective way of doing this. In this class I also have an array that is filled by calling 4 functions ...
2
votes
2answers
64 views
Generate the Norwegian equivalent to social security numbers - follow-up
First of, here is my previous post.
That should explain a fair bit. The reason I'm posting one more time, is I have changed a lot. Using more classes, let them do all the work, and the overall ...
7
votes
2answers
159 views
Displaying a scrolling stock exchange ticker in a window
I've written my first OOP program (194 lines including docstring and comments) in Python that uses Tkinter as GUI and Threads. The program shows a window and displays a scrolling stock exchange ...
3
votes
2answers
185 views
Locate user of an Android device
I am new to oriented object paradigm and I work on Android using Java project for an internship.
I must be able to locate the user and some around buildings I read stuff about how to setup ...
4
votes
2answers
153 views
Eliminating duplicated code blocks
I have an abstract PersonDao class, extended by several other DAO classes, for example EmployeeDao, ...
6
votes
1answer
117 views
Creating C++ classes and objects
I'm brand new to programming (in general) and C++ (in particular). I'm learning the basics of classes and objects.
I'm trying to do the following:
Create a class called ...
6
votes
1answer
50 views
Sorted unidirectional list with add, delete and find
I am aware of the fact that a sorted unidirectional list has only very few use cases, but nevertheless, this python code feels fairly long for Python code. How can I improve it?
...
4
votes
1answer
96 views
First attempt at making a user class
I've just begun creating my first user class. First, I need some clarifications.
Am I using try and catch correctly?
To ...
4
votes
1answer
90 views
Fixed point iteration and cobweb plot
I'm using Python to find fixed points of a given function and then draw a cobweb plot to visualize it. Thanks to this question, I have the core of the code written and can accomplish the task, but I ...
2
votes
0answers
33 views
Application Class Security
Is my Application.php class secure for continuing development?
The Application.php acts as a registry for the whole application. I tried not to rewrite already working code that is being pulled from ...
2
votes
1answer
64 views
Generate the Norwegian equivalent to social security numbers
This is just a little hobby project I've been working on. I've been using it to learn/improve my knowledge of C++.
The program generate Norwegian personal-numbers (11 digits) for males born a given ...
3
votes
3answers
129 views
Best practices to create extended class
I have two class Task and Award which extends Task. I create this class objects according ...
6
votes
2answers
71 views
Planning a rather large refactoring of physics code in a good way?
I have a large file that I want to refactor. My idea is to make helper classes with helper methods so that I can modularize methods.
Is that a good idea? For instance before refactoring:
...
2
votes
2answers
71 views
Return custom assembly attribute variables
I have a custom attribute in my assembly called SemverAttribute, and I have a helper class called AppInfo that has a function to return a number called the Semver number. It accepts an id of null-6. ...
4
votes
1answer
122 views
My simple PDO wrapper class
I made a simple database class and I wanted to know if there are any improvements I could work on as far as readability, efficiency, methods and making it modular goes.
Any other suggestions are also ...
2
votes
1answer
96 views
How can I optimize my insert function for the cuckoo hash table?
I'm working on class for a hash table where collisions are corrected using cuckoo hashing, I had difficulty writing the insert function, the function is supposed to insert the key if the ...
4
votes
1answer
102 views
Merging with different modules
We have an action merge for two projects. In the projects we have different modules like Feed, Files, Post etc....
...
4
votes
1answer
52 views
3
votes
2answers
103 views
Bad usage of classes in Python
I was recently working on a project where I had the following setup:
...
1
vote
1answer
19 views
Categorizing utilities into modules [closed]
I have two classes in my program, the one is PropertiesUtils and the other one FileUtils.
This is the general structure of ...
1
vote
1answer
98 views
Text-Based Simulator in C++/Qt with many commands
The following is an excerpt of a mostly text-based simulator of the iRobot Roomba robot vacuum. I made a class called Roomba that handles everything the roomba does. For those familiar with QT; There ...
3
votes
2answers
184 views
Validating C++ Time class objects
I created a Time class. Now I want to modify the code to perform input validation. Hour should be between 0-24, minutes and seconds between 0-59. If class need ...