I'm working on a new project and need to create DTOs for use in views (this is a Laravel project so MVC). The DTO will get created from subsets of values from 2 other models (Price, Quote). Obviously, it wouldn't be ideal to build the DTO from those models in multiple places so I want to seat that logic in a specific class. I figure an approach is to use a factory - i.e. as a place to capture the creation of the DTO. But when I read into Factory Method and Abstract Factory and Simple Factory this use case doesn't sound like it fits.
So my questions are:
Is a factory the right pattern?
If so, which flavour of factory would you suggest?
Is this the way you would approach it? I appeal to the more experienced minds here for some insight. I work alone so it's hard sometimes to figure out the right approach.
thanks,
Drongo