Tagged Questions

Core to Object-Oriented Programming (OOP), a class is a template for creating new objects that describes the common state(s) and behavior(s).

learn more… | top users | synonyms (1)

-1
votes
0answers
17 views

Implementing template map class [on hold]

I am creating a netflix-type program and I already have a map class with the form template <(class keyType, class valueType)> class Map I need to create a movie class and I think the movie title ...
3
votes
2answers
50 views

Select products and config values from MySQL

I have working code that gets products details and config values from MySQL bit it's combined with HTML, I would like to know a better way to do this, maybe a class that I can use. ...
2
votes
1answer
29 views

Could this connection and query class be improved?

Wrote this class it allows me to connect to database and display as many columns as I wish to. I can just give it desired parameters and I'm done. I've commented about the parameters that need it to ...
5
votes
3answers
83 views

Parameterised Constructors

Finally, Parameterised Constructors are possible in VBA. Background: One rainy day, I came up with an idea: take a static class and expose one property as default (like it was done in the Reverse ...
1
vote
2answers
45 views

Processing user input for a form

I'm still learning PHP OOP, so I'd like to seek for some expert advice or criticism regarding this code I created. In this script, I created the objects I need to process the user input from a form. ...
4
votes
1answer
43 views

Logger class for MVC Framework

I have created a logger class for my own framework. Now I am trying to identify the components which can be done in a better way. The logger class doesn't log anything inside a file but it logs the ...
6
votes
2answers
86 views

Basic C# calculator (+,-,*,/) - V2

Original question: Basic C# calculator (+,-,*,/) My 'teacher' requested this problem be solved by parsing the input into a tree based on the order of operations. The class Calc variables are ...
5
votes
2answers
236 views

Custom MySQLI Class

I have created this MySQLI Class. I wanted to know if this class is secure enough to be used on the production websites or more improvements can be done to this class. ...
9
votes
3answers
214 views

Basic C# calculator (+,-,*,/)

My 'teacher' requested this problem be solved by parsing the input into a tree based on the order of operations. The class Calc variables are specific to his ...
8
votes
6answers
1k views

Blackjack on console

I have decided to create a console Blackjack game as my final Java project. Please take a look at my code and give me some feedback. I have tried to make the game as object-oriented as possible. I ...
5
votes
2answers
189 views

User-defined class for a box

We have just learned about classes. Please help me improve this program. I created a class called Box with members that represent its dimensions. Then I calculate ...
8
votes
5answers
378 views

Simple LinkedList implementation

I am brushing up my Data Structure knowledge (for preparation for internship interviews) and I started by implementing a very simple Linked List class. This is by no means intended to be able to ...
2
votes
1answer
50 views

Class to get user information

I've just begun creating a class to get User information, and I'd like for it to be improved. The global variable $oConni is the database connection. ...
5
votes
1answer
58 views

Architecture for manager that gets shared among different components

It started with a simple log manager. Then I wanted to implement more features, for example printing the name of the component that send a message. Later on, I can think of giving each component that ...
2
votes
2answers
126 views

Simple Database Abstraction Layer

I'm learning PHP and currently object-oriented programming. I would like to get a feedback; how I'm doing so far. If I have bad coding that should be fixed immediately etc. I'd call this code an ...
1
vote
2answers
78 views

Writing a class for common block of code used in many other classes

In this I have written the setAnalyticsInfo() method. The code inside this is common to almost all other (30) classes, so I have created ...
6
votes
1answer
83 views

Deleting a user from a database

I was hoping if anyone could tell me if I'm doing this correctly, I know there are other questions like this but everyone codes different and I just feel that I'm not doing this right. I'm trying to ...
1
vote
1answer
30 views

PHP framework building: System Class (reads configuration .ini file)

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 ...
3
votes
2answers
78 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
72 views

Aliasing utility class method in extended class

Consider this setup: ...
4
votes
2answers
68 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
40 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
83 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
106 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
37 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
103 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 ...
6
votes
0answers
132 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
88 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
78 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 ...
2
votes
2answers
43 views

Grouping utility methods for View classes

I have the following class: ...
6
votes
2answers
270 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
95 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
77 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
41 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
40 views

HttpSession Wrapper Class

Are there any aspects I could improve of my HttpSession wrapper class? Other suggestions are also welcome. ...
2
votes
2answers
72 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
52 views
4
votes
1answer
81 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
63 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
110 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
97 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
69 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
85 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
610 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
282 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
76 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
101 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
66 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
175 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
187 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 ...