cancel
Showing results for 
Search instead for 
Did you mean: 

Share context between two DC:s, use Interface controllers or not?

Former Member
0 Kudos

Hi, I'm trying to decouple an application which fetches its data though a webservice, which is about to change. So I want to have all the logic that fetches the data in a separate DC, so I can change the fetch-logic and not change anything in the display logic.

My question now is how this is done in a proper way.

I realized that I can add the Component Controller of A (the fething DC) in its "public parts", and then in DC B add A in the "Used DC" part, and then add the exposed Component Controller from A in B:s "Used Web Dynpro Components". However I was led to believe that I should use interface for this kind of usage.

With the usage lined out above, I do not use any Interfaces at all!

So bascially, should I use any interfaces in DC A, if so are there any advantages of doing so over just adding the Component Controller to the public part of the DC?

/Best regards, Bjorn Bergenheim

Accepted Solutions (1)

Accepted Solutions (1)

former_member201361
Active Contributor
0 Kudos

Hi,

please refer this blog for External Context Mapping

[https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/8881] [original link is broken] [original link is broken] [original link is broken];

Thanks and Regards

Answers (3)

Answers (3)

Former Member
0 Kudos

hi,

tryout with this steps :

- Create Child DC

- Create context in the Interface Controller with all the attributes.

- Set the property u201CisInputElementu201D of node to the true.

- Create context mapping between interface controller and component controller &view controller

- Create public part in child DC using the interface component.

- Create parent DC

- Add child DC in parent DC using used DCs

- Add child component in the Used WebDynpro Components

- Create content in the component controller and do the mapping with the view.

- Now do the mapping between interface controller of child DC and component controller of the parent

- In diagram View map between the parent View and Interface view of child DC

- Build and Deploy

Regards

Vineela

Former Member
0 Kudos

Thank you for this excellent help!

The only problem I'm having is that I can't seem to add my Interface to the public part; only the whole Web Dynpro Component of the child DC can be added. Is this what you are trying to say in the 5:th step, or am I missing something?

/Björn

Former Member
0 Kudos

Hi Bjorn Bergenheim,

1.) If you add the Web Dynpro Component of the child DC to the public part then internally the Interface Controller of the Child DC will also added to the Public Part.

2.) Then you have to Reload + Rebuild and Build your Child DC.

3.) Go to Parent DC add Child DC to Used DCs, Reload + Rebuild and Build your Parent DC.

4.) In the Parent DC --> Right Click on Used Web Dynpro Components --> Add Used Component --> External Window Appears --> Click on " Browse " Button for Used Web Dynpro Component --> Select Child DC's Component Controller ( It Internally adds Child DC's Interface Controller itself to the Parent DC's Data Modeler ) --> Reload + Rebuild and Build your Parent DC .

5.) Create Mappings acc. to your Requirement.

  • I think Point No. 4 Solves your Problem.

If you have still any Doubts Post them Clearly for Quick Reply.

With Regards,

Roop Kumar.

Former Member
0 Kudos

Hi Bjorn Bergenheim,

According to your Scenario DC B is the Parent DC & DC A is the Child DC.

1.) In DC A (Child DC) first of all take the required Context in the Interface Controller.

2.) Share the same context to Component Controller of the Child DC A.

3.) Reload + ReBuild the Child DC A.

4.) Build the Child DC A.

5.) After that In the Parent DC B Share the same context from Child DC A's Component's Interface Controller to the Parent DC B's Component Controller.

6.) Reload + ReBuild the Parent DC B.

7.) Build the Parent DC B.

In this way The Interface Controller is Necessary to share Context between two DC's.

With Regards,

Roop Kumar.

Former Member
0 Kudos

hi!

yes you can use interfaces in your first component.the advantage of doing so is that you can loosely couple your component implementation with the interface definition.

but in any case you have this facility to import adaptive web service so if any changes happens it will be updated in your component.

thanks and regards

Vishal Anand

Former Member
0 Kudos

Ok, so if I can do this, how would I go about doing it? Basically how do I change it from using my implementation rather then my interface of component A in component B?

On a sidenote, if I want to make a method call to my controllerA/interface from Bs component controller, how do I do that?

And lastly, unfortunatly I'm using the MDM WS, which will completly change in the next version, so even though I'm using adaptive WS, I will have to redo this when we start using the new version of MDM.

/Björn