does it make sense? or this is not the best approa...
# announcements
s
does it make sense? or this is not the best approach? Thanks!
k
Why not just have separate
nextMovie
and
nextImage
?
k
Or an
enum
?
s
I have more assets I put two to simplify
I mean more asset types
I thought about that approach because this way I don't need to update enum when new types appears. I've started just from Movie and Image, but I now I have also Audio and Light
and probably more to come (depending on what my client comes with)
My initial approach was nextMovie and nextImage
The reason I want to make it generic is I want to abstract presenting them into AssetPresenter
if I keep them generic I will be able to keep internals of presenter private and my AssetPresenter only exposes a few methods and it just returns view (image or video) which I add to my container
c
In that case, the asset is not really a base class, but just an interface. Stated goal of interfaces is to make it possible to treat dissimilar things in a given way. Your main use is in a presenter, hence no real domain benefit of constraining everything to a single hierarchy inheritance scheme. Before you do that you have to have not just attributes but behavior, AFAIC. (Interface could just be PresentableItem, as there is no real use of the concept of an asset here, which implies value.)
s
hey good point will think about it! Thanks
👍🏻 1