My goal is to keep my framework as decoupled from my application as possible (though I know it's not entirely possible).
I have several different common types of Models that I use in my application...mappers, data objects, and value objects. For example, UserMapper takes a UserData object and gather info from the database and then maps it into a UserValue object for use within the Controller.
That means that these models have the following dependencies:
- UserMapper: needs UserData, and a way to build UserValue(s)
- UserData: needs Db (from framework)
- UserValue: needs nothing
Do I include in my framework's DIC methods to create Mapper objects, Data object, and Value objects, so that the dependencies could be automatically inject? Or do I create a separate DIC / Factory to handle the Business Layer stuff?