Factories in domain model
Hello, I have question about factories in domain model. Factory is responsible for new entity creating. I hope it means whole aggregate not only root entity. For example, factory takes all orders for customer in month and creates invoice with items and taxes. In this point of view it is special case of repository because repository reincarnates aggregate from storage. It means aggregate exists in some data representation and repository takes all parts of aggregate and compose them together. In code, each repository has interface IRepository which is declared in business layer. Another layer (infrastructure layer) implements it. What about factories? Can factory have interface IFactory which should by implemented in another layer or factory implementation should be in business layer without interface? Thank you.