Transient metadata tag
Escrito el 8/11/2006 por Xavi Beumala
Sometimes when implementing VO's, comes in hand to declare some properties which aren't mapped server side.
For example, imagine the following client side class:
<br />
<pre><br />
package com.mif.vos {<br />
[RemoteClass(alias="com.mif.vos.DomainVO")]<br />
public class DomainVO {<br />
public var list:Array;<br />
private var _list:ArrayCollection;</p>
<p> [Transient]<br />
public function get listAC ():ArrayCollection<br />
{<br />
if (_list == null)<br />
{<br />
_list = new ArrayCollection (list);<br />
}<br />
return _list;<br />
}<br />
<br />
public function set listAC (listAC:ArrayCollection):void<br />
{<br />
this._list = listAC;<br />
}<br />
}<br />
}<br />
</pre><br />
If you don't want listAC property to be serialized across de wire, the only thing you have to do is add the [Transient] metatag. This way DomainVO serialized objects will only have the list property.
Permalink
Comments (1)