Submit Search
Upload
DiとDIコンテナについて
•
Download as PPTX, PDF
•
1 like
•
702 views
Akiko Sugawa
Follow
ふくてん#2 LT にて使用したスライドです。
Read less
Read more
Software
Report
Share
Report
Share
1 of 10
Download now
Recommended
Wacate2014夏_BPPセッション~外に出てみよう伝えてみようそして生み出そう~
Wacate2014夏_BPPセッション~外に出てみよう伝えてみようそして生み出そう~
Rina Fukuda
プレゼン技術研究会を二年やってみてプレゼンについてわかった3つのこと
プレゼン技術研究会を二年やってみてプレゼンについてわかった3つのこと
真俊 横田
プレゼン初心者に ありがちな アンチパターン 野望篇
プレゼン初心者に ありがちな アンチパターン 野望篇
真俊 横田
雁川 誰得アプリからSNS活用への道(たぶん)
雁川 誰得アプリからSNS活用への道(たぶん)
玲 佐藤
マストドンを生んだ分散SNS 15年の歴史
マストドンを生んだ分散SNS 15年の歴史
真俊 横田
情報のオープン化 (OSO2013懇親会LT資料Web版)
情報のオープン化 (OSO2013懇親会LT資料Web版)
mirai_iro
RailsTutorial - 発表資料, -beta-
RailsTutorial - 発表資料, -beta-
Takeshi Wan
プレゼン初心者に ありがちな アンチパターン 黎明篇
プレゼン初心者に ありがちな アンチパターン 黎明篇
真俊 横田
Recommended
Wacate2014夏_BPPセッション~外に出てみよう伝えてみようそして生み出そう~
Wacate2014夏_BPPセッション~外に出てみよう伝えてみようそして生み出そう~
Rina Fukuda
プレゼン技術研究会を二年やってみてプレゼンについてわかった3つのこと
プレゼン技術研究会を二年やってみてプレゼンについてわかった3つのこと
真俊 横田
プレゼン初心者に ありがちな アンチパターン 野望篇
プレゼン初心者に ありがちな アンチパターン 野望篇
真俊 横田
雁川 誰得アプリからSNS活用への道(たぶん)
雁川 誰得アプリからSNS活用への道(たぶん)
玲 佐藤
マストドンを生んだ分散SNS 15年の歴史
マストドンを生んだ分散SNS 15年の歴史
真俊 横田
情報のオープン化 (OSO2013懇親会LT資料Web版)
情報のオープン化 (OSO2013懇親会LT資料Web版)
mirai_iro
RailsTutorial - 発表資料, -beta-
RailsTutorial - 発表資料, -beta-
Takeshi Wan
プレゼン初心者に ありがちな アンチパターン 黎明篇
プレゼン初心者に ありがちな アンチパターン 黎明篇
真俊 横田
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
More Related Content
Featured
2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
Marius Sescu
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
Expeed Software
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
Pixeldarts
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
marketingartwork
Skeleton Culture Code
Skeleton Culture Code
Skeleton Technologies
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
Neil Kimberley
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
contently
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
Introduction to Data Science
Introduction to Data Science
Christy Abraham Joy
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
Vit Horky
The six step guide to practical project management
The six step guide to practical project management
MindGenius
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
Featured
(20)
2024 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 ChatGPT
Product 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 Health
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
Skeleton Culture Code
Skeleton Culture Code
PEPSICO 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)
How 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 Insights
Trends 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 summary
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
Google'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
Introduction to Data Science
Introduction to Data Science
Time Management & Productivity - Best Practices
Time Management & Productivity - Best Practices
The 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...
DiとDIコンテナについて
1.
DIとDIコンテナについて 2016年 4月 15日 須川
昌子
2.
自己紹介 • 須川 昌子(すがわ
あきこ) • カイト君(ワンコ)の飼い主 • 加勢屋工房合同会社に勤めてます • Twitter:@SUGA_HEY • Facebookも本名でやってます
3.
カイト君、3歳になりました!
4.
Javaで最初にハマったこと DI?? DIコンテナ、何それ??? そこで 調べてみた!
5.
DIとは • DI( Dependency
Injection )は日本語で依存性注入 • 依存性注入 とは、わかりやすくいうとオブジェクト注入 • コンポーネント(クラス)間の依存関係をソースコードから 取り除くことでプログラムの実行時までのコンポーネント同 士が依存関係を持たないようにするデザインパターン • Wikipediaに詳しく記載されています (https://ja.wikipedia.org/wiki/%E4%BE%9D%E5%AD%98%E6%8 0%A7%E3%81%AE%E6%B3%A8%E5%85%A5)
6.
DIコンテナとは • DIコンテナとは、アプリケーションにDI(Dependency Injection: 依存性注入)機能を提供するフレームワーク DIコンテナ クラスBクラスA 利用する インスタンス生成BをDIする
7.
ユニットテストのサンプル public interface EmployeeRepository extends
CrudRepository<Employee, Long> { } @Service public class EmployeeService { @Autowired EmployeeRepository repo; public String csvAll() { StringBuilder csv = new StringBuilder(); Iterable<Employee> all = repo.findAll(); for (Employee e : all) { csv.append(e.csv()).append("rn"); } return csv.toString(); } } public class EmployeeServiceTest { @Test public void testCsvAll() { // 準備1:テストデータを生成 Employee[] a = { employee(1L, "Test1", 210000L), employee(3L, "Test3", 230000L)}; List<Employee> all = Arrays.asList(a); // 準備2:リポジトリのモックを設定 EmployeeRepository repo = mock(EmployeeRepository.class); when(repo.findAll()).thenReturn(all); EmployeeService service = new EmployeeService(); service.repo = repo; ・・・省略・・・ http://web-develop.hatenablog.jp/entry/2015/08/13/164544
8.
.NET でもDIコンテナが使える • Unity(ゲームではないほう) https://msdn.microsoft.com/ja-jp/library/hh319722(v=pandp.50).aspx •
Managed Extensibility Framework (MEF) https://msdn.microsoft.com/ja-jp/library/dd460648(v=vs.110).aspx • Sessar.NET (2016年9月26日でEOL(End of Life)らしい) http://s2container.net.seasar.org/ja/seasarnet.html • Spring.NET(2012年12月以降更新されていない) http://springframework.net/ 他にも色々ありました。
9.
まとめ Java開発を経験したことにより新たな知識を得ることができま した。 複数の言語・フレームワークを経験・学習することで新しいこ とを学んだら、今までの環境にもフィードバックすることが理 解度を深める上で大事です。
10.
おしまい
Download now