1. #1
    Touch Premium Member
    Join Date
    Sep 2011
    Location
    Tamworth, NSW, Australia
    Posts
    386
    Vote Rating
    7
    marc.fearby is on a distinguished road

      0  

    Question How to use Architect and put custom code in implementation classes?

    How to use Architect and put custom code in implementation classes?


    I thought I had originally posted this to the Architect forum but it ended up in Designer, where there's much less traffic these days, so I've deleted the original thread (including a bit of rant) and am posting this here to see if I can get an official answer on the viability of what I'm doing. In short, I want to keep using Architect to generate a GUI which I then extend so I can continue to write my implementation code in files that will not be overwritten by Architect each time I "deploy" (I don't really "get" overrides when it comes to subclassing generated classes).

    I have created an "app/view/extended" directory into which I've put all my implementation classes (that previously extended the "app/view/ui/whatever.js" files), with the following at the top of each file:

    PHP Code:
    Ext.define('AppName.view.extended.MyForm', {
        
    extend'AppName.view.MyForm',
        
    initComponent: function () {
            var 
    me this;
            
    me.callParent(arguments);      
            
    // initialisation code here including event handler wiring-up
        
    }
    }); 
    This seems to work well and I haven't encountered any caveats.... so far. Is this something that is likely to continue to work, or are there moves afoot to disallow this? The xcopy "Deploy" button in Architect only copies and doesn't delete anything, which is good (it also seems to copy the .xds file, too, which I don't think is needed).

    If this is OK then I can continue on my merry way, but I do think that Sencha need to write an article to help existing Designer users transition to Architect, covering: a) the method I've described for those who use the product simply to generate a GUI, and b) the new method where Architect is used to add/edit implementation code (which I can't see being at all popular so long as the code editing experience is in its infancy with no customisability whatsoever; speaking of which, when will we be allowed to at least set the font name and size for the code editor?).

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    8,892
    Vote Rating
    102
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  

    Default


    If you'd prefer to extend that's fine by us. You will just have to include those additional resources at the appropriate place. We encourage users to implement their additional logic via overrides.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Touch Premium Member
    Join Date
    Sep 2011
    Location
    Tamworth, NSW, Australia
    Posts
    386
    Vote Rating
    7
    marc.fearby is on a distinguished road

      0  

    Default


    Thanks, but as somebody who hasn't "groked" the difference between extends and overrides, particularly when extends works perfectly fine (as far as I can tell), I think Sencha needs to explain this change a lot better.

  4. #4
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    8,892
    Vote Rating
    102
    aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold aconran is a splendid one to behold

      0  
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  5. #5
    Touch Premium Member
    Join Date
    Sep 2011
    Location
    Tamworth, NSW, Australia
    Posts
    386
    Vote Rating
    7
    marc.fearby is on a distinguished road

      0  

    Default


    I have read that thread (and the thread it links to), twice now, and I'm still not really convinced I need to switch to overrides; in fact, the bit about it not using the override unless it needs to just sounds weird because what's the point of having implementation code if it's not going to be used? And the idea of being able to do most things without an override seems fanciful.

    In a way, I don't wanna know: what I'm doing now works and I haven't seen a convincing argument why what I'm doing should be changed. Since I'm not going to be using Architect to type my implementation code then perhaps the whole overrides/extends thing really doesn't affect me. I did try once to convert my initComponent stuff to the override equivalent and it wouldn't work, and as soon as a good ol' "extends" did the job, that was enough for me to continue being productive as opposed to wasting my time trying to figure out something apparently unecessary. I'm sure I'm not the only one who can't see the point of overrides (there were several dissenting opinions in those threads).

    Anyway, when Architect's code editing experience is greatly improved I may revisit the issue.

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar