Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. COSo if you had a facade between the UI and "persistence" layer, and you solely doled out these DTOs to the views, where do you put and integrate the more complex validation (business rules)? Implement `IValidateableObject` in the DTOs? That seems wrong... because all in all, we want to tie it all back to the UI using the integration points MVC provides (and dataannotations and ivalidateableobject could be used outside MVC too).
      singulars
    2. CO@subkamran: I see two possible scenarios here. 1) You need exactly the same input regardless of UI. In this case, the UI layer should be required to instantiate a common DTO, where the validation rules can be enforced, and the DTO can be used regardless of UI layer. 2) Input will be different in different UI layers to produce the same type of object in the business layer. In this case, you'll need UI specific DTO's, but the validation rules can still be enforced on the DTO - since the input requirements are different, the validation rules are as well. So you can always validate on your DTO's.
      singulars
    3. COI understand your logic and it makes sense, but won't I lose, say, all the Javascript integration? Because more often than not, my views deal with a subset of the object's properties (a DTO) but also with unrelated properties solely for the view (say a look up dictionary for select lists). So I can't really accept those as inputs from my service because they have needless properties I don't care about. Possibly, I could inherit from these DTOs, and create ViewModels off of them for MVC view consumption. That just creates more objects floating around but maybe that's fine?
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload