You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at the attribute generate method it looks like there is only support for setter injection. It would be nice to be able to customize hydration for different types of objects -- such as immutable objects whose attributes are only set through the constructor. Perhaps creating a hydrationStrategyInterface or something of that nature. This would allow others to create strategies that work better with their objects such as using reflection to set attributes instead.
The text was updated successfully, but these errors were encountered:
Sadly this idea has not received any feedback yet. I would really appreciate being able to change the way attributes are set on a new instance. We employ domain-driven design and instead of implementing a bunch of otherwise meaningless setters, we use more semantically named methods to update an instance's attributes. And for value objects, which are immutable, we don't implement any setters at all, so FactoryMuffin would have to use a reflection based strategy or the constructor to set attributes.
Looking at the attribute generate method it looks like there is only support for setter injection. It would be nice to be able to customize hydration for different types of objects -- such as immutable objects whose attributes are only set through the constructor. Perhaps creating a
hydrationStrategyInterface
or something of that nature. This would allow others to create strategies that work better with their objects such as using reflection to set attributes instead.The text was updated successfully, but these errors were encountered: