bennyxqg / bulk-loader

Automatically exported from code.google.com/p/bulk-loader
0 stars 0 forks source link

Flex Support #109

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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 issue reported on code.google.com by charles....@gmail.com on 28 Oct 2009 at 7:24

GoogleCodeExporter commented 9 years ago
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

Original comment by debert on 28 Oct 2009 at 7:34

GoogleCodeExporter commented 9 years ago
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.

Original comment by charles....@gmail.com on 28 Oct 2009 at 7:47

GoogleCodeExporter commented 9 years ago
Yes, but we cannot require users to use only one instance of BulkLoader.

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

Original comment by debert on 28 Oct 2009 at 7:53

GoogleCodeExporter commented 9 years ago
Hi Blake,

Just checked in revision 310, which should do it. Now the 'name' parameter is 
optional, 
if passed null, bulkloader will generate a unique one for you.

Cheers

Original comment by debert on 31 Oct 2009 at 4:55

GoogleCodeExporter commented 9 years ago
Thats a great way to handle it! Thanks

Original comment by charles....@gmail.com on 31 Oct 2009 at 6:42