cancel
Showing results for 
Search instead for 
Did you mean: 

A Design Question - Context or External Class

Former Member
0 Kudos

Hi,

This is a Design Question. I will be as concise and to the point as possible, avoiding non relevant details.

I am retriving data from Back End in one of my WD Component. The data is stored in the Component Context.

Now each view actually comes from subsequent Embedded Components.

<b>But</b> I have to massage the raw data considerably each time the subsequent Views are called (each time a embedded component is called).

Component A -> Get Back end Data

Component B -> Massage Data and present a View

Component C-> Massage Data (further from B) and present a View

Component D-> Massage Data (further from C) and present a View

Since the massaging is kind of Business Logic, I have created a External Class and put all logic in it and am instantiating the class inside the Component that retrives the back end data. I pass the Node Reference of the Context to this Class and massage the data there.

Now since each Subsequent View needs further massaging, where should I store this data after first massaging...

1) Should I create a separate node in external Compoenent, and store the data as it is getting Massaged bu each Component, in the context, and thus pass this node reference by context mapping to each subsequent Embedded Component(and hence Views) for further massaging.

2) Should I pass the instance of the external class thru context mapping to the embedded components, thus making the context cleaner. In this case all the subsequent massaged data remains in the class and all you do is just pass on the instance of the class thru context mapping...

Which is a better design..?

.I like 2) since it makes the context cleaner with just one attribute to hold the class reference, while in 1) I need number of attributes in the new node.

Thanks

Message was edited by:

SAP User

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member215843
Active Participant
0 Kudos

Hi,

The idea is to use the assistance class as the moderator between Web Dynpro and the business logic. There is no need to instanciate the assistance class, because the framework does it.

From support package 10 or 11 on, it is possible to pass the assistance class from the main component to the sub components (see note 974412).

Please put only those data, which must be part of the context, into the context. This makes it cleaner and the performance will be better.

Ciao, Regina

Former Member
0 Kudos

Thanks Regina.

Looks good now that I know about Asistance Classes .