Results 1 to 6 of 6

Thread: Categorize class properties and methods by access specifier

    You found a bug! We've classified it as DOCS-441 . We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.
  1. #1
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    2,425
    Answers
    20

    Default Answered: Categorize class properties and methods by access specifier

    Currently, all class properties and methods are listed alphabetically. The doc would be more useable if class properties and methods were first categorized by the access specifier (public, protected and private) and then sorted alphabetically within these categories.

    As a result, there would be at most two labels attached to each property or method name: static or chainable. Having up to three labels (as it's done currently) looks quite busy.

    Screen Shot 2017-07-04 at 12.29.20 PM.png

  2. I went ahead and pushed up a ticket internally so we can look at this request further. Thanks again for sharing your thoughts on how the docs can be improved for everyone!

  3. #2
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Answers
    505

    Default

    Hey! Thanks for the suggestion.

    I'm not sure I personally agree that the type-category > alpha approach makes the members list more discoverable than just a pure alpha (with badges). A quick survey internally seemed to suggest I was in good company there.

    But, I won't say definitely no either - let's leave this thread up and see if we get any other users weighing in with +1's either way before we look at changing the layout of the member quick-nav (or the member rows themselves, for that matter as that would be the next logical target for overhaul if the popup nav were to evolve).

  4. #3
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    2,425
    Answers
    20

    Default

    This is interesting that the surveyed developers would prefer a strictly alphabetical order since in the class the various class members are usually organized into groups: privates, statics, etc.

  5. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,392
    Answers
    3997

    Default

    If you're talking about the privates and statics objects like below:

    Code:
    Ext.define('MyClass', {
        statics : { ... },
    
        privates : { ... }
    });
    That's only done so the class system can easily handle those. For example, privates object has functionality to handle if you extend a class and have a private method outside the privates object:



    That will throw the error "MySubClass: Public method "myPrivateMethod" conflicts with private framework method declared by MyClass"
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Frontend Engineer
    ________________
    Need any sort of Ext JS help? Modus Create is here to help!

    Check out my GitHub:
    https://github.com/mitchellsimoens

  6. #5
    Sencha Premium User
    Join Date
    Nov 2010
    Location
    Chicago
    Posts
    2,425
    Answers
    20

    Default

    My initial example wasn't the best, but I tend to categorize class members in my classes by the intended access level. I first list public, then protected and finally private methods.

    I avoid mixing methods with different access level as much as possible. It's confusing and annoying if this pattern is not followed.

  7. #6
    Sencha User slemmon's Avatar
    Join Date
    Mar 2009
    Location
    Boise, ID
    Posts
    6,165
    Answers
    505

    Default

    I went ahead and pushed up a ticket internally so we can look at this request further. Thanks again for sharing your thoughts on how the docs can be improved for everyone!

Similar Threads

  1. Access methods to any class, from any other class
    By coletek in forum Sencha Touch 2.x: Q&A
    Replies: 7
    Last Post: 23 Oct 2012, 3:09 PM
  2. Replies: 2
    Last Post: 25 Sep 2012, 12:08 AM
  3. Replies: 1
    Last Post: 20 Nov 2011, 4:47 PM
  4. Encapsulating Private Properties, Methods and State in Extended Class
    By Chris55 in forum Ext 3.x: Help & Discussion
    Replies: 3
    Last Post: 6 Oct 2009, 9:19 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •