SlideShare une entreprise Scribd logo
1  sur  55
プラグイン3段活用
   slywalker
自己紹介
原田 康生 Yasuo Harada
大阪のこっそりPHPer

忍び歩く男 - SLYWALKER
http://d.hatena.ne.jp/slywalker/

Twitter, Wassr, Hatena, GitHub ID
slywalker
簡単お手軽に
 プラグインを
扱う方法の紹介
1. 整 理 整 頓
増え続ける
Controller
溢れかえる
View Folder
関連したものは
 プラグイン
としてまとめて
  みよう!
関連したものは
 プラグイン
としてまとめて
  みよう!
使うときは
   http://localhost/
     PluginName/
ControllerName/Action
URLが不細工だと
  感じるなら
 routes.php で設定
効能
アプリケーションの見通しが
    よくなる!
2. 道 具 箱
Componentとか
Behaviorとか
Helperとか
再利用することが
 多いと思います
(だって楽したいもん・・・)
あ、
これ前作ったやつ
  使っとこ
  (コピペっと)
ちょっと待って!
            /)
           ///)
          /,.=゙''"/
   /     i f ,.r='"--'つ__________   こまけぇこたぁいいんだよ!!
  /      /   _,.--' /͡   ͡\
    /   ,i   ,二ニ⊃( ●).  (●)\
   /   ノ    il゙フ::::::͡(__人__)͡::::: \
     ,イ「ト、  ,!,!¦     ¦r┬-¦    ¦
    / iトヾヽ_/ィ" \      `ー'́     /
  / ̄ ̄ ̄ ̄\
 /   _ノ  \
 ¦   ( ●)(●)
. ¦     (__人__)________
  ¦     ` ͡/ ー' 'ー \
.  ¦       /( ○)  (○)\
.  ヽ     /  ͡(n_人__)͡ \  …
   ヽ   ¦、    (  ヨ   ¦
   /    `ー─­  厂   /
   ¦   、 _   __,,/     \
警告!
   「コピペ」
それは悪魔の誘惑。
一度手を染めると、
  天国の扉は
 永遠に開かない。

            ミヒャエル・パッハー 聖ヴォルフガングと悪魔
バグ発覚!!
バグ数 コピペ数
 の修正が必要
コピペ先で微妙に
 変更されている!
修正部分がファイル
 によってバラバラ
炎上!
私の方法
CakeCoreフォルダの
    ある階層に
私の方法
 CakeCoreフォルダの
      ある階層に
pluginsフォルダをつくる
私の方法
 CakeCoreフォルダの
      ある階層に
pluginsフォルダをつくる
       その中に
tools(道具箱)フォルダを
        つくる
片っ端から、
再利用しそうな
Component
 Behavior
  Helper
を入れておく
GitやSVNとかで
toolsフォルダを
     管理
各appの
    config/bootstrap.php

$pluginPaths =
        array(ROOT.DS.'plugins'.DS);
呼び出し
var $components =
              array( Plugin.Hoge );
var $actsAs = array( Plugin.Hoge );
var $helpers = array( Plugin.Hoge );
道具箱中身が
増えてきたら
関連するものを抜き出して、
    まとめる。
効能
ソースコードの一元管理が
     できる
3. プラグイン
ちょっと振り返って
 みてください
ちょっと振り返って
 みてください
ちょっと振り返って
 みてください
ちょっと振り返って
 みてください
ちょっと振り返って
 みてください
ちょっと振り返って
 みてください
もうすでに
プラグインの骨組みが
出来上がってませんか?
あとは、
 完成度を
高めるのみ!
建築と並行して修復も!
複数のAppで利用する
  ことによって、
 ますます汎用的に!
どうでしょう?
このできちゃった的
  プラグイン
今日の一言
 プラグインってーのは、
作ろうとしてできるもんじゃ
    ないんだ。
   開発の過程で
できてしまうもんなんだ。
プラグインの感想
  大阪市在住 Yさん
証言1
機能単位でアプリケーション
が見渡せるので、頭の中が混
乱することが減った。


                大阪市在住 Yさん
証言2
初めから分離して考えるよう
になったので、各クラスの依
存度が減った。


                大阪市在住 Yさん
証言3
使い回しやすくなったので、
開発効率が上がった。




                大阪市在住 Yさん
証言4
コピペ時代は、ひとつバグが
見つかると、コピペ数デバッ
グが必要だったが、今は一つ
でよくなった。

                大阪市在住 Yさん
証言5
宝クジが当たった。




            大阪市在住 Yさん
2009年6月5日
第2回
CakePHP
関西勉強会
トップバッター!!
まさに、イチロー
(胃の痛む思い的に・・・)
ご静聴
ありがとうございました

Contenu connexe

Dernier

Dernier (12)

新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
 
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native Integrations
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
 
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
 
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
 
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
 

En vedette

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

En vedette (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

CakePHP Tokyo 2009-5-22

Notes de l'éditeur