PDA

View Full Version : Domain Classes, SDK, Architecture, XML



da_b0uncer
4 Nov 2011, 7:46 AM
I want to build a GUI to create some XML-files and have some ExtJS related questions.

The XML is more about configuration, than about datasets. So I don't know, if the Model-LocalStore-XmlReader/Writer idea is suited for this.

If it's not, I'd rather build some JS-Datastructure, which could convert itself to the needed XML after finished. I can use Ext.define() for creating those domain-classes, but since they are neither model/store/view/controller, where to put them?

I mean this SDK deployment application tries to put every needed code in one big minified file, does the use of Ext.define() and Ext.create() alone take care, that the stuff will be included?

Thank you in advanced!

skirtle
4 Nov 2011, 9:31 AM
If your classes don't fit into the model/store/view/controller structure then you can just put them wherever you want. To load such classes within the MVC you'll just need to put them in a requires. If you aren't using the Ext.Loader then there's no problem anyway.

Generating a single production JS file is done using JSBuilder. Take a look at the files included in the ExtJS zip download. You should find jsb files in there for producing the ExtJS build. You can do something similar to create your own build file. There's an example of this in examples/desktop. It will not be done automatically based off the requires in your Ext.define.

tvanzoelen
4 Nov 2011, 9:39 AM
Generating a single production JS file is done using JSBuilder. Take a look at the files included in the ExtJS zip download.


Its better, I think, to take the JS builder in SDK tools instead of the jsbuilder shipped with the code release. http://www.sencha.com/products/sdk-tools/

The JSBuilder shipped with the release gave me some trouble.

mitchellsimoens
4 Nov 2011, 11:56 AM
You don't have to extend a Store or a Model in order to put them into those folders... If you make a custom data class, it would still at least go into the model folder.

Why do you think the Store isn't ideal?

da_b0uncer
10 Nov 2011, 6:20 AM
I want to build a visual-join editor for tables.
The system I'm working with uses a proprietary XML-definition format, so I would get something like:


<definition>
<table id="users">
...
</table>
<table id="posts">
...
</table>
<join id="joined" left="users" right="posts">
...
</join>
</definition>

But it can get really big, with many tables, and joins, like SQL in XML-format. So it's a configuration data-structure and not a set of data-records.

I don't know, if it's a good idea to put the the tables in a store with table-models, because the table-nodes can have other data nested into them.