http://www.sapdev.co.uk/webapps/bsp/mvchome.htm
Uses
All BSP applications that you created with SAP Web AS 6.10 can also be executed without MVC. In general, you do not need to change anything.
The previous BSP implementation model gives you the option of controlling event handling and navigation using redirects.
The MVC design pattern provides you with various advantages, so that you can consider converting to MVC in the following cases:
- If your pages are dynamically composed of several parts (components)
A controller can assemble a page from several views. As a result, the layout is
.
- If input processing is so complex that it should be subdivided into different methods
A controller offers great flexibility, especially during input processing, since you can create and call new methods.
If the system cannot decide which page comes next until input processing, we recommend that you let the controller branch to different views.
- If redirects using navigation can lead to performance problems (such as slow diversion)
- If visualization logic is fairly important, since you can use MVC to separate the logic from the layout
- If the layout from a different person is being processed as the visualization logic
- If parts of the layout should be created by the program, such as by a generating program or an XSLT processor
Combination of MVC with BSP
You can combine the technology of the previous implementation model for BSPs with the new MVC design pattern.
- In an application, there may be pages with flow logic as well as controllers and views
- The views can only be called by the controllers.
- Redirects from pages to controllers and back can take place with the help of redirect using the navigation methods.
- In the page layouts you can use the
element or the element to call a controller. You cannot use these elements to call pages.
Process
Use the top controller as a point of entry to your BSP application and its process flow. First create a controller (see ).
Then a call a view from this top controller. Next create a corresponding view (see ).
Now your controller.
Then call the controller or the sub-controller (see ), and then the view (see ).
If necessary, you can also create .
阅读(506) | 评论(0) | 转发(0) |