Class-Accessor-0.18 > Class::Accessor::Fast
Class-Accessor-0.18

名前

Class::Accessor::Fast - より速い、しかしより拡張性の無い、アクセサ

概要

  package Foo;
  use base qw(Class::Accessor::Fast);

  # set()かget()が無いことを除いてあとはClass::Accessorと同じ

説明

This is a somewhat faster, but less expandable, version of Class::Accessor. Class::Accessor's generated accessors require two method calls to accompish their task (one for the accessor, another for get() or set()). Class::Accessor::Fast eliminates calling set()/get() and does the access itself, resulting in a somewhat faster accessor.

これはClass::Accessorよりも幾分高速な、しかし拡張性の乏しいバージョン である。Class::Accessorによって生成されたアクセサは二つのメソッドを 呼び出すことによって、自らの仕事を達成している(一つはそのアクセサ用、 もう一つはset()/get()用)。Class::Accessor::Fastは、set()/get()の 呼び出しを排除し、それ自身でアクセスすることによって、いくらか高速な アクセサとなっている。

The downside is that you can't easily alter the behavior of your accessors, nor can your subclasses. Of course, should you need this later, you can always swap out Class::Accessor::Fast for Class::Accessor.

欠点は、簡単にはアクセサおよびサブクラスの振る舞いを変更できないことだ。 もちろん、後で変更は必要になるはずで、いつでもClass::Accessor::Fastを Class::Accessorに置き換えることができる。

EFFICIENCY

"EFFICIENCY" in Class::Accessor for an efficiency comparison.

効率性の比較は "EFFICIENCY" in Class::Accessor を参照。

作者

Michael G Schwern <schwern@pobox.com>

SEE ALSO

Class::Accessor