Results 1 to 4 of 4

Thread: Performance of Singleton class

  1. #1
    Sencha Premium Member
    Join Date
    Jan 2016
    Posts
    31

    Default Performance of Singleton class

    Hi,

    Is it advisable to use singleton classes from a performance perspective in ExtJS6 applications for mobile devices?

    regards
    Nitesh

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

    Default

    This will largely depend on what the singleton does on instantiation. There isn't any issue with it, I have a few.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

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

  3. #3
    Sencha Premium Member
    Join Date
    Jan 2016
    Posts
    31

    Default

    Quote Originally Posted by mitchellsimoens View Post
    This will largely depend on what the singleton does on instantiation. There isn't any issue with it, I have a few.
    We intend to define a common method for service call error handling which will be used in all controllers of the application.
    Wanted to do this rather than write the same function in each controller individually. However the use of the singleton class in this case should not negatively impact the performance of the application.

    regards
    Nitesh

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

    Default

    Yes, that's a fine means of sharing code by using a singleton class and performance will not be noticeably less than if you were to go another route.
    Mitchell Simoens @LikelyMitch
    Modus Create, Senior Fullstack Engineer
    ________________
    Modus Create is based on the model of an open source team. We’re a remote, global team of experts in our field. To find out more about the work we do, head over to our website.

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

Similar Threads

  1. is possible extend from singleton class?
    By keepfaith in forum Ext 5: Q&A
    Replies: 3
    Last Post: 11 Sep 2015, 4:30 AM
  2. Inheriting Singleton class
    By msuresh in forum Ext: Discussion
    Replies: 2
    Last Post: 13 Aug 2012, 7:18 AM
  3. scope of a singleton class vs static class
    By himanshu.joshi in forum Ext: Discussion
    Replies: 3
    Last Post: 6 Jul 2012, 11:39 PM
  4. Replies: 2
    Last Post: 12 Jan 2012, 12:26 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
  •