cancel
Showing results for 
Search instead for 
Did you mean: 

Model Component Vs. Assistance class

Former Member
0 Kudos

Hello Experts,

I am new to WebDynpro ABAP and understand's BSP very well.

I would like to get your views on using a model in WebDynpro ABAP, I have read that we should use Model Component(faceless) but I have also read that it is good to use Assistance class as model.

I think Assistance class is good to use personally but to argue this I have recieved a reply from one of my friends who is an expert in WebDynpro ABAP and his reply was:

The principal of the MVC pattern is to seperate the View from the business logic by creating a model that takes care of the business logic and abstracts this through the controller that controls the view. In other words, the View only talks to the view's component controller and the controller speaks to the relevant model. In essence the View should have no concept of the model implementation at all.

The other part of this approach, especially in WDA and WDJ, is utilising the framework and then componentising your code so that the components can be re-used.

Using Assistance classes to implement your models directly breaks both these principals in WDA. You can still get away with it, to a certain extent, by ensuring that all communication with the Assistance class is done via the view's component controller thus at least abstracting the model layer from the view itself.

As far as componentisation is concerned, it means that if you want to re-use the model in further components that you have to use the Assistance class, not really fitting into the framework. A good example is, what if you want to use 2 models and you can only assign one Assistance class? yes you can use the class directly but then you have no visibility of the model inside the framework and the model is not controlled or managed by the framework.

I would rather take the approach to create a re-useable model that provide methods to the using components that provide the business logic. Under this you can create classes that represent the objects or use existing function models or relevant calls you want to make. This model can then be used in several different components or applications with other models if required.

I do not really agree with it.

Please help me understand what is the best way.

Thanks & Regards,

Abhinav

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi All,

Can you please share your experiences and let me know how do you usually develop your application.

Do you generally use Assistance class or Model class?

I understand that no one can be right or wrong in this, I would like to know how experts do it.

Thanks & Regards,

Abhinav