Bug 825120

Summary: RfE: Put CreateChildFacet methods on child component class
Product: [Other] RHQ Project Reporter: Heiko W. Rupp <hrupp>
Component: PluginsAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.4CC: hrupp
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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: --- Target Upstream Version:
Embargoed:

Description Heiko W. Rupp 2012-05-25 07:43:43 UTC
Currently the creation of child resources needs to be implemented by a parent 
resource.
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
or
- 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.