1. #1
    Ext JS Premium Member
    Join Date
    Dec 2011
    Posts
    2
    Vote Rating
    0
    raanan is on a distinguished road

      0  

    Question Implementation class or controller

    Implementation class or controller


    Hi,

    In the last few days I've been working with Designer 2.0 beta and I'm very pleased with the new version that enables you to prepare the entire MVC basic structure throw it.

    The only thing that I couldn't understand is what are the differences between the Implementation Class and the Controller classes in an Ext JS MVC application.
    Them both have the same comment "You should implement event handling and custom methods in this class", and looks like they meant for the same purpose.

    Currently I prefer to use the controller, and the implementation class is just an empty wrapper in my MVC application (located under view directory and wrap the classes located under view/ui).

    What is the right approach?

    Thanks for any clarification answer.

  2. #2
    Sencha - Architect Dev Team aconran's Avatar
    Join Date
    Mar 2007
    Posts
    9,445
    Vote Rating
    129
    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 aconran is a splendid one to behold

      0  

    Default


    raanan -

    There is no cut and dry answer to one being right and the other being wrong. It depends on the situation.

    For example, if you have a formpanel that has a checkbox and as it is checked it progressively discloses more information then that behavior/logic would probably belong in the implementation class. This is because it is self-contained in that form and is not interacting with external components.

    However lets say I have a button that opens a new Window. That behavior probably belongs in a controller as it is interacting with an external component/subclass.

    Both of these approaches are correct, and its highly dependent on your situation. This really boils down to an architectural decision.
    Aaron Conran
    @aconran
    Sencha Architect Development Team

  3. #3
    Ext JS Premium Member
    Join Date
    Dec 2011
    Posts
    2
    Vote Rating
    0
    raanan is on a distinguished road

      0  

    Default


    I understand.

    Thank you for your answer.

Thread Participants: 1

Tags for this Thread