arthur-debert/BulkLoader

109 - Flex Support

arthur-debert opened this issue · 5 comments

Reccomend making the name attribute on the BulkLoader function in the 
BulkLoader class an optional attribute. This will allow the class to be 
created via MXML in Flex.

name : String = "oMainBulkLoader"

public function BulkLoader(name : String = "oMainBulkLoader", 
numConnections : int = BulkLoader.DEFAULT_NUM_CONNECTIONS, logLevel : int 
= BulkLoader.DEFAULT_LOG_LEVEL){

Original link: http://code.google.com/p/bulk-loader/issues/detail?id=109

bl...@bentbit.com - 2009-10-28 00:00:00

The solution mentioned above might not be ideal but it does allow a single instance
of the control to be created in the flex environment. It additionally allows the
user to create component instances with custom names using actionscript.

I have been playing with the code in flex and it works great with this method as
long as you use a single instance of the component.

debert - 2009-10-28 00:00:00

I understand the use case, but this solution won't work. BulkLoader has a registry
pattern of sorts where all intances are accessible through a static look up, using the
name as a key (BulkLoader.getLoader("photo-gallery"). This makes it a requirement
that each instance's name be unique. Therefore, hardcoding a default name will
break once you intantiate a second instance.

I am in favor of null constructors too (helps a few other pain points as well), so I
rather find a solution that answers both needs.

Regards

debert - 2009-10-28 00:00:00

Yes, but we cannot require users to use only one instance of BulkLoader.

Either it works with n instances, or it doesn't.

debert - 2009-10-30 00:00:00
None

bl...@bentbit.com - 2009-10-30 00:00:00

Thats a great way to handle it! Thanks