Dear,
Question: What is Obverse of var animals:Pets = new Pets(); ??
Script:
package {
import flash.events.MouseEvent;
public class Pets {
public function Pets() {
// constructor code
my_btn.addEventListener(MouseEvent.CLICK, onClick)
}
private function onClick(e:MouseEvent) {
trace(Sta...
i'm trying to send the value of the search textbox via jquery on keydown to the php page so that it can display the results containing the search keyword. however, the php page is not reading $_POST of the input textbox [not button].
html:
.keydown(function() {
//create post data
var postData = {
"bsearch" : $(this).va...
I'm trying to design a program that uses a third party API. The third party API describes an input with 296 fields, and an output with 179 fields. Obviously I want classes to represent the input and output. Are there any tricks to designing a class with so many fields? Should I have a normal getter and setter for every field?
Note: ...
Say you're writing method foo() in class A. foo doesn't ever access any of A's state. You know nothing else about what foo does, or how it behaves. It could do anything.
Should foo always be static, regardless of any other considerations? Why not?
It seems my classes are always accumulating many private helper methods, as I break t...
Here's the code I have. Everything works fine except when trying to use the same declared class variable in script more than once with a function.
include("include/database.class.php");
$db = new Database();
$db->connect();
function fill_roles()
{
global $db;
$r = $db->get_roles_all_order_by_name();
$drop_down = "<select id...
Hey all,
I'm currently starting a new project and I've run into a bit of a readblock. I'm hoping someone can help me out and I'll do my best to describe the problem.
I have a base abstract class called "EntityBase". From this class there are around 100 or so inherited classes. EntityBase has a number of methods such as Load() and Sa...
Hey guys,
It dawned on me that I've never seen a single exception hierarchy for which creating subclasses but catching the parent class was actually useful (except, of course, for the base Exception class, that has to be derived).
Are exception hierarchies really useful, xor should all exceptions be derived from language's base excepti...
Hi there
I'm writing a small application that works with a database and I can't figure how to test this interaction.
My application relies on 5 stored procedures that I have decided to encapsulate them in a class.
This class offers 5 public methods that execute the procedures and, when necessary, convert the results into collections of ...
Greetings,
I've got two instances of a PHP5 Class (say ClassA), and I want to compare to see whether they are equal. In C#, I can write a .equals(ClassA other) method for ClassA, which will be overloaded onto the == operator.
Is there an equivalent way in PHP5 to overload a method in a class and have that be used for == comparison, ...
I have a class called EditMapUtilities.
Here are some class properties that I want to persist:
public class EditMapUtlities
{
public static Boolean isInitialEditMapPageLoad
{
get { return SessionHandler.isInitialEditMapPageLoad; }
set { SessionHandler.isInitialEditMapPageLoad = value; }
}
// REST OF CLASS N...
I want to create an object that is globally accessible after the DOM has loaded. My approach is to use prototypes dom:loaded event and instantiate the Object.
The JavaScript Code:
document.observe("dom:loaded", function() {
var globalPAO = new picArrayObject();
alert(globalPAO.picArray[0]); // alerts [object HTMLDivElement]...
I know the question has been discussed before, but it seems always under the assumption that inheritance is at least sometimes preferable to composition. I'd like to challenge that assumption in hopes of gaining some understanding.
My question is this: Since you can accomplish anything with object composition that you can with classical...
So, I currently have a Board class that is composed of Pieces. Each Piece has a color and a string that describes the kind of piece. It also has a 2d matrix with bits either set on or off, that allows me to know which pixels to paint with the desired color or not.
My question is, which class should have the responsability to draw the pi...
Im working on optimizing my design in terms of mvc, intent on simplifying the api of the view which is quite nested even though Iv built composite widgets(with there own events and/ pubsub messages) in an attempt to simpify things.
For example I have a main top level gui class a wxFrame which has a number of widgets including a notebook...
Hello!
If you have watched Going Deep shows of the Channel9 lately, one very frequently mentioned topic is mathematical duality in programming. TomasP has a good blog post about duality in object oriented programming.
This has been since Microsoft Research found that the observer design pattern is actually a mathematical dual of the it...
I'm still very new to Object Oriented programming and am having problems with the class inheritance and the scope of variables from one instantiated class to another.
I'm trying to build an android application that can read multiple XML feeds and save them to the phone's SQLite database. Each feed has a different name ("news", "audio_mi...
I've got two activities, one of them is called MyActivity. I want both of them to be able to use a function located in a class othat we may call MyClass. In MyClass, I try to use an intent to launch the activity AnotherActivity. Since the constructor takes a context as parameter, I simply tried to store a context from the activity in the...
So I am thinking of doing my PHP in OO way. Can someone tell me the advantage/ disadvantage of this? I think one advantage will be that my codes will be cleaner and easier to maintain. What about performance? How does doing PHP in OO way compare to just writing codes in non-OO way.
My idea of an OO style is, for example, when handling e...
C# Supports 4 basic features of object oriented languages:
Abstraction
Encapsulation
Polymorphism
Inheritance
Can I say C# is a fully Object Oriented Programming Language? Why?
...
What makes you professional PHP programmer? When you know OOP, smarty, framework. I guess that's it, right? If not, then what else?
...