Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-26119

TiAPI: Deprecate getter/setter accessor methods for properties

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: Release 8.0.0
    • Component/s: Android, iOS, TiAPI, Windows
    • Labels:
      None
    • Sprint:
      2018 Sprint 13 SDK, 2018 Sprint 14 SDK, 2018 Sprint 15 SDK, 2018 Sprint 16 SDK

      Description

      We currently generate get/setX methods to handle reading/writing properties - in addition to the typical property access. This is atypical for Javascript, and is more common in a language like Java.

      We should consider deprecating these additional methods and preferring access via typical property routes such as object.property or object['property']

      On reason we may want to do this is to reduce common boilerplate code that is an annoyance to write/maintain when having to duplicate code for a single property.

      A good example can be seen in our Windows implementation:
      https://github.com/appcelerator/titanium_mobile_windows/blob/master/Source/TitaniumKit/include/Titanium/UI/View.hpp#L170
      https://github.com/appcelerator/titanium_mobile_windows/blob/master/Source/TitaniumKit/include/Titanium/UI/View.hpp#L228-L229

      We basically have to define the same property 3 times (and then implement it too). We get away with getting these for "free" on iOS due to our reflection based implementation, but moving to a more proper binding would result in the same sort of boilerplate there as we have on Windows.

        Attachments

          Activity

            People

            • Assignee:
              cwilliams Christopher Williams
              Reporter:
              cwilliams Christopher Williams
              Reviewer:
              Hans Knöchel
            • Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Source Code