MyEclipse for Spring
Code Reference: GwtCustomerServiceImpl.java, Alternate Variant
The second generated variant of the remote service, using a different mapping style and a narrower result type.
The sample project includes a second variant of the remote service. It exists to show that the generator can produce more than one mapping style from the same model. The variant maps fields directly instead of using a converter, and it returns a narrow result type for list screens.
Differences from the first variant
- Mapping. Field by field assignment inside each method.
- Result. A narrow summary type for list screens.
- Queries. A single list query with a projection.
- Errors. A short message rather than a detailed remote exception.
When to use it
Use the narrow variant when the client list screen needs only a few columns. A smaller payload makes the screen faster and reduces the chance that a sensitive field reaches the browser. Use the full variant when the client edits the whole record.
Both variants call the same service layer, so the business rules are identical. That is the value of keeping the bridge thin: the mapping style can change without changing the rules.