I was wondering if someone could help me with this "architectural dilemma",
I'm retrieving some objects from different types (classes) say like: posts, docs and pictures
turns out that in the Presentation Layer I have to render them in a single container: think of 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 a property (let's say a PublishingDateTime)
I know that if I want to sort them, they should all implement the same interface, so Implemented them as (let's say ISortingCapable)
Now, in my Domain Layer, the interfaces look just fine,
but then, I realize that does not help because, these instantiated objects went to the Presentation Layer as DTOs (they are no longer the same Domain Objects) => think of the DTO as the Model for the View in MVC.
Simply put:
if in the Presentation Layer I have a
List<PostDTO>
List<PictureDTO>
List<DocDTO>
=> Simple objects, simple render.
Now I want to sort them in a single Content Stream.
My question is: Should the DTOs implement the exact same interface again? Or am I looking at the problem from the wrong side?