cancel
Showing results for 
Search instead for 
Did you mean: 

How to restore an component usage?

Former Member
0 Kudos

Hi All,

background: I've statically defined a component usage of A in consumer component B.

At runtime, I'll clone a bunch of A ( A1,A2,A3...) and save in an attribute.

Now, if assume I've cloned A1,A2,A3 and I'm now on A3, for some reason, I need to

switch back to A1, I need to display the stuff of A1 again.

How can I switch back to A1 without killing any of the usages.

Thanks for your help in advance.

Regards,

Aaron.

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I have to say that I'm disappointed to see this question in the forum after you sent it to me in email earlier this week and discussed how this was a very bad architectural approach.

You are using a component instance like an object instance and using it to cache data. Although technically possible, this is absolutely not recommended. This is not how component instances were designed to be used. The component usage instance is a very heavy object and should be used with caution. It also doesn't have any automatic garbage collection. In FPM we use dynamic instaniation and placement of component usages, but we do this with good reason to support extensibility and configuration. Still GUIBB and UIBB components aren't used as such data caches.

Although you can use dynamic navigation to re-imbed you previous component usage instances, you really need to reconsider your arcitecture. At least you should be calling DELETE_COMPONENT so that you only have one component usage in memory at a time. The best situation is that you redesign your component so that you have one component usage. You then call an interface method of the component usage to load the new set of data you want to work with. If you need data caching you should do that within the component or even better at the model layer. If you have even remotely structured your component correctly, then this refactoring to use one component usage should probably take no more than an hour or so to acomplish.

If you had been a customer or partner, I would have pointed out the arcitectural deficencies in your approach, made my recommendation and then told you how to do what you wanted anyway - leaving the ulitmate decision up to you. But you are an SAP employee. You should hold yourself to the highest performance and arcitectural standards, no matter what type of application you are creating. I'm disappointed that you are still looking for a shortcut rather than taking the time to correct the overall approach of your application.

Former Member
0 Kudos

Hi Thomas,

Here's the background, I've talked to our developer once after you give me your recommendation.

But there's a complicated reason that the framework designed can't support the situation I've mentioned above.

the addon component A reused by the consumer component B can't hold temporary data.

If now we go for extend the framework to meet the requiremtns, that'll cost a huge effort . So our team decide to first have a try of

multiple instances approach. If the performance is not impacted too much, then we stick to this approach. But if not, then

we're going to redesign the framework, but that'll cost much effort, that's the last choice for our team. you know it's something

related to project management. That's the reason I post this question again in SDN, I hope that you won't mistake my purpose

after I sent you the mail.I really appreaciate your timely help .

Regards,

Aaron

Edited by: Aaron Shen No.2 on Aug 8, 2010 4:35 AM

ChrisPaine
Active Contributor
0 Kudos

> You should hold yourself to the highest performance and arcitectural standards, no matter what type of application you are creating.

from a customer and partner point of view it worries me that this discussion is occurring.

Given that no responses are forthcoming - I think it would be surprising if anyone who contributes to this forum is going to give a suggestion that deviates greatly from Thomas' it would be in SAP's interest to delete this thread... And soon.

I'm fully aware that SAP internal development is not always the best - you should see some of the stuff that comes out for Australia and NZ payroll. But perhaps a public forum isn't the best place to advertise that time-to-market is more important to SAP than quality.

I appreciate openness - I really do, but perhaps in this case I was happier being left in the dark...

Former Member
0 Kudos

Thanks for your advice and suggestion, Thomas.

We change the bahavior of the application slightly and completely avoid multiple component instances.

Regards,

Aaron

Answers (0)