Hatena::Groupcatalyst

dann@catalyst このページをアンテナに追加 RSSフィード

2008-05-01

AOPのadviceをMoose+Bread::Boardで

AOPのadviceをMoose+Bread::Boardで - dann@catalyst を含むブックマーク はてなブックマーク - AOPのadviceをMoose+Bread::Boardで - dann@catalyst AOPのadviceをMoose+Bread::Boardで - dann@catalyst のブックマークコメント

Mooseのmethod_modifireは、いわゆるAOPのadviceと同じで、before, after, arroundのadivceに対応するmethod_modifireが存在します。

Mooseの実装をみると、metaのmethod_modifireに登録してるだけなので(実際はMooseというよりも、Class::MOP使ってるだけ)、Mooseでクラスにaroundを直にかくっていう方法だけでなくて、もっと汎用的に使えそうです。

        around => sub {
            my $class = $CALLER;
            return subname 'Moose::around' => sub (@&) {
                my $code = pop @_;
                my $meta = $class->meta;
                $meta->add_around_method_modifier( $_, $code ) for @_;
            };
        },

Mooseを使って、aroundのkeywordを使って、直にクラスにarroundなどの定義をかいてしまうと、使える場所が限られてしまうのですが、これをRoleやクラスの実装から切り離すと、AOPと同じように、クラスの横断的な関心毎をクラスから切り離して扱うことが出来そうです。

実際には、以下のような感じでBread::Boardを拡張すれば使えそうです。

クラスをBread::Boardのサービスとして登録する際に、そのクラスのMethodのAttributeをみて、そのAttriubteがTransaction Attributeだったら、around method modifireとして、Transactionの開始終了を埋め込んだ実装を登録する

とすればよさそうです。

Mooseを使うと、Bread::BoardをベースにしたDIコンテナの仕組みも、より便利に使えそうですね。

ogovutetogovutet2018/03/23 19:11http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

oxevebapoxevebap2018/03/23 19:15http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

oqevoxioqevoxi2018/03/23 19:19http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

ekdeburohtejuekdeburohteju2018/03/23 19:26http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

viewwawivabukviewwawivabuk2018/03/23 19:28http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

uzufuguuzufugu2018/03/23 19:33http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

ehubudiehubudi2018/03/23 19:34http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

aeseciyomeoaeseciyomeo2018/03/23 19:43http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

goxevungoxevun2018/03/23 19:46http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

okfatunefizokfatunefiz2018/03/23 19:47http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

iwetevaviwetevav2018/03/23 19:50http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

axeuropaqipeaxeuropaqipe2018/03/23 19:57http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

ujovuvojujovuvoj2018/03/23 20:04http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

guvojuxomatefguvojuxomatef2018/03/23 23:07http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

iwufyuliwufyul2018/03/23 23:23http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a href="http://onlinebuycytotec.site/">onlinebuycytotec.site.ankor</a> http://tadalafilcialis-cheapestprice.site/

KevinpesKevinpes2018/08/28 13:40Sexual relationship is often a pleasurable give to get relationship with one?s partner. If anything goes wrong with this cooperation process, it is enough to derail their bond. But anything can occur and that's unpredictable. Moreover, able to keep a normal sexual relationship means keeping oneself physically healthy. So any kind of sexual disfunction must be helped by utmost care. One such hazard to health is erection dysfunction commonly seen in men. Unable to keep a proper and prolonged penile erection leads to male impotence. This is infact a serious problem for maintaining a proper sexual relationship. So when there arises a real problem it?s smart to treat it in lieu of sitting quiet.

The choice involving the various available treatment plans involve treatment which has a proper medicine. Response to a dental agent such as Levitra can be quite effective on this context. Studies show that erection dysfunction is especially as a result of insufficient blood flow to the penis? veins and deficiency of stimulation at the same time. Practising oral therapy of Levitra enhances the rate of the circulation of blood that gradually stimulates the penis producing a hard erection, adequate on an intercourse.



Levitra is but one such drug that's discovered to be very effective. Clinically many experts have proved who's even creates patients who are suffering from various health problems like high blood pressure levels, high cholesterol or diabetes. A lot of men, who took Levitra the first time, responded positively for gaining high success rate. Besides, many experts have also found who's can be also taken to medicines employed to treat other medical ailments.

<a href="https://www.cialispascherfr24.com/cialis-super-active-20mg/">https://www.cialispascherfr24.com/cialis-super-active-20mg/</a>