CRITICAL
Rule Definition
It can lead to unexpected behaviour, especially when you have a setter to a property, and hits the performance of the application
Remediation
Make individual required items inside class that need to be bindable.
Violation Code Sample
package {
[Bindable]
public class AvoidGloballyBindableClass
{
public function AvoidGloballyBindableClass()
{
}
private var _avar : int = 10;
public function get avar() : int {
return _avar;
}
public function set avar(avarin : int) : void {
_avar = avarin;
}
}
}
Fixed Code Sample
package {
public class AvoidGloballyBindableClass
{
public function AvoidGloballyBindableClass()
{
}
[Bindable]
private var _avar : int = 10;
public function get avar() : int {
return _avar;
}
public function set avar(avarin : int) : void {
_avar = avarin;
}
}
}
Reference
http://opensource.adobe.com/wiki/display/flexpmd/FlexPMD
Related Technologies
Technical Criterion
Programming Practices - Unexpected Behavior
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.