cancel
Showing results for 
Search instead for 
Did you mean: 

Assistance Class Vs. Separate Service Class called through model

Former Member
0 Kudos

Are there performance advantages to using an assistance class over a model in the component controller? I built a service class that uses several lower level persistent objects to handle table operations. Currently I instantiate the model in the WDOINIT of the component controller. I expose needed methods from the service class as methods of the component controller and the other components call through the component controller methods.

What advantages would I see if I remove the model and just use the service class as an assistance class? Is that even possible?

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

I don't believe there are any signifiant performance differences between the assistance class vs. seperate service class. They are basically the same thing. The big difference I see with the assistance class is that the reference variable is automatically declared in the WD Component - both at the component and view level. This simplifies development slightly because you don't have declare or instaniate this variable - but that is probably a minor issue.

The main difference is if you have multiple WD Components - like in Floorplan Manager and you want to share one class instance between all the components. Although if you create the inner component instances yourself you can pass a single assistance class instance through the creation process, this isn't necessary easy to do with a framework created component instances like in FPM.

In this case I perfer to create a separate service class that can be accessed via a static method call (returning the same instance with each request). That way in the initialization of each WD Component you access this single instance of the class - and share data easily between separate components.

PrasannaGunji
Participant
0 Kudos

Hi Thomas,

For any DB updates/reads in Web Dynpro components, should we be using a Service Class or Assistance class?

I shall appreciate if you can throw some light on service class (design and if possible a simple example).

Thanks for your attention.

Regards,

Prasanna

Answers (1)

Answers (1)

Former Member
0 Kudos

Thank you for your help