cancel
Showing results for 
Search instead for 
Did you mean: 

Using classes in WebDynPro as Back-End

0 Kudos

Hi,

My question is quite simple if I use a Reference of an object in a "componentController" as an "attribute" and use it as my back-end system, I mean encapsulate all the business rules in the class.

I would be necessary to initialize it in the WDDOINIT of the ComponentController, then I can use it in all the other components.

Am I breaking the MVC model?? (considering its a Z development)

Thank you and Regards.

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>I would be necessary to initialize it in the WDDOINIT of the ComponentController, then I can use it in all the other components.

Do you mean other parts of this Web Dynpro Component (like View Controllers) or other inner Component Usages (separate Web Dynpro Components)? The answer to the first is yes - absolutely. The answer if it is the second option is more complicated. I can explain if you are interested.

>Am I breaking the MVC model?? (considering its a Z development)

Not at all. This is good usage pattern according to MVC. This class becomes your model and is clearly seprating your business logic from your UI layer. This is a common practice in standard SAP applications, in fact.

Answers (1)

Answers (1)

0 Kudos

Thank you Thomas,

I was refering to the first thing you said, To have it just in Web DynPro components (as view controller) and not in other WebDynPro applications.

So thank you for that answer.