Skip to content

Conversation

@willdurand
Copy link
Member

ping @Baachi, @toin0u
see #181

WDYT?

@Baachi
Copy link
Member

Baachi commented Jan 16, 2013

Why you don't add a ResultFactoryInterface?

@willdurand
Copy link
Member Author

What would be the use case? I don't want people to define another
createFromArray() method.

On Wed, Jan 16, 2013 at 10:29 PM, Markus Bachmann
notifications@github.comwrote:

Why you don't add a ResultFactoryInterface?


Reply to this email directly or view it on GitHubhttps://github.com//pull/182#issuecomment-12341113.

@Baachi
Copy link
Member

Baachi commented Jan 16, 2013

Yes, make sense. Maybe the best implemention currently.

willdurand added a commit that referenced this pull request Jan 16, 2013
Add a ResultFactory to easily create ResultInterface instances
@willdurand willdurand merged commit bd9eb71 into master Jan 16, 2013
@willdurand willdurand deleted the factory branch January 16, 2013 23:01
@toin0u
Copy link
Member

toin0u commented Jan 17, 2013

I like this a lot !! That's cool :)

Now, we just need to implement ProviderInterface (or extend existing providers) to make our own provider which will return the ResultInterface we made with the factory :)

Should the method formatString be protected ? Or I'm missing something ?

@Baachi
Copy link
Member

Baachi commented Jan 17, 2013

@toin0u I think the provider should not decide which result should be generated.
Geocoder tries to provides a consistently API between different providers. This means, you can simple change your provider and no error will be occurs. If the provider decide which Result object will be returned, this will not work anymore.

The developer should decide which Result object should be return (this was currently not possible). But now the developer can write his own ResultFactory and generate his own ResultObject.

@willdurand Do you agree?

@willdurand
Copy link
Member Author

The provider won't decide which result should be generated, never.

@Baachi could not have been more right, thank you!

@toin0u
Copy link
Member

toin0u commented Jan 17, 2013

@Baachi I see your point and of course I don't think the provider should decide which Result object will be returned :)

@toin0u
Copy link
Member

toin0u commented Jan 17, 2013

With:

Now, we just need to implement ProviderInterface (or extend existing providers) to make our own provider which will return the ResultInterface we made with the factory :)

I meant that users should do this not Geocoder ! Sorry, my bad...

@willdurand
Copy link
Member Author

ah yes ;)
I missed your point, but now I see. No problem

On Thu, Jan 17, 2013 at 3:47 PM, Antoine Corcy notifications@github.comwrote:

With:

Now, we just need to implement ProviderInterface (or extend existing
providers) to make our own provider which will return the ResultInterface
we made with the factory :)

I meant that users should do this not Geocoder ! Sorry, my bad...


Reply to this email directly or view it on GitHubhttps://github.com//pull/182#issuecomment-12370671.

@toin0u
Copy link
Member

toin0u commented Jan 17, 2013

I should read my comment twice.. :S
But I'm happy that we agree ! :)

@Baachi
Copy link
Member

Baachi commented Jan 17, 2013

No problem :)
I'm happy that we all agree, too^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants