Hi,
What should a DTO be composed of?
Is it recommended to have validation outside and just infer the results in DTO in terms of boolean.This way I do not have to keep on repeating logic in web tier as well as in middle tier.
For instance consider this...
I have to check if custNumber appears in sorted order for front end but my back end is expecting it in some other sort order and the bridge between them is DTO.
I would be essentially duplicating the sort code in both web/back end tier.
Can I have this sort logic in DTO itself or have getters and setters for getting the sort order in DTO for both tiers separately and have helper class sort it accordingly.
Ash
-
DTO and business logic/validations (1 messages)
- Posted by: Ash H
- Posted on: March 23 2005 14:58 EST
Threaded Messages (1)
- DTO and business logic/validations by P I on March 24 2005 09:58 EST
-
DTO and business logic/validations[ Go to top ]
- Posted by: P I
- Posted on: March 24 2005 09:58 EST
- in response to Ash H
What validation are you refering to?
I don't think you should have that (sorting) logic in DTOs. With that you would be tying you data fetches to some logic for handling that data. I think that should be left to whichever object (may be DAOs) who are going to be receiver of this DTO.
- PI