OK, I've been searching through the code looking at how ColdSpring
handles a number of operations based on metadata.

As it stands today, it does not walk the inheritance hierarchy - which
means that you can't do a number of ColdSpring activities on a CFC
that only inherits methods from a parent.

The pattern to walk the inheritance chain isn't too bad, as I noted
before: you wrap the current loop over metadata.functions in a loop
that checks whether metadata.extends exists (and walks up the chain at
the end of each loop). You also need to allow for md.functions not
existing - which ColdSpring does in a couple of places but not
everywhere.

However, there's a wrinkle: overridden methods. Suppose you have (pseudo-code):

A.cfc:
- init()
- setFoo()
- getFoo()

B.cfc extends A.cfc:
- init() calls super.init()
- setBar()
- getBar()

C.cfc extends B.cfc:
- setBar()
- setFubar()
- getFubar()

You don't want to interact with every method declared, just the most
overridden ones. So you want to touch C.setBar(), C.setFubar(),
C.getFubar(), B.init(), B.getBar(), A.setFoo(), A.getFoo() (notice how
the Bar get/set are separated across C and B).

A solution here is to track which methods you touch - using, e.g., a
struct containing keys for the methods you've seen, adding each method
as you touch it and then skipping methods you've already seen.

I'll code it up for one of the situations and test it, post a patch
here for review and then move on to all the other places.
--
Sean A Corfield -- http://corfield.org/
Got frameworks?

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

Reply via email to