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)

-3
votes
0answers
28 views

put more than 1 data in 1 node in linked list in c++ [on hold]

There's small code i have a problem with they gave me a class Student and many objects inside it{ getName, getID ...etc}. then they asked me to: Create the following Linked List: ...
3
votes
1answer
39 views

How can I ensure some structure for classes for a plug-in system written in Python?

I have written a toolkit (hwrt) which has a plugin system. One type of plugin is a feature (see this) for many of them. There are some restrictions of feature ...
-6
votes
0answers
27 views

Ruby classes implementation by example [closed]

I'm trying to learn Ruby by examples and exercises. Code a Ruby program that simulates a Hotel room lot. User will enter, issued a ticket, exit and of course pay. Basic Required Scenarios: User can ...
2
votes
1answer
16 views

GSON parsing - nested classes or not

Today I was trying GSON after a while and went to the YQL console to run this query: ...
2
votes
1answer
29 views

Class for formatting topics using BBCodes

I'm developing a program for users from a VBulletin's forum. This forum has a lot of people interested in write good articles but some of them don't know how to use the formatting bar in his favor. ...
0
votes
1answer
82 views

User Registration

I'm fairly new to PHP and am very interested in learning best practices, etc. I have just created a user registration system mostly in OOP that will dump user info into a database I've created. This ...
3
votes
2answers
91 views

How to achieve less repetitions for applying the same method to multiple properties?

I am looking for generic ideas and guidelines of how to improve the style of my coding and make it more readable and robust. ...
4
votes
1answer
41 views

Class representing both cartesian and spherical coordinates

I have had little experience with OO programming, being a typical engineer I tend to hack together functional code. However, I'm trying to change that and I see value in implementing OO when modelling ...
1
vote
1answer
32 views

jQuery slideshow code - adding previous and next classes a better way

I have a slideshow in jQuery slideshow switching picture automatically every 5 seconds with CSS3 transitions. The current picture has the current class, the ...
0
votes
2answers
57 views

Insert into table class

This class should function as a simple insert into table. What do you think about it? How can I make my code better? ...
1
vote
0answers
43 views

Singleton request validator and sanitizor class

I have tried to code a PHP singleton class for validating multiple/single fields (sanitizing is optional). When validating single field, on success it will return 1 (...
1
vote
3answers
80 views

Coding on interfaces/superclasses not implementations

From pretty much any book I've read it always said to code on interfaces/superclasses and rarely on implementations, today though that advice made a bit confused about how I should format my code. ...
1
vote
2answers
113 views

Bank simulation using ArrayList

Problem Statement: Design a BALANCE class with account number, balance and date of last updation. Consider a TRANSACTION class with account number, date of transaction, amount and transaction ...
6
votes
0answers
87 views

UIntArray class in PHP (part 2)

This question is the follow up of the question: UIntArray class in PHP @Brythan provided a really nice review and I have improved my class. I have addressed almost all the issues he pointed out ...
0
votes
2answers
142 views

Connecting to a MySQL database with C#

Can anyone help me with checking this code? It is for connecting to a database. The method getFromDatabase is to take values from the database and put it to a ...
4
votes
0answers
80 views

Wrap function pointers in template classes

I'm working on a C++ library for Arduino and other embedded systems. I'm currently working on wrapping up function pointers and member-function pointers into two C++ template classes (function and ...
3
votes
1answer
92 views

Populating values into a C# object

I have written a function to populate values into a class whose structure is as given below ...
4
votes
3answers
327 views

Having two abstract (static inner) classes within the interface they implement

Is it wrong? Should I have these 2 classes in separate files? ...
3
votes
1answer
139 views

PDO wrapper class for database

I have my PDO Wrapper class and would love to get some more tips/opinions about what you think. This is my first class and I basically put my time into making it as logical and standardized as ...
4
votes
2answers
44 views

Should I create an abstract runnable? I've 4 sub-classes which perform similar work but only 3 of them have identical constructors

I've added the code for an abstract thread class and 2 sub-classes. The structure and job of the threads (sub-classes) is identical except one difference: ONE of ...
3
votes
2answers
75 views

SMTP client to send search results

I have the following working code to send search results via e-mail. Since we have segregated domains that cannot talk to each other, the program needs to support multiple SMTP servers. ...
3
votes
2answers
452 views

Class design for a student class

Problem Statement: Design a STUDENT class to store roll, name, course, admission date and marks in 5 subjects taken from user. Create an array of STUDENT objects. Provide methods ...
10
votes
1answer
144 views

UIntArray class in PHP

I have seen UInts being natively supported in other languages. PHP allows you to install a third party extension, but I can't do that ATM, so I've decided to create ...
1
vote
2answers
58 views

Simple interface and class for holding text to be analyzed

I am making a sentiment analysis library targeted first at social media text (like Twitter) and then I will expand it for more general use. For the first step I am making a simple interface and a ...
2
votes
1answer
129 views

Validating email addresses and phone numbers

I have following code and I need need help refactoring: Validation class for objects you may create: Email address URL Norwegian Mobile Number (must start with 4, 9 or 59 and be 8 digits long) ...
3
votes
2answers
71 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
31 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
122 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
61 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
53 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
122 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
272 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. ...
10
votes
3answers
259 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
215 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
405 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
53 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
60 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
152 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
81 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
97 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
48 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
111 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
83 views

Aliasing utility class method in extended class

Consider this setup: ...
4
votes
2answers
79 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
43 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
1answer
130 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
220 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 ...
-1
votes
2answers
44 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
136 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 ...