From: Pascal B. <pa...@dy...> - 2000-11-05 10:27:33
|
Here are some ideas I've been thinking about (based on other peoples code/input) first: Renaming all files, currently we use core.xxx.yyy. I originally created this not to use sub-folders like this, but to show the differences between certain objects.. xxx would be the object group and yyy would be the name of the object/class/extension. The first thing to change would be to replace core with dynapi, core was the original name of my own distribution but when my version was copied over to the original dis. the naming was left this way.. I think this should be dynapi.xxx.yyy As example, the webos.com files use the same naming scheme (example: webos.ui.component) (they probably copied it from us ;-) So we should really rename all the files to dynapi.xxx.yyy second: A change in the widgets, to start using eventlisteners and not hard-coded methods (I think Robert just posted a message mentioning this as well) If you look at the loadpanel from Dan, you'll see how this can be achieved, all code and events are handled in the widget constructor, making only methods and properties available thru prototyping, not the create code.. example: function myWidget() { this.DynLayer=DynLayer // or other object for sub-class inheriting this.DynLayer() var listener=new EventListener(this) listener.oncreate=function(e) { // this used to be the myWidget.prototype.onCreate=function() part // do all stuf to initialise your widget. // this is actually all the code you would normally put in the onCreate function of your widget } this.addEventListener(listener) return this } myWidget.prototype=new DynLayer() myWidget.prototype.methodnames=function() { } This way we can completely start using eventlisteners, which makes everything work in the same logicall way... this would require the simple changes to the createElement() I posted yesterday with the loadPanel() widget. I'm planning on converting all my own widgets to this format, because I think it makes the widget model slightly better (having all create code in the widget constructor) while still keeping the simplicity in it. Comments please :-) Pascal Bestebroer pa...@dy... http://www.dynamic-core.net |
From: Robert R. <rra...@ya...> - 2000-11-05 16:52:22
|
Yes, I think the filenames should be changed too. The only problem is when you say dynapi.api.dynlayer.js, the dynapi is never used. I think the dynapi should be in the directory structure as well. Like: lib2.0/dynapi/api/dynlayer.js. I posted a zip file in the patches section of Sourceforge that includes: - file name structure change - removed Core name - hardcoded .onCreate removed/opting for eventlisteners It also has a lot of other changes, including the recreateall and addchild fix. You can get it here: http://sourceforge.net/patch/index.php?func=detailpatch&patch_id=102277&group_id=5757 \\Robert > Here are some ideas I've been thinking about (based on other peoples > code/input) > > first: Renaming all files, currently we use core.xxx.yyy. > I originally created this not to use sub-folders like this, but to show > the > differences between certain objects.. xxx would be the object group > and > yyy would be the name of the object/class/extension. > > The first thing to change would be to replace core with dynapi, core > was > the original name of my own distribution but when my version was copied > over > to the original dis. the naming was left this way.. I think this should > be dynapi.xxx.yyy > > As example, the webos.com files use the same naming scheme (example: > webos.ui.component) > (they probably copied it from us ;-) So we should really rename all the > files to dynapi.xxx.yyy > > second: A change in the widgets, to start using eventlisteners and not > hard-coded methods (I think > Robert just posted a message mentioning this as well) If you look at > the loadpanel from Dan, you'll > see how this can be achieved, all code and events are handled in the > widget constructor, making only > methods and properties available thru prototyping, not the create code.. > example: > > function myWidget() { > this.DynLayer=DynLayer // or other object for sub-class > inheriting > this.DynLayer() > > var listener=new EventListener(this) > listener.oncreate=function(e) { // this used to be the > myWidget.prototype.onCreate=function() part > // do all stuf to initialise your widget. > // this is actually all the code you would normally put in the > onCreate function of your widget > } > this.addEventListener(listener) > > return this > } > myWidget.prototype=new DynLayer() > myWidget.prototype.methodnames=function() { > } > > > This way we can completely start using eventlisteners, which makes > everything work in the > same logicall way... this would require the simple changes to the > createElement() I posted yesterday > with the loadPanel() widget. > > I'm planning on converting all my own widgets to this format, because I > think it makes the widget model > slightly better (having all create code in the widget constructor) while > still keeping the simplicity in it. > > > Comments please :-) > > > > Pascal Bestebroer > pa...@dy... > http://www.dynamic-core.net <http://www.dynamic-core.net/> > > > -- |