1. #11
    Ext User
    Join Date
    Aug 2009
    Posts
    588
    Vote Rating
    1
    Mike Robinson is on a distinguished road

      0  

    Default


    Xtypes can be (as usual) a useful thing ... or not.

    If you (a) might create a bunch of instances of "a thing," but (b) don't really know if you're going to need to do so or not ... then XTypes might well be the cat's meow.

    When you declare an XType, one instance of the object is always created so that it can be associated with the type-name in the hash. The benefit then comes from being able to coin any number of copies of that object, just by cloning what is already in memory.

    This is not the same as a system which would create the first object-instance only on-demand.

    It is, therefore, "a practical system, but not entirely without cost." Know how it works, then "ask your doctor..."

  2. #12
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    The type registration pattern is one which occurs quite frequently - for example in 3.x the ComponentMgr is actually managing two types of object - Components and Plugins.

    These two can be split apart into 2 separate Managers (while maintaining backwards compatibility) and the common Manager functionality abstracted up to a Manager class. This is very much on the radar and is something I'm actively investigating. The pattern can be applied in other areas also.
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  3. #13
    Ext User
    Join Date
    Aug 2009
    Posts
    588
    Vote Rating
    1
    Mike Robinson is on a distinguished road

      0  

    Default


    One "cheap trick" solution that just might work is to allow the XType to be associated with a closure that returns a type-instance.

    When instantiating the type, the code would check to see if the associated object is a function. If so, it would be called, and the result would (say, unconditionally...) now replace the function itself. (The closure, its life's work done, would now vanish forever into the gloom...) From now on the code would work as it does now, creating a new instance of the memory-object.

    Plainly, the first thing to determine is whether or not this approach would actually yield benefits of time and memory. It might not be possible. It might not do any good if it is. And BTW, I'm not "signing-up" to do it...

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi