I was wondering if anyone can help me with this "architectural dilemma",
I am extracting some objects from different types (classes), for example: posts, docs and pictures
it turns out that in the presentation layer I have to display them in one container: think about the example of sharepoint libraries, where you have a folder, and you can have all kinds of objects inside.
I want to sort them by property (say PublisherDateTime)
I know that if I want to sort them, they must implement the same interface, so they implemented them like (let them say ISortingCapable)
Now, in my domain layer, the interfaces look just fine,
but then I understand that this does not help, because these objects with instantiation moved to the presentation level as DTO (they are no longer the same domain objects) => think of the DTO as a model for presentation in MVC.
Simply put:
if at the presentation level i have
List<PostDTO> List<PictureDTO> List<DocDTO>
=> Simple objects, simple rendering.
Now I want to sort them in one content stream.
My question is: should DTO implement the same interface again? Or am I looking at the problem from a different perspective?