cancel
Showing results for 
Search instead for 
Did you mean: 

MVC-Pattern: One model component and several controller components

Former Member
0 Kudos

Hello experts

I strictly separated model, controller and view in our Web Dynpro for ABAP application. One WD component represents the controller and another represents the model. Each view is represented by an own WD component, the context data is propagated to the views using reverse-mapping.

Now we have the following questions:

1.) Is it recommended to share the model with several controllers? Image one controller only requires a part of the model nodes whereas another controller requires all nodes within the model.

2.) Is this approach with a single model recommended from the performance point of view ?

3.) Should I keep the context in the model as simple as possible and therefore provide two models, one for each controller?

Any suggestions? Is anyone else facing the same issues or using the same approach?

Regards, Mathias

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

I'm convinced, better using assistance class than contest mapping between several WD components.

Former Member
0 Kudos

Hi Koen

I don't think that my approach violates any MVC rules. Instead official SAP Press books do exist introducing this approach as well (ISBN 3-89842-690-4: Praxisbuch WD for ABAP). Keyword: multi-component applications

All I'm doing is roll out the model and therefore the access to the business logic into a separate WD component.

Regards, Mathias

Former Member
0 Kudos

Hi,

I'm afraid you've put the MVC model in place, violating the MVC rules.

- you use a webdynpro component as model, sharing the data via the context, this means you create the model using the controller of that component

- Model: this is not available up to now in WDA, but that place is taken by the assistance class: [documentation|http://help.sap.com/saphelp_nw2004s/helpdata/en/43/1f6442a3d9e72ce10000000a1550b0/frameset.htm]

- View: this in fact is only the layout tab in the views

- Controller: all the rest: methods, attributes, context, events, actions,..

an overview can be found in [documentation|http://help.sap.com/saphelp_nw2004s/helpdata/en/a5/1a1e3e7181b60ae10000000a114084/frameset.htm]

grtz,

Koen

Former Member
0 Kudos

Hi

As far as from my understanding this MVC archetecture needs to be followed for a a component. Thats is not to be shared between three components. like model logic in one component, View in another componet ...

Regards

Sarath