on 05-01-2007 10:15 AM
Hi,
I've a problem i can't figure out. I have 3 components. 1 main, 1 utility and 1 servicelocator. The main component has a reference to both utility and servicelocator component. The utility has a reference to the servicelocator and the servicelocator to the utility. I tried to build this by letting the main component instanciate the usages for the servicelocator and utility component.
//@@begin wdDoInit()
//create component instance for webservice locator component usage
wdThis.wdGetWebserviceLocatorCompInstComponentUsage().createComponent();
wdThis.wdGetUtilityCompInstComponentUsage().createComponent();
//call public component interface method of used orders UI components and pass reference to the model
//component usage, so that it can enter it in referencing mode
wdThis.wdGetWebserviceLocatorCompInstInterface().referenceUtilityComponent(wdThis.wdGetUtilityCompInstComponentUsage());
wdThis.wdGetUtilityCompInstInterface().referenceWebserviceLocatorComponent(wdThis.wdGetWebserviceLocatorCompInstComponentUsage());
then setting the usages as references to both components. I set both the lifecycles of the referenced components to manual.
But when i rebuild the application, i get the error: Cycle in component usage definitions : for both the utility and servicelocator component.....
Can anyone tell me what i'm doing wrong?
much thanks & regards,
Hugo
Hi ,
Utility and service locator are in cyclic reference.. A refers B .. B refers A.. A refers B .. B refers A...
Why do u want it to be like this ? Are you passing data from both A to B and B to A ?
In this case make only one direction of reference and use external context mapping..
<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/66/a5384162316532e10000000a1550b0/frameset.htm">External Context Mapping</a>
Regards
Bharathwaj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I understand but the servicelocator makes use of some utility methods in the Utility component and the utility has some methods which make use of Servicelocator methods. Im not gonna put them in the same component because they have different responsibilities and i want to seperate them because of that. Why can't they reference eachother when i set the usages manually??
I can have a reference of class A to B and vice versa......
regards,
Hugo
Hugo,
If your concern is separation of concerns (no pun then you need to make one step further in your decomposition -- add 4th component (U-Common). Place here functionality of Utilities (U) that is required by Service Locator (SL).
This way SL refers U-Common, U refers U-Common and SL. Application component(s) refers U, U-Common and SL. Also you may re-export functionality of U-Common via U (so U just merely delegates to corresponding functions of U-Common), so Application component(s) will refer only U and SL.
Valery Silaev
SaM Solutions
Valery,
like you said...no phun
This makes me leaning towards putting the few utility methods in the resourcelocator to avoid creating another component just to re-route the calls......
I feel a little discomfort here though because of how it works. Make me wonder....
Thanks explaining though!
regards,
Hugo
User | Count |
---|---|
91 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.