PHPカンファレンス2012 実践Dependency Injectionスライド
![実践Dependency Injection](https://cdn-ak-scissors.b.st-hatena.com/image/square/7d149a5a047069cf8c4b1f9b588d95fd0d83f8f5/height=288;version=1;width=512/https%3A%2F%2Ffiles.speakerdeck.com%2Fpresentations%2F50547b49bf73df000204b968%2Fslide_0.jpg%3F137588)
PHPカンファレンス2012 実践Dependency Injectionスライド
(追記:2012-12-15) 本記事およびこれに続くその2,その3をまとめて電子書籍化しました。「Gumroad」を通して100円にて販売しています。内容についての追加・変更はありませんが、誤記の修正およびメディア向けの調整を行っています。 電子書籍「Ruby脳が理解するJavaScriptのオブジェクト指向」EPUB版 このリンクはGumroadにおける商品購入リンクになっています。クリックすると、オーバーレイ・ウインドウが立ち上がって、この場でクレジットカード決済による購入が可能です。購入にはクレジット情報およびメールアドレスの入力が必要になります。購入すると、入力したメールアドレスにコンテンツのDLリンクが送られてきます。 購入ご検討のほどよろしくお願いしますm(__)m 関連記事: 電子書籍「Ruby脳が理解するJavaScriptのオブジェクト指向」EPUB版をGumroadか
まとめ記事を書いた本の一覧です。まとめ記事の内容も、簡単に説明しています。一覧出典本まとめ記事オブジェクト指向設計原則パッケージ設計の原則オブジェクト指向を効果的に活用するための、クラス設計の原則についてまとめています。(SOLID原則) また、クラスレベルだけでなく、パッケージレベルの原則についてもまとめています。GRASPパターンオブジェクト指向設計の基本は「適切なクラスに適切な責任を割り当てること」です。この指針である「GRASP」についてまとめています。構造化プログラミング構造化プログラミングのエッセンスについてまとめています。 パラダイムが異なっても(=オブジェクト指向でも)通用する・適用できる考え方です。 GoFのデザインパターンGoFのデザインパターンを全てまとめています。 各パターンのまとめ後、「なんでこんなことするのか?」「こうするとどういう効果がうまれるのか」を考察して
How do you measure the quality of your code? Performance and testing are just one aspect of code, in order to meet deadlines and make maintenance quicker you also need your code to be readable, decoupled and generally easier to comprehend and work with. This talk will go over tips and exercises to help you identify trouble areas, refactor them and train you to write better code in future projects.
Object Calisthenics 9 steps to better software design today, by Jeff Bay http://www.xpteam.com/jeff/writings/objectcalisthenics.rtf http://www.pragprog.com/titles/twa/thoughtworks-anthology We’ve all seen poorly written code that’s hard to understand, test, and maintain. Object-oriented programming promised to save us from our old procedural code, allowing us to write software incrementally, reusi
This document summarizes a microservices meetup hosted by @mosa_siru. Key points include: 1. @mosa_siru is an engineer at DeNA and CTO of Gunosy. 2. The meetup covered Gunosy's architecture with over 45 GitHub repositories, 30 stacks, 10 Go APIs, and 10 Python batch processes using AWS services like Kinesis, Lambda, SQS and API Gateway. 3. Challenges discussed were managing 30 microservices, ensur
Using Containable¶ To see how Containable works, let’s look at a few examples. First, we’ll start off with a find() call on a model named ‘Post’. Let’s say that ‘Post’ hasMany ‘Comment’, and ‘Post’ hasAndBelongsToMany ‘Tag’. The amount of data fetched in a normal find() call is rather extensive: debug($this->Post->find('all')); [0] => Array ( [Post] => Array ( [id] => 1 [title] => First article [c
BtoB SaaSの会社でDDDを活用して事業を成長させてきた中で、DDDのプラクティスの実践という面ではかなり大きな成果が得られました。 しかし、事業を成長させるという点において、DDDのプラクティスだけではうまくいかないこともあり、別のアプローチも同時に試行錯誤しています。 この発表では、うまく行ったプラクティスの内容と、カバーできなかった課題、そこに対する現在の取り組みについて紹介します。 ドメイン駆動設計 サンプルコード&FAQ https://little-hands.booth.pm/items/3363104 ドメイン駆動設計 モデリング/実装ガイド https://little-hands.booth.pm/items/1835632 ドキュメント内のブログ記事URL https://little-hands.hatenablog.com/entry/2020/12/22/
>>CakePHP 2.2 から コアが提供する Utility のライブラリに新たに class Hash が加わりました。 次回のメジャーバージョンアップでは Set クラスが廃止され、Hash クラスに移行するとのことです。 http://bakery.cakephp.org/articles/markstory/2012/04/30/cakephp_2_1_2_2_2_0-beta_released New Hash class A new utility library Hash was added. It is intended as a replacement for the Set class featuring improved performance, and a more consistent API. All internal calls to Set were r
Information Holder Last year I worked on an energy trading system. In that system users might enter a trade to purchase 1,000 barrels of gasoline. In order to make that trade, we had to check the on-hand inventory, which was frequently tracked in metric tons, and compare the desired quantity with the on-hand quantity. Several other times we had to compare two quantities that were in different unit
CRC (Class Responsibility Collaborator) モデルの概要 by Scott W. Ambler, Copyright 2003 CRC (Class Responsibility Collaborator) モデル (Beck & Cunningham 1989; Wilkinson 1995; Ambler 1998a) とは、普通のインデックスカードの集合です。このインデックスカードは、図1に示すように3つの区画に分かれています。クラス (class) は同じようなオブジェクトの集合であり、責務 (responsibility) はクラスが知っている、あるいは行う事柄であり、協調クラス (collaborator) はクラスが責務を果たすために相互作用する他のクラスです。図2に手書きのCRCカードの例を2つ示します。 図1. CRCカードの区画 図2
CakePHPを用いて多言語化をする方法をまとめます。 今のご時世、複数言語でサービスを運用するのは当たり前になりつつあります。 少なくとも1つのサービス内で、日本語、英語くらいは切り替えたいですよね。 今回はi18nを使用して多言語化をはかりたいと思います。 i18nに関しては以下のページを参考にしてみてください。 I18N【国際化】 – IT用語辞典 国際化と地域化 – Wikipedia それでは多言語化の手順を紹介していきます。 CakePHPのインストール まずはCakePHPをインストールしましょう。 今回はわかりやすいように インストール→コントローラ、ビューの作成→i18nを使って多言語化 をしようと思います。 それでは以下からダウンロードしましょう。 CakePHP – github 【tmpフォルダ書き込み権限付与】 解凍してアクセス場所に置いたら、tmp/を書き込み可
Account Suspended This Account has been suspended. Contact your hosting provider for more information.
PHPのテストライブラリとしては一番有名どころのPHPUnitと実際のブラウザをJavaScriptを使って画面遷移をテストすることができるSelenium RCを使って実際に結合テストを行ってみたので今回紹介したいと思います。 PHPUnit PHPUnitはPHPの一番有名なテストライブラリです。テストケースを用意することで仕様変更にも強いアプリケーション開発が可能になります。 さまざまなことができるPHPUnitですが、PHPUnitだけでは画面遷移のような機能テストは難しいものです。 なぜなら、PHPだけで画面遷移を確認するためにはブラウザの動きをシミュレーションしたライブラリを使ったりしてテストする方法になってしまうからです。 たとえばsymfony1系ではsfTestBrowserというライブラリが用意されていてこのライブラリを利用することでテストが行えるようになっていますが、
<?php // Entity/User.php namespace Entity; class User { private $name; private $gender; public function __construct($name, $gender) { $this->name = $name; $this->gender = $gender; } public function getName() { return $this->name; } private function getGender() { return $this->gender; } } 名前を保持するnameプロパティと、性別を保持するgenderプロパティを定義します。genderプロパティに対するゲッターメソッドはprivateにしてあります。 ■ ReflectionClass まずクラスの情報を抜
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く