Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Refactor Android API into immutable state classes #2480

Closed
ljbade opened this issue Oct 1, 2015 · 3 comments
Closed

Refactor Android API into immutable state classes #2480

ljbade opened this issue Oct 1, 2015 · 3 comments
Labels
Android Mapbox Maps SDK for Android refactor

Comments

@ljbade
Copy link
Contributor

ljbade commented Oct 1, 2015

While working through MapView for #2002 I have come to the conclusion (and @tobrun agrees) that the code has grown in that single file to a point where it is getting harder to manage.

In #2002 I am trying to fix that up a bit and move functions back into logical groups and sections, but @tobrun suggested the approach from Clean Code by Robert C. Martin and split MapView up into separate classes that look after their own bits.

If you look at the Google Maps Android API, you can see they follow a similar approach by using immutable classes which we would be wise to follow. This enables the bonus that their classes are Parcelable which makes things like storing the map state a lot easier.

We are likely going to follow the immutable pattern with @1ec5 Camera API, and the existing Annotation API is almost following the same pattern.

I reckon we should hit this in our next major Android milestone.

/cc @mapbox/mobile

@ljbade ljbade added refactor Android Mapbox Maps SDK for Android labels Oct 1, 2015
@tobrun
Copy link
Member

tobrun commented Oct 1, 2015

To clarify, Robert C. Martin vision boils down to the SOLID principles.

@bleege bleege added this to the android-v0.2.0 milestone Oct 1, 2015
@bleege
Copy link
Contributor

bleege commented Oct 1, 2015

Sounds good. MapView has gotten HUGE. Let's put this on the 0.2.0 roadmap for now.

@tobrun
Copy link
Member

tobrun commented Jan 18, 2016

This issue is outdated and not that actionable anymore.
The general idea behind this issue will be picked up in the 4.0.0 release.
In that release we are focussing on parity on Google Maps and making our architecture more testable.

@tobrun tobrun closed this as completed Jan 18, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android refactor
Projects
None yet
Development

No branches or pull requests

3 participants