In Rod and Juergens book they have BusinessObjectManager and BusinessObject. We further refactored business strategies from business objects like BusinessStrategy.
Our BusinessObjectManager is wired up by dependency injection. It is injected with BusinessStrategy. BusinessObjectManager does not operate on BusinessStrategy but passes it by to BusinessObject.
Code snippet taken from BusinessObjectManager:
Code:
private BusinessStrategy businessStrategy;
private BusinessObjectDAO businessObjectDAO;
...
BusinessObject bo = businessObjectDAO.loadBusinessObject(id);
...
bo.executeBusinessStrategy(businessStrategy);
...
Code snippet taken from BusinessObject:
Code:
...
public void executeBusinessStrategy(BusinessStrategy businessStrategy) {
businessStrategy.execute(this);
}
What do you think about this?
Are there any issues related with our architecture?
thomas