{"id":269,"date":"2010-02-27T21:19:12","date_gmt":"2010-02-27T19:19:12","guid":{"rendered":"http:\/\/kinsey.no\/blog\/?p=269"},"modified":"2010-03-13T11:57:42","modified_gmt":"2010-03-13T09:57:42","slug":"easyxdm-v1-8-0-relased","status":"publish","type":"post","link":"https:\/\/kinsey.no\/blog\/index.php\/2010\/02\/27\/easyxdm-v1-8-0-relased\/","title":{"rendered":"easyXDM v1.8.0 relased"},"content":{"rendered":"<p>A lot has been going on with easyXDM over the past week, and I am proud to finally be able to release a version where all transport types, even the ones for IE6, deliver the same set of features.<\/p>\n<p>From now on all the transports (and all the relying classes) supports<\/p>\n<ul>\n<li>Reliability, &#8216;guaranteed&#8217; delivery of messages<br \/>\nThe new ReliableBehavior adds this to the HashTransport<\/li>\n<li>Sender-verification, \u00a0verifying that the message originates from the original sender.\u00a0This removes the risk of malicious sites spoofing the sender<br \/>\nThis is added to the HashTransport and NameTransport by the VerifyBehavior<\/li>\n<li>Queueing, you can now send multiple messages in the same js thread<br \/>\nThis is added to the HashTransport and NameTransport by the QueueBehavior<\/li>\n<\/ul>\n<p><!--more--><\/p>\n<h2>Behaviors<\/h2>\n<p>So what are these behaviors mentioned? Well, a behavior modifies the way a transport works, and it works by sending all events and messages through a pipeline of behaviors, where each one can let it pass, inspect it, modify it, block it etc. Each behavior is automatically chained with the others so that they form a stack, where in principal, each layer talks to the corresponding layer on the other end.<\/p>\n<p>One example of this in action is the fragmentation. When the QueueBehavior receives an <strong>outgoing <\/strong>message that is larger than the max fragment size, then instead of queueing only one message, it will queue each fragment with a fragment identifier. The QueueBehaviors dispatcher will then send each message as fast as it can (it gets a callback from the next Behavior in he line when the message is delivered).<\/p>\n<p>On the other end multiple <strong>ingoing<\/strong> messages will received at the QueueBehavior, but the message won&#8217;t be passed on until all fragments has arrived.<\/p>\n<p>Using behaviors instead of applying the functionality directly to the classes adds a lot to the table<\/p>\n<ul>\n<li>Re-usability, the same behavior can be applied to all transports that accepts these.<\/li>\n<li>Separation, each new feature is contained in a separate class, and since the pipeline is layered, you can safely introduce e.g sender-verification without risking breaking the code that handles the sending\/receiving.<\/li>\n<li>Structure, the code is a lot easier to <a href=\"http:\/\/easyxdm.net\/v1.8.0\/docs\/source\/easyXDM.transport.html\" target=\"_blank\">read<\/a> and understand, and adding new behaviors is a breeze.<\/li>\n<\/ul>\n<p>This is a sample from the <a href=\"http:\/\/easyxdm.net\/v1.8.0\/docs\/?class=easyXDM.transport.HashTransport\" target=\"_blank\">HashTransport <\/a>and shows how behaviors are applied internally<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\neasyXDM.applyBehaviors(this, [\r\n    new easyXDM.transport.behaviors.ReliableBehavior({\r\n        timeout: ((useResize ? 50 : pollInterval * 1.5) + (usePolling ? pollInterval * 1.5 : 50))\r\n    }),\r\n    new easyXDM.transport.behaviors.QueueBehavior({\r\n        maxLength: 4000 - _remoteUrl.length\r\n    }),\r\n    new easyXDM.transport.behaviors.VerifyBehavior({\r\n        initiate: isHost\r\n    })\r\n]);\r\n<\/pre>\n<p>In the future these will be overridable, and you will be able to inject your own if you want to.<\/p>\n<h2>Conclusion<\/h2>\n<p>If you haven&#8217;t already, go <a href=\"https:\/\/www.ohloh.net\/p\/easyXDM\/packages\" target=\"_blank\">download the newest version<\/a> and enjoy the new features!<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>A lot has been going on with easyXDM over the past week, and I am proud to finally be able to release a version where all transport types, even the ones for IE6, deliver the same set of features. From now on all the transports (and all the relying classes) supports Reliability, &#8216;guaranteed&#8217; delivery of [&hellip;]<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[56],"tags":[35,32,33,62,8,60,61],"_links":{"self":[{"href":"https:\/\/kinsey.no\/blog\/index.php\/wp-json\/wp\/v2\/posts\/269"}],"collection":[{"href":"https:\/\/kinsey.no\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kinsey.no\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kinsey.no\/blog\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/kinsey.no\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=269"}],"version-history":[{"count":6,"href":"https:\/\/kinsey.no\/blog\/index.php\/wp-json\/wp\/v2\/posts\/269\/revisions"}],"predecessor-version":[{"id":273,"href":"https:\/\/kinsey.no\/blog\/index.php\/wp-json\/wp\/v2\/posts\/269\/revisions\/273"}],"wp:attachment":[{"href":"https:\/\/kinsey.no\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=269"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kinsey.no\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=269"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kinsey.no\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=269"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}