View Full Version : Application design using Designer
Bit of an unfair question but what's best practice for stitching things together when you have quite a few separate designer files. Lets say you had a viewport and a toolbar in the north panel. So from Designer you have viewportUi, toolbarUi and associated class extensions.
Would you add the toolbar to the north panel in the viewport.js class extension or in the main application entry point (where Ext.onReady is executed)
Getting my knickers in a twist over this...
2 Nov 2010, 9:25 AM
I think that's a good question, and while some would consider this a small issue, I believe it's good to ask ourselves where these things should be contained...in the name of organized component oriented design.
In my humble opinion, the answer is "either or", depending on the use. In this case, I would say the toolbar can be added to the Viewport within the viewport's class. Since it's a viewport, and the viewport represents the "application ui as a whole", it makes sense to put it in there. All actions on the Toolbar will be dealing with items within the Viewport no doubt.
With the exception of needing some sort of global access to a component or dynamically added components, I would say that a component should always be added within its parent, when the parent is initializing itself.
2 Nov 2010, 11:24 AM
Cheers Jarred, that makes logical sense
Powered by vBulletin® Version 4.1.5 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.