Persister & Fetcher accessable in Store-Interface
Currently we developing some architecture we we put two stores and a fetcher into another class. Which reads like that:
liveStore: Store,
notLiveStore: Store,
notLivePersister: Persister
Which reads a little bit odd because the notLivePersister is already a part of the notLiveStore.
So, what do you think to add
@Nullable getPersister(): Persister
@Nullable getFetcher(): Fetcher
to the Store-Interface? 🤔 Maybe we can also add the Policy and the Parser, but that is not important as the two others IMO 😅
What do you think?
There is an interface InternalStore, you can expose those getters as public from RealInternalStore and then cast your store. Pr welcome 🙂
How can I access the persister than? 🤔
Just casting to InternalStore wouldn't work. Because open returns a Store. But this Store is not a InternalStore... 🤔
I've started with it at #301 But I need a little bit help... How is your idea? 🤔
As I already commented. The problem is that Store isn't a subclass ob InternalStore. And RealStore don't implement InternalStore...
So how should we solve that in this way?
Either we add fetcher() and persister() to the Store interface (which I don't like), or RealStore should be a subclass of RealInternalStore...
Or what? 😅
I think adding the two getters to Store would be simplest. Sorry for delay getting back to you 🙂
If you want to make it cleaner make a new store builder configuration called exposedStore. When that flag is set to true you can create an ExposedStore which is a subclass of store with the addl getters. Would that work? (on a plane and can't look around)