branflake2267 / GWT-Maps-V3-Api

GWT Maps V3 Javascript Bindings
Other
144 stars 113 forks source link

Fluent interface in MapOptions #208

Open povilasb opened 10 years ago

povilasb commented 10 years ago

It would be nice if MapOptions implemented the Fluent Interface pattern.

e.g.

MapOptions options = MapOptions.newInstance().setCenter(...).setZoom(...);
twistedpair commented 10 years ago

@povilasb

Good point. This could be done without breaking changes, I believe, since presently the methods are void, so no one is doing anything with their return values.

I'm strapped for time at the moment, but if you've got the time to update the class, mostly just updating the method signatures and adding return this;, we'd be grateful and happy to merge it.

branflake2267 commented 10 years ago

A Builder (pattern) sub type could be added as a subclass.

twistedpair commented 10 years ago

@branflake2267 good point and perhaps a more self contained solution.