That's a really good idea... if it didn't set the global name (instead just storing the frame object at parent.name). It would avoid polluting the global namespace.
You can do exactly what you're describing by inheriting from the following template (provided you don't override onLoad):
Code:
<Frame name="SubClassifierTemplate" virtual="true">
<Scripts>
<OnLoad>
local name = this:GetName()
local parent = this:GetParent()
if name and parent then
local parentName = parent:GetName()
if parentName then
local subName = string.match(name,parentName.."(.+)")
if subName then
parent[subName] = this
end
end
end
</OnLoad>
</Scripts>
</Frame>
So, your example would work like this:
Code:
<Frame name="SomeFrame">
...
<Frame name="$parentname" inherits="SubClassifierTemplate">