开发者

Flex - new ClassFactory() vs Fully Qualified Name

开发者 https://www.devze.com 2022-12-25 22:25 出处:网络
When assigning the it开发者_运维百科emrenderer of an object it is better to use a fully qualified name string or use ClassFactory?[Flex-Builder specific] Personally I use a class factory as makes it p

When assigning the it开发者_运维百科emrenderer of an object it is better to use a fully qualified name string or use ClassFactory?


[Flex-Builder specific] Personally I use a class factory as makes it possible for me to control-click the Class name of my item renderer and go straight to that class to view the code. Saves a bit of time.

This alone makes the class factory method "better"...for me at least.


itemRenderer is typed as IFactory, so ideally it should be a ClassFactory. But it seems that the compiler can figure out what you mean if you just use the fully qualified name, and the generated and compiled actionscript will use IFactory no matter what I'm guessing. I use the string just so I don't have to import ClassFactory and IFactory. If I use itemRendererFunction though, I use ClassFactory.

0

精彩评论

暂无评论...
验证码 换一张
取 消