extending-classes

Extending Flex FileReference class to contain another property

I want to extend the FileReference class of Flex to contain a custom property. I want to do this because AS3 doesn't let me pass arguments to functions through event listeners, which makes me feel sad, so I need this property to exist on the event target, so I can access it. I also want to be able to cast extant FileReference objects to...

In C++ can you extend a parameterized base class with different parameter value in the child class?

In all the languages that I understand this is not possible but someone was telling me it was possible in C++ but I have a hard time believing it. Essentially when you parameterize a class you are creating a unique class in the compilation stage aren't you? Let me know if I am not being clear with my question. Here is my attempt at ex...

Why does overriding a method only occur after I implement an interface?

I've been reading through the book Working Effectively with Legacy Code and I've been playing around with the concept of overriding difficult to test methods in unit tests via the creation of a fake. I put together an example of what I thought would work and it ended up behaving differently than I had been expecting. I think I've just di...

Actionscript/Flex - Is it possible to dynamically extend an object, modify functions, add functions etc

I know this question might be frowned upon, but actionscript is a dynamic language similar to javascript and in javascript I can take an object from a library written by someone else and dynamically (at runtime) add/remove/modify functions, properties, prototypes etc. this is kind of like dynamically extending an object to make it work w...

rails named_scope as an extension to AR::Base

class SomeModel < ActiveRecord::Base named_scope :recent, lambda { { :conditions => ['created_at > ?', 1.week.ago] } } end I want to extend the AR::Base class to have this named_scope for all models, how I can do this ? ...

Extending mysqli and using multiple classes

Hi, I'm new to PHP oop stuff. I'm trying to create class database and call other classes from it. Am I doing it the right way? class database: class database extends mysqli { private $classes = array(); public function __construct() { parent::__construct('localhost', 'root', 'password', 'database'); if (mysqli_connect_error()) {...

Custom Control in ASP.NET C#

Hello all, I created a simple custom control that only inherits from the Literal control, and doesn't have any extensions yet, code is empty. Namespace: CustomControls Class name: Literal : System.Web.UI.WebControls.Literal Next thing I do is registering this control in the aspx page as following: <%@ Register TagPrefix="web" Namesp...

how do i extended 3rd party classes in cakephp?

I want to extended, not just create a new instance of a class I have sitting in my vendors directory. I googled and read the docs but I see no support for it. Can I do an app import of the 3rd party class, then write up the extended class followed by a component that will use my child class? i.e /* vendors/yahooapi/yahoo.class.php */...

Simplest way to extend Dashcode components?

I'm presently working on a project in Dashcode, and am getting increasingly frustrated at how the default classes have very little in the way of bind-able events much like jQuery uses. Dashcode doesn't let me edit the files, which I'm guessing is because until the project is exported they're a standard set of core classes. I'm thus conte...