Object-oriented programming is a programming paradigm using "objects": data structures consisting of data fields and methods together with their interactions.
0
votes
1answer
63 views
I've finally found a satisfactory way to create classes on JavaScript. Are there any cons to it?
Depending on external OO libraries is really bad, using prototypes/new has some limitations, using only hashes has others. Dealing with classes was always a pain in JavaScript and it didn't help that ...
2
votes
1answer
74 views
Collision detection implementation
I'm working on a clone of Hunter Story. You shoot monsters with your bow. Recently I implemented collision detection, this is all working correctly, and I don't think the code needs any dramatic ...
2
votes
2answers
60 views
General advice on a practice linked_list for C++ classes/templates
Introduction
I'm learning C++ (Coming from Haskell, C, and Assembly - and other languages sparsely) and this was my practice with classes and templates. It's a linked list that you can call in this ...
3
votes
0answers
61 views
Best OOP method for a layout library
I had a code for a layout library which looked like :
$this->layout->setLayout($layout)->setTitle($title)->render()
etc.
Today I started writing a new code, simpler and smaller :
...
0
votes
1answer
64 views
Q&A system model design [closed]
Now I am trying to build a Q&A website by myself.The models below is my model design.I have some questions about this.
1、class Category:
public class Category {
private String name;
}
...
1
vote
0answers
35 views
Lua OOP and classically-styled prototypal inheritance
I want to do some object-oriented programming in Lua, and I decided on something like this:
local B = {} -- in real life there is other stuff in B
B.Object = {
constructor = function() end,
...
0
votes
1answer
45 views
Image Resize/Crop Class
I've combined some of my own functions with a function I found and I'm curious to know what others think of it. It will be used to upload and resize/crop images that are jpeg, jpg, png.
<?php
...
-1
votes
0answers
50 views
Handling external services [closed]
Our application relies on third party services. I can search for photos from Google. I can search for Videos from Youtube. I can search for Users from Facebook / Youtube etc.
Our current solution is ...
0
votes
1answer
41 views
Should a User class only contain attributes and no methods apart from getters/setters?
I'm trying to improve my OOP code and I think my User class is becoming way too fat.
In my program a user has rights over "lists". Read, Write, Update, Delete.
So I made a User class
class User
{
...
1
vote
4answers
174 views
Making this code 'more' OOP
I have just started to try and learn 'OOP' but it appears I'm doing this wrong, according to the people on StackOverflow the code below is far from Object Orientated, but I'm finding it hard as I'm ...
2
votes
1answer
75 views
Abstraction for multiple connection methods
Coding to the interface, rather than the implementation. Here is what I'm doing in simple terms.
Note: Although written using PHP, this is more of a general design / abstraction question that ...
2
votes
1answer
52 views
Design with Context, Table and Functions
Each class of my project has several inputs and outputs. Each input, the same as output, depends on it's own set of value-datatype.
I need to provide a mechanism to forward data streams from one ...
0
votes
0answers
11 views
Is it acceptable for child classes to “break” parent class functionality? [migrated]
One of the devs that works with me is following the Open/Closed Principle to add functionality to a Model by extending from our framework ORM.
class BaseModel extends ORM {
...
}
All our models ...
3
votes
1answer
92 views
The eternal dilemma: bar.foo() or foo(bar)?
I was using foo(bar) as it's adopted for functional programming.
console.log(
join(
map(function(row){ return row.join(" "); },
tablify(
...
3
votes
1answer
59 views
Static variable in method vs private class property
I have a class with a method that will be called multiple times over an object's lifetime to perform some processing steps. This method operates on a mixture of immutable (does not change over the ...