Code Monkey home page Code Monkey logo

Comments (12)

willdurand avatar willdurand commented on May 28, 2024

Sure, actually I prefer CacheAdapter :)

from geocoder.

willdurand avatar willdurand commented on May 28, 2024

What do you prefer?

from geocoder.

Baachi avatar Baachi commented on May 28, 2024

I prefer an CacheProvider, which you can inject a CacheAdapter instance.

e.g.:

<?php
public function __construct(CacheInterface $cache, ProviderInterface $provider) {
    $this->_cache = $cache;
    $this->_provider = $provider;
}

from geocoder.

willdurand avatar willdurand commented on May 28, 2024

Can you be more precise ?

from geocoder.

Baachi avatar Baachi commented on May 28, 2024

Sure.
I prefer a CacheProvider, which you can inject an CacheAdapter (like MemcachedAdapter) and a another Provider (like YahooProvider). The CacheProvider tried to load the result from the CacheAdapter. If that not matched then load from the another Provider and store the result into the Cache.

from geocoder.

willdurand avatar willdurand commented on May 28, 2024

Oh, sweet!

Would you work on it ?

from geocoder.

Baachi avatar Baachi commented on May 28, 2024

Sure, I will work on it this evening.

from geocoder.

willdurand avatar willdurand commented on May 28, 2024

Fantastic!

from geocoder.

Baachi avatar Baachi commented on May 28, 2024

Would you remove the CacheLayer in the Geocoder class?

from geocoder.

willdurand avatar willdurand commented on May 28, 2024

No, not for the moment. Let's see your CacheProvider.

Oh, if you want, you can rename the Cache namespace to CacheAdapter (that was I understood the first time)

from geocoder.

willdurand avatar willdurand commented on May 28, 2024

Oh, do you have a use case for this adapter ?
I mean why dont you want to use the cache layer by registering a cache adapter ?

from geocoder.

Baachi avatar Baachi commented on May 28, 2024

I think, it's just not transparent and flexible enough.
And i would tried to keep the GeocoderClass as slim as possible.

from geocoder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.