Business Objects & Actionform & Data Transfer Objects

xiaoxiao2021-03-06  65

1. The legitimacy transaction of the surface layer is executed in the ActionForm, and the logical check is executed in Bussiness Objects.

2, The view components can use both ActionForms and DTOs to populate dynamic content. When no ActionForm is configured for a mapping, you can use DTOs to build the views. And when a form bean is defined for the mapping, there are several ways to handle extracting the data from the bean. One approach is to always wrap a form bean around one or more DTOs returned from the business tier and to force the Struts view components to access the DTO data through the form bean. Likewise, when a client submits an HTML page, Struts will invoke the form bean setter methods, which can shove the data back into the DTO after the validation method has completed successfully. This provides a single, cohesive interface to which the views can retrieve and submit the HTML data to.

to be continued...

转载请注明原文地址:https://www.9cbs.com/read-119799.html

New Post(0)