Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[sisu-users] Bean locator implementation

Hi Stuart,

I am new to Guice and Sisu and I'm starting to look through the source code to gain a better understanding of both. I have few basic questions about the implementation of the default bean locator.

The current implementation uses a "mediator" pattern and I understand it. But, it appears that this could be simplified to the usual "listener/observer" pattern and the specific observer implementation could mediate to other objects when needed without having the locator aware of this. Also, the current implementation doesn't allow for the removal of a registered mediator. Another issue is that the current implementation is final and it is hard coded in few other classes. This makes it difficult to experiment with new bean locator implementations when needed.

As I said, I'm still very new to Sisu. However, would it be useful to consider:
1. The observer pattern (with addition and removal of listeners) for the locator?
2  Have a configuration file (or some other runtime configuration mechanism) to specify the locator implementation to allow for custom implementations when needed, and to avoid hard coding this in other classes?
3. Make the locator and few of the related classes non-final to allow for customization if needed? 

Best,
Shahim

Back to the top