简体   繁体   中英

How to use dependency injection in Eclipse plugin

I have an Eclipse plugin editor (now running on Kepler), and I want to use dependency injection to get contexts such as workbench, logger, etc'. My purpose is to make my code "more testable".

  1. What plugin dependencies should I add to use the new DI?
  2. Are there goo examples on how to use it?

I assume you are mainly interested in the dependency mechanisms of the Eclipse 4 workbench. I recommend these tutorials and articles for an introduction:

  • an Eclipse wiki page describing how this was introduced in Eclipse
  • a great tutorial introducing the basics of this mechanism and how to use it in your plugin
  • and of course a huge tutorial on vogella about all things E4 development, where dependency injection starts at chapter 23.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM