If I have a collection which contains a list of models and want to create corresponding views for each model, what is the best way to do this using IOC (inversion of control)?
I see two ways:
Use a factory pattern. I would only pass in my model collection and build views as I need them with a factory that is passed in via IOC.
Create a another class which would have a list of all the views I need, pre-built by the IOC. Then I just pick the view I want from the list.
Which way do you think is better?