Refactoring UI And Service Interaction


The diagram on the right helps explain the goal of the refactoring. After refactoring, no domain logic or business object access should remain in the UI Layer. The UI Layer (currently a Struts action) asks the Service Layer for 'everything it needs' and it is served up as a customised Data Transfer Object (DTO - a bundle of data). Internally the Service Layer assembles the customised DTO from logical groupings of smaller DTO s e.g. a customised DTO for a client details page would involve assembling a number of component Dto s such as address, loans, savings, notes, meeting... There are quite a large number of struts action to refactor. As refactoring occurs it becomes possible to use the new design for a number of purpose such as building a new UI, tackling scalability issues and clarifying API definition.