Bug 825120

Summary: RfE: Put CreateChildFacet methods on child component class
Product: [Other] RHQ Project Reporter: Heiko W. Rupp <hrupp>
Component: PluginsAssignee: RHQ Project Maintainer <rhq-maint>
Status: NEW --- QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.4CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Heiko W. Rupp 2012-05-25 03:43:43 EDT
Currently the creation of child resources needs to be implemented by a parent 
So in order to e.g. support a creation of a new FooBar subsystem, the base 
ASComponent needs to be modified,
which leads to pretty wild type checking and convoluted code in the parent.
Worse, it prevents plugins that run inside a base as plugin to have their 
children being created at base AS level, as they can not modify the source of 
the parent.

I propose we add the possibility to put create child code on the child 
component class by
- putting a static createChild() method on it
- instantiating the child component and using a non static class 

Either way to stay compatible with the current code, the plugin container 
should with the new method/facet if this is available and call this. If this is 
not available it will call the classic code. This way existing code continues 
to work and new plugins can take advantage of the new facet.