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

Offline terminology #4250

Closed
Closed

Description

@jfirebaugh

For offline, we are inventing a lot of new terminology. For prior SDK features, we've taken cues from existing mapping SDKs, which in many cases leads to divergence of terminology between our iOS and Android SDKs. But offline is a feature other SDKs don't have, and I think it would be to the long term benefit of our customers and support staff to use consistent terminology for offline concepts -- consistent both between the iOS and Android offline APIs, and the words we use when talking about offline in prose.

A proposal follows. The terms are different that what we've been using, but don't panic: I don't think renaming will be a huge undertaking, provided we do it now, before these APIs have been formally released and we've written more than one piece of documentation about them.

offline resource collection

Type names: {mbgl::,MGL,com.com.mapbox.mapboxsdk.offline.}OfflineResourceCollection.

An offline resource collection is the basic unit of offline. You can create them, list them, start and stop their downloads, and delete them. Each resource collection has a region, and may have some additional application-supplied data. (Former core/Android name: OfflineRegion.)

offline region

Type names: {mbgl::,MGL,com.com.mapbox.mapboxsdk.offline.}OfflineRegion, {mbgl::,MGL,com.com.mapbox.mapboxsdk.offline.}OfflineTilePyramidRegion

The geographic extent of a resource collection -- which part of the world it covers -- is defined by its region. We plan eventually to support region types, but for now there is only a single type: a tile pyramid. (Former core/Android name: OfflineRegionDefinition / OfflineRegionTilePyramidDefinition.)

application-supplied data

Here the terminology follows established platform-specific conventions: on Android, application-supplied data is called "metadata". On iOS, it's called "context". Both use preexisting platform types.

offline download status / offline download progress

The current revision of the iOS bindings separates these into two concepts. The core API and Android bindings have a single concept combining both. TBD.

resource database

Type names: {mbgl::,MGL,com.com.mapbox.mapboxsdk.offline.}ResourceDatabase.

The top level thing that you ask to create an offline resource collection, or give you the list of existing ones. In mbgl core this is DefaultFileSource, but that name is an odd implementation detail that probably won't stick. Currently Android uses OfflineManager and iOS uses MGLOfflineStorage. I propose ResourceDatabase. I'm omitting Offline from this name because the database is also used for ambient caching. I'm including Database because it is in fact a database, and we'll likely eventually publicly document the schema.

cc @zugaldia @1ec5 @mapbox/support

