Results 1 to 3 of 3

Thread: Question about MVC design patterns -- separate view components as building blocks.

  1. #1
    Sencha Premium Member
    Join Date
    Jul 2012
    Vote Rating

    Default Question about MVC design patterns -- separate view components as building blocks.

    Quick question.

    We're trying to follow the design pattern described in the article It recommends separating views into individual classes, and then glueing them together with the Viewport.

    Question -- how does one accomplish this with Architect?

    One solution would seem to be to add a component to the Viewport, then 'Promote To Class' the component. Are we understanding/applying the recommended approach here?


  2. #2
    Sencha Premium Member
    Join Date
    May 2010
    Guatemala, Central America
    Vote Rating


    You can start with top components then glue them together in the viewport. To do that drop a container (panel, tabpanel, raw container, etc.) into the canvas, edit it then LINK it to the viewport. To link, drag the component the drop it in the viewport and when SA asks "Copy/Move/Link" answer "Link".

    Note that this approach doesn't limits to viewport:

    Suppose you have an accounting application in which customers's properties are almost the same as vendors's or at least have common ones: code, name. address, phone, etc. Instead of creating a different view for the same fields you can create one container (fieldset, panel or whatever best suits you) then use it in the customer's edit window and in the vendor's edit window.

    Hope this helps.


    PD: if you find my answer (or any answer) please rate it!
    UI: Sencha Architect / ExtJS 4 - 6
    Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
    Application Server: WildFly / Weblogic
    Databases: Oracle
    / MySQL / DB2 / Firebird

    If you like my answer please vote!

  3. #3
    Sencha User aconran's Avatar
    Join Date
    Mar 2007
    Vote Rating


    Architect makes it a lot easier to build from the top down with the promote to class feature.

    While using reusable building blocks is the best practice, often times you don't see them initially until they've been used a few times. Promote to class lets you create a top level class and "Link" it automatically.

    In short, Architect supports building your application from the bottom up or from the top down. Both ways will work equally well
    Aaron Conran

Tags for this Thread

Posting Permissions

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