oop

How can i split up a component using cfinclude and still use inheritance?

UPDATE: Seems that railo doesn't have this issue at all. UPDATE: I'm voting to close this issue as i as feel people are focusing more on the whole "does someone have a better idea splitting up large components" part of this question (which i should never have put in) then the real problem of using cfincludes with cfcomponent. Note: thi...

constructor function's object literal returns toString() method but no other method

I'm very confused with javascript methods defined in objects and the "this" keyword. In the below example, the toString() method is invoked when Mammal object instantiated: function Mammal(name){ this.name=name; this.toString = function(){ return '[Mammal "'+this.name+'"]'; } } var someAnimal = new Mammal('Mr. Biggles'); alert...

codeigniter and OOP general question regarding calling functions, and the parent constuctor

Ok so I have some gaps in my understanding of PHP OOP, classes and functions specifically, this whole constructor class deal. I use both Zend and CI but right now Im trying to figure this out in CI as it is less complicated. So all Im trying to do is understand how to call a function from a view page in code igniter. I understand that m...

Modelling multiple simultaneous states

How can you go about modelling an object that can have multiple simultaneous states? For example, you could have a person that's waiting for a bus. That's one state. But they could also be reading a newspaper while waiting for the bus. Furthermore, they could be thinking about something while reading the newspaper. They could also be sn...

Overload the equals method in java

Possible Duplicate: Best practices regarding equals: to overload or not to overload? Does anyone overload the equals method in java? The overloaded method will be public boolean equals(final MyClass myClass) This will have the benefit of having the relevant comparison part (guts of the method) in another method. Details ar...

Python: Recursively access dict via attributes as well as index access?

I'd like to be able to do something like this: from dotDict import dotdictify life = {'bigBang': {'stars': {'planets': [] } } } dotdictify(life) #this would be the regular way: life['bigBang']['stars']['planets'] = {'earth': {'singleCellLife': {} }} #But how can we make this work? life.bigBang.stars.planets.e...

What are the differences and similarities between a interface class and an abstract class?

Possible Duplicate: Interface vs Abstract Class (general OO) What are the differences and similarities between an interface class and an abstract class? I mean when to use interface and when to use abstract class? On what conditions are one appropriate to use over another. ...

What are the main factors that define what a quality design of a system is?

What do you consider to be the main factors in a quality design of a system? Following the GRASP Patterns (low coupling / high coesion, protected variations, etc). What more? ...

How do I create a class in Javascript?

This is what I got so far, and it's not working at all :( all the variables are null in my player class and update never gets called. I mean a programming class, not a css class. I.E. not (.movingdiv{color: #ff0000;}) <!DOCTYPE html> <html lang="en"> <head> <title>Class Test</title> <meta charset="utf-8" /> ...

PHP: How to cast object to inherited class?

I'd like to inherit PDOStatement class and use it in my website scripts. But I am frustrated how to get required object. PDO::query returns only direct PDOStatement object and looks like there are no other method to create PDOStatement object or inherited class. Initially i thought to move PDOStatement object to constructor of inherit ...

What's the recommended way to declare fields of a class in JavaScript?

Is it better to declare fields of a class in this way: function MyClass() { this.aMethod = function() { // code } } Or this way: function MyClass() { } MyClass.prototype.aMethod = function() { // code } Any why? Thanks in advance. ...

How to output multiple rows from an SQL query using the mysqli object

Assuming that the mysqli object is already instantiatied (and connected) with the global variable $mysql, here is the code I am trying to work with. class Listing { private $mysql; function getListingInfo($l_id = "", $category = "", $subcategory = "", $username = "", $status = "active") { $condition = "`status` = '$status'"; ...

Purpose of getters and setters?

Possible Duplicates: Public Data members vs Getters, Setters Purpose of private members in a class What is the use of getters and setters when you can just make your variables public and avoid the hassle of such lines as A.setVariableX(A.getVariableY())? ...

Can you reccomend a podcast on OOP & Design?

Hi, Can you recommend me a web site providing pod-casts focused on OOP & Design? Thanks ...

method vs function vs procedure vs class ?

I know the basics of this methods,procedures,function and classes but i always confuse to differentiate among those in contrast of Object oriented programming so please can any body tell me the difference among those with simple examples ? ...

Is it possible to programmatically determine the type of a SharePoint object?

I'm using the SharePoint 2007 object model API to assign a role to a SharePoint object, however when you do this, you must know the type of SharePoint object beforehand, like this: // apply the new roleassignment to the folder. You can do this at the listitem level if desired (i.e. this could be SPfile.Item…. instead of SPFolder.Item...

Is it best to make fewer calls to the database and output the results in an array?

I'm trying to create a more succinct way to make hundreds of db calls. Instead of writing the whole query out every time I wanted to output a single field, I tried to port the code into a class that did all the query work. This is the class I have so far: class Listing { /* Connect to the database */ private $mysql; function __constr...

Why Is Java Missing Access Specifiers?

Does anyone understand why Java is missing: An access specifier which allows access by the class and all subclasses, but NOT by other classes in the same package? (Protected-minus) An access specifier which allows access by the class, all classes in the same package, AND all classes in any sub-package? (Default-plus) An access specif...

Does OOP make sense for small scripts?

I mostly write small scripts in python, about 50 - 250 lines of code. I usually don't use any objects, just straightforward procedural programming. I know OOP basics and I have used object in other programming languages before, but for small scripts I don't see how objects would improve them. But maybe that is just my limited experienc...

How to create a c# class that gives you usage like: ClassName.Property.Subproperty

I want to create a class so I can use it like this: Website.Urls.User.Edit Website.Urls.User.Add Website.Urls.Content.List How can I do this in c#? (they will return strings) ...