Object-oriented programming includes features such as data abstraction, encapsulation, messaging, modularity, polymorphism, and inheritance. Many modern programming languages now support OOP. From Wikipedia: Simple, non-OOP programs may be one "long" list of statements (or commands). More complex ...
0
votes
1answer
15 views
Overriding vs Data Fields - which is the better option?
For example, a custom component needs to know what String to paint as its title.
Overriding
CustomComponent c = new CustomComponent(){
@Override
public String getTitle(){
return "A ...
0
votes
0answers
19 views
can public method call itself recursively
what for (potential usage): e.g. to use for recursive dir traversing
(BTW: I know about RecursiveIterator)
some (rough) idea example
class some_class {
public function some_method() {
if ...
0
votes
1answer
4 views
Retrieve a property of a class as a collection
I'm working on a small project and got into some troubles trying to keep it OOP.
I have a global variable:
Public Stations As New Microsoft.VisualBasic.Collection()
And 2 classess: Station & ...
0
votes
2answers
15 views
Undefined property and Undefined index when referencing a class from within another class
I am currently working on a large project for a client, and to help simplify things and make managing sessions easier I have made a session class, this means that if I ever change the way I manage my ...
2
votes
1answer
44 views
PHP, OOP, Different formulation
I am studying the differences between Abstract and Interface and I read some sentence
saying
A child class can only extend a single abstract (or any other) class,
whereas an interface can extend ...
0
votes
1answer
14 views
Altering Domain Entities When Changing Persistence Layer
In my app, I've been using a DB that stored its IDs as strings. The DB also stored another property (Etag) for each document/row. Because of that, I've had my domain entities derive from this base ...
0
votes
0answers
14 views
implement a observer and iterator design pattern as a template
http://i.stack.imgur.com/IjfYc.png
for this picture...
How can implement observer and iterator pattern for player and room class.
Thanks.
2
votes
1answer
21 views
JavaScript configuration manager class
I want to be able to instantiate a JavaScript object as follows:
var c = new MyConfig({
'server': 'servername',
'kfc': true,
'code': true,
'test': true
});
Something like that. I ...
0
votes
1answer
17 views
Creating a Database Class — Where to Store Credentials?
Working on a mobile app that needs to use a public API for accessing a database (but this won't affect the question).
Anyway, I am using PHP with MySQL and the Android/iPhone app will make POST ...
2
votes
4answers
47 views
Passing Superclasses to C# Functions (With a Java overture)
It's been a while since I did anything with Java OOP, so I'm a bit rusty and wanted some clarification.
In Java, if I remember correctly, one could declare a superclass and instantiate a subclass; ...
0
votes
1answer
36 views
OOP Pattern for Shared Functionality (e.g. Logger) in JavaScript
I need recommendations for how to program common functionality into my JavaScript application. For example, there are these classes: Main, Logger, App and Template.
Main creates an instance of App ...
2
votes
6answers
65 views
Counting objects without RTTI
I'm having a problem that makes me feel rather daft. In a hobby project, I have a std::list of pointers to an interface class, which point to various concrete implementations of said interface.
For ...
5
votes
2answers
88 views
Difference between object and instance in python?
This happens in python2.7
I am working on the idea of meta class in python, almost all the tutorial refer object as instance of a class, in python. However, when playing with the class A(): form of ...
0
votes
3answers
46 views
Using A String Value As the Name of a Function to Be Called
I want to be able to do something like this:
var MyObject = function(prop) {
this.property = prop;
};
var stringVar = 'MyObject';
var myObject = new stringVar(1); // This doesn't work.
...
0
votes
2answers
35 views
Confusion: Endless arrays within arrays inside my class' data members. Bad class design?
Let's assume there are three classes:
Sponsor{id[int], name[string], sponsoredProjects[array of Project objects]}
Project{id[int], name[string], desc[string], sponsors[array of Sponsor objects]}
...