on 12-29-2014 11:43 AM
Hello gurus,
Are there any best practice guidelines to develop a complex app in SAPUI5? There is an excellent guide Application Best Practice but it looks not full enough.
Questions:
- where to place the logic which can be called from different views? In the Component.js? How to call it passing the context?
- how to pass data between views controllers?
In WebDynpro MVC approach there is a central Component Controller responsible for data manipulation with backend Model and manage a cross-view data (e.g. settings). So view controllers only handle a user input, manage their local data and then call a central controller.
Hi Anton,
Regarding your first question about reuse logic: I created a custom controller in my utils folder, which implements some mutual functions. View controllers that require the mutual functions inherit from the custom controller, others view controllers are simple sap.ui.controllers.
An example is given for getrouter, step 3 of application best practices
Kind regards
Bjorn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Yes, you could use Component.js to contain the 'mutual' logic which can be called from it's child views/controllers combo's, such as instantiating the core model etc.
Passing data between view controllers can be done either via the core model (since it will be available to all views as well), or via eventing (have one view fire a data object with a unique eventname, and have another view listen to that specific event name)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Have a look at the SAPUI5 Application Best Practices
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.