6 Aug 2012 1:22 PM #1
Question about MVC design patterns -- separate view components as building blocks.
We're trying to follow the design pattern described in the article http://www.sencha.com/learn/architec...t-js-4-part-2/. 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?
6 Aug 2012 2:56 PM #2
- 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 3.x / ExtJS 4 & 5
Server side: JEE / EJB 3.x / CDI / JPA 2.x/ JAX-RS / JasperReports
Application Server: Glassfish / WildFly
Databases: Oracle / DB2 / MySQL / Firebird
If you like my answer please vote!
10 Aug 2012 10:47 AM #3
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 wellAaron Conran