{"id":1117,"date":"2010-05-18T06:00:48","date_gmt":"2010-05-18T10:00:48","guid":{"rendered":"http:\/\/www.ericfeminella.com\/blog\/?p=1117"},"modified":"2012-03-09T09:47:32","modified_gmt":"2012-03-09T14:47:32","slug":"bindable-map","status":"publish","type":"post","link":"https:\/\/www.ericfeminella.com\/blog\/2010\/05\/18\/bindable-map\/","title":{"rendered":"Bindable Map"},"content":{"rendered":"<p>Recently I was going through some old drafts I had pending when I happened to notice I had never published this one, so I am finally doing so now&#8230;<\/p>\n<p>Since first publishing an AS3 <a href=\"http:\/\/code.ericfeminella.com\/classes\/as3\/HashMap.as.html\" target=\"_blank\">HashMap<\/a> implementation back in <a href=\"https:\/\/www.ericfeminella.com\/blog\/2006\/12\/\" target=\"_blank\">December of 2006<\/a>, much to my surprise the <a href=\"https:\/\/www.ericfeminella.com\/blog\/2006\/12\/05\/as3-hashmap-for-flex\/\" target=\"_blank\">original post<\/a> through which I released the API still yields a good amount of feedback each month.<\/p>\n<p>In the time since I have extended the functionality of the HashMap to include a <a href=\"https:\/\/www.ericfeminella.com\/blog\/2008\/03\/09\/localpersistence-map\/\" target=\"_blank\">LocalPersistenceMap<\/a> and <a href=\"https:\/\/www.ericfeminella.com\/blog\/2008\/02\/08\/as3-resourcemap-api\/\" target=\"_blank\">ResourceMap<\/a> in addition to the original HashMap; all of which implement the <a href=\"http:\/\/code.ericfeminella.com\/classes\/as3\/IMap.as.html\" target=\"_blank\">IMap<\/a> interface and can be used interchangeably by client code.<\/p>\n<p>The single most requested feature I have received has by far been to provide a <a href=\"http:\/\/livedocs.adobe.com\/flex\/3\/html\/help.html?content=databinding_8.html\" target=\"_blank\">Bindable<\/a> HashMap implementation, and, just recently, I decided to implement one and share it with the community. <\/p>\n<p>The implementation of the <a href=\"http:\/\/code.ericfeminella.com\/classes\/as3\/BindableMap.as.html\" target=\"_blank\">BindableMap<\/a> is quite straightforward as it simply provides an API which wraps an IMap implementation in order to facilitate data binding capabilities to all read methods of the underlying Map. <\/p>\n<p>Using the various IMap implementations with BindableMap yields some interesting possibilities; specifically when using BindableMap with LocalPersistenceMap as it essentially provides a bindable implementation of a LocalSharedObject, as can be seen in the following example  (e.g. add some values and refresh the page):<\/p>\n<p>[kml_flashembed publishmethod=&#8221;static&#8221; fversion=&#8221;10.0.0&#8243; movie=&#8221;https:\/\/www.ericfeminella.com\/blog\/articles\/assets\/flex\/BindableHashMapExample\/BindableHashMapExample.swf&#8221; width=&#8221;400&#8243; height=&#8221;400&#8243; targetclass=&#8221;flashmovie&#8221;]<\/p>\n<p><a href=\"http:\/\/adobe.com\/go\/getflashplayer\"><img decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.adobe.com\/images\/shared\/download_buttons\/get_flash_player.gif?w=640\" alt=\"Get Adobe Flash player\" data-recalc-dims=\"1\" \/><\/a><\/p>\n<p>[\/kml_flashembed]<\/p>\n<p>You can download the source, binary and example <a href=\"http:\/\/code.ericfeminella.com\/opensource\/flex\/apis\/as3-hashmap.zip\" target=\"_blank\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Recently I was going through some old drafts I had pending when I happened to notice I had never published this one, so I am finally doing so now&#8230; Since first publishing an AS3 HashMap implementation back in December of 2006, much to my surprise the original post through which I released the API still yields a good amount of&#8230; <a class=\"read-more\" href=\"https:\/\/www.ericfeminella.com\/blog\/2010\/05\/18\/bindable-map\/\">Continue Reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[42,23,31],"tags":[],"class_list":["post-1117","post","type-post","status-publish","format-standard","hentry","category-apis","category-design-patterns","category-oop"],"jetpack_publicize_connections":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/posts\/1117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/comments?post=1117"}],"version-history":[{"count":0,"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/posts\/1117\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/media?parent=1117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/categories?post=1117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ericfeminella.com\/blog\/wp-json\/wp\/v2\/tags?post=1117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}