Little cheat to document the type of ArrayCollection's items


i though share how document actual type stored in arraycollection.

 

if see line this:

 

public var items : arraycollection;

 

you have no clue type stored in array. can string, integer, custom objects, whatever. used this:

 

public var items : arraycollection /* of customer */;

 

which doesn't compiler maintainer of application (often, yourself!). problem if later changed name of class (say customer client), "documentation" out of date. few moments ago, occured me possibly use this:

 

public var items : arraycollection; typeof(customer);

 

it compiles fine , although typeof(...) statement doesn't useful, pretty documents type of objects stored in array.

 

i think i'm going use in projects. obviously, proper generics support in avm nicer in meantime, think it's better nothing.

 

regards,

borek



More discussions in Flex (Read Only)


adobe

Comments

Popular posts from this blog

Error compiling for board Arduino/Genuino Uno.

Installation database is corrupt

RFID-RC522 with Arduino Pro Micro project. Error on the code?