by
Dean Cooper >> Tue, 18 Nov 2008 11:30:10 GMT
Just further to my previous post. The prevously attached schema contained a bunch of test remap tables. While they don't do any harm at all, they're just "noise" that can end up being extracted in other schemas if you don't uncheck "Extract Remap Tables" on the "Schema Options" sheet of the JADE 6.1 Schema Extract form. A new schema is attached with the remap tables removed. If you've loaded the previous schema in 6.1, you can use Browse | Remap Tables to delete them.
Dean.
<Dean Cooper (JADE Tech General)> wrote in message news:
5462@news.jadeworld.com...
Hi Alan,
I think the performance issue you're encountering is to do with the calls to allLocalSubclasses. This method returns *all* subclasses for the receiver class (not just the first level), so when you call it initially for Object, it's populating a transient collection with all classes in the schema. Each time you recursively call classListBuild, allLocalSubclasses is getting the entire subclass branch again for each class in the next level, even though you only need the classes in the level that you're dealing with. For a large schema, this will be creating, populating and deleting a lot of transient collections that you can avoid. You can also avoid the calls to refreshNow.
Attached is a RAR of a 6.1.14 schema with an example form that demonstrates a class hierarchy list box. It's not the code out of the JADE IDE, but it works in a similar way. Run the default app in the schema, pick a schema from the combo at the top of the form and the list box will be populated with the classes. The list box population starts in the ClassListExampleForm::loadClassHierarchy method. This method will add "Object" and it's immediate subclasses by calling the expandItem method. When an entry in the list is expanded, the required subclasses are added at that point (see lstClasses_dblClick, lstClasses_pictureClick and expandItem). The expandItem method is also used to collapse an entry in the list box. When a class is selected, its name and number is shown in the status line (see lstClasses_click and selectClass).
The code makes use of the Class::subclasses dictionary that every class has. This is a protected property, but you can access it via a method on Class (see the Class::getSubclassesDict subschema copy method). This gives you a direct/fast way of accessing the immediate subclasses of a class without requiring a transient collection and without having to retrieve all subclasses for a class.
Hope this helps.
Cheers,
Dean.
PS: When you run the app, if you see a message saying "You are running a GUI application that has no startup form", just click Continue and the app will run ok. This is probably because I've built the schema using the English (UK) locale and that's not your default locale. It's a glitch that has been fixed in a future release.