SamSaffron / lru_redux

An efficient optionally thread safe LRU Cache
MIT License
285 stars 20 forks source link

TTL cache name space feedback. #9

Closed Seberius closed 9 years ago

Seberius commented 9 years ago

With the addition of a new cache I wanted to get some feedback on the current working name for the TTL cache. I also included an alternative naming scheme to consider.

# Current
LruRedux::Cache
LruRedux::ThreadSafeCache

# Working TTL names
LruRedux::TtlCache
LruRedux::ThreadSafeTtlCache

# Alternative
LruRedux::LRU::Cache
LruRedux::LRU::ThreadSafeCache

LruRedux::TTL::Cache
LruRedux::TTL::ThreadSafeCache

If the modularized name space was chosen, the current namespaces LruRedux::Cache and LruRedux::ThreadSafeCache could be made into a subclass to provide identical functionality (and backwards compatibility) but also raise a warning about the name change. This is similar to what the 'minitest' gem does if you call MiniTest::Unit::TestCase instead of MiniTest::Test.

SamSaffron commented 9 years ago

Hmm what about simply adding

LruRedux::TTL::Cache
LruRedux::TTL::ThreadSafeCache

Its backwards compatible and is fairly clear. The name TtlCache really looks bad to me ... TTLCache also looks bad... so namespacing seems to be the only way to go.

SamSaffron commented 9 years ago

(I mean leave the old LruRedux::Cache as is)

Seberius commented 9 years ago

That looks good to me. Thanks