Activity

  1. added
    iOS
    Android
    on Mar 8, 2016
  2. 1ec5 commented on Mar 8, 2016

    @1ec5
    Contributor

    The current revision of the iOS bindings separates these into two concepts.

    I separated these two concepts because an offline region always has a state, but it doesn’t have a progress when it’s invalid. The invalid state is unique to the iOS implementation and ensures that the region can’t be used after it’s removed. If the region becomes responsible for destroying itself, then having separate state and progress becomes less important. I had also considered customizing the state’s setter so that setting the state could pause or resume a download; the progress would remain read-only to consumers.

    Edit: Actually, we’ll always have to make a distinction between unregistering (removing) a region and deleting the Objective-C object that represents the region – we’d want region removal to be explicit and not depend on nilling out all strong references to the object. So the invalidation pattern is still necessary.

  3. zugaldia commented on Mar 9, 2016

    @zugaldia
    Member

    /cc: @twbell

  4. added this to the android-v4.0.0 milestone on Mar 9, 2016
  5. zugaldia commented on Mar 9, 2016

    @zugaldia
    Member

    OfflineResourceCollection

    Not a big fan of this one. In Java, you'd expect a collection to be a list of items, an iterable, which isn’t the case here.

  6. 1ec5 commented on Mar 9, 2016

    @1ec5
    Contributor

    OfflineResourceCollection

    Not a big fan of this one. In Java, you'd expect a collection to be a list of items, an iterable, which isn’t the case here.

    That's the kind of conflict we're trying to avoid with this renaming. "Bundle", "package", and "archive" all have similar conflicts on one platform or another.

    How about ResourcePack? It sounds good in prose, apparently doesn't conflict with any existing platform or language conventions, and carries the meaning we want to convey.

  7. zugaldia commented on Mar 9, 2016

    @zugaldia
    Member

    How about ResourcePack?

    Why not simply OfflineResource?

    The ResourceDatabase contains a list of OfflineResources, that are defined by an OfflineRegion and their metadata/context.

  8. 1ec5 commented on Mar 9, 2016

    @1ec5
    Contributor

    The term "resource" is already used all over mbgl for individual images, sprite sheets, stylesheets, etc. Put another way, this class represents a collection (in the informal sense) of things that must be downloaded for a region (in the geographic sense) to be usable offline. So what's currently called the "offline region definition" is like a bill of materials and the "offline region" acts as a container for those materials. Among the other names we considered for this type are OfflineRepository and OfflineRecord.

  9. 1ec5 commented on Mar 9, 2016

    @1ec5
    Contributor

    Regarding the original premise, @danswick @friedbunny, do you see any downside to having different naming schemes across platforms? I've always imagined that we would maintain separate offline documentation and examples for iOS and Android. Are there situations where you would find the need to talk about what we're currently calling an "offline region" across platforms simultaneously?

  10. friedbunny commented on Mar 9, 2016

    @friedbunny
    Contributor

    do you see any downside to having different naming schemes across platforms?

    For our own purposes, having consistent naming would be great. For SDK consumers, having platform-specific names that diverge slightly from each other doesn’t strike me as a problem — most developers don’t do both platforms themselves and making our APIs mesh with platform conventions would be more helpful.

    And yes, I expect that iOS and Android documentation will eventually separate.

  11. jfirebaugh commented on Mar 9, 2016

    @jfirebaugh
    ContributorAuthor

    Ok, let's continue to call them "offline regions" in prose, core mbgl, and Android bindings. iOS will deviate from this for platform reasons, and we'll just deal with it.

  12. reopened this on Feb 20, 2017
  13. 1ec5 commented on Feb 20, 2017

    @1ec5
    Contributor

    Per #8084 (comment), we’d like to rename these classes at least at the SDK level. Now that the offline manager (or whatever it’s called at the SDK level) also handles URL request transformations while online, we need a naming strategy that doesn’t emphasize offline maps quite as much.

  14. 1ec5 commented on Feb 20, 2017

    @1ec5
    Contributor

    Here’s a possibility for iOS/macOS that deemphasizes “offline”, even though that remains the primary intent of the API:

    • MGLOfflineStorage → MGLMapStorage (to complement MGLMapView)
    • MGLOfflinePack → MGLMapPack (as with Offline terminology #4250 (comment), to complement the concept of asset packs)
    • MGLOfflineRegion → MGLMapRegion (similar to MKCoordinateRegion)
      • Alternatively, MGLRegion (by analogy with CLRegion and MapboxGeocoder.swift’s MBRectangularRegion; however, offline regions are style-dependent)
    • MGLTilePyramidOfflineRegion → MGLTilePyramidMapRegion or simply MGLTilePyramidRegion
    • MGLOfflinePackState → MGLMapPackState
    • MGLOfflinePackProgress → MGLMapPackProgress

    The downside is that our offline map functionality becomes harder to find. On the other hand, this scheme would set us up for any caching APIs that aren’t strictly for offline usage.

  15. removed this from the android-v4.0.0 milestone on Feb 20, 2017
  16. jfirebaugh commented on Feb 20, 2017

    @jfirebaugh
    ContributorAuthor

    I vote for MGLOfflineStorage → MGLMapStorage but no other changes. "Offline" is still a perfectly good term to use in class names, and it's only the top-level concept that's broadening.

  17. zugaldia commented on Feb 20, 2017

    @zugaldia
    Member

    As suggested by @kkaefer in #8084 (comment), on Android this translates as renaming OfflineManager to StorageManager. Also, we might want to change the package that contains the renamed StorageManager from com.mapbox.mapboxsdk.offline to com.mapbox.mapboxsdk.storage (already existing).

  18. kkaefer commented on Feb 21, 2017

    @kkaefer
    Member

    also handles URL request transformations while online

    For the record, we've been using the MGLOfflineStorage object before as well to initialize the map object with the DefaultFileSource object it contains, so it was always doing more than advertised through its name.

  19. added
    archived
    on Nov 12, 2018
  20. stale commented on Nov 25, 2018

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    AndroidarchivediOSofflinerefactor

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions