Factbites
 Where results make sense
About us   |   Why use us?   |   Reviews   |   PR   |   Contact us  

Topic: Dependency injection


Related Topics

In the News (Wed 30 Dec 09)

  
  Enterprise Java Community: A beginners guide to Dependency Injection
It aims to present the overall concept of Dependency Injection to the junior developer within the context of how it could be used in a variety of DI containers.
Another way to structure the code is to have the clients declare their dependency on services, and have some "external" piece of code assume the responsibility of locating and/or instantiating the services and simply supplying the relevant service references to the clients when needed.
This type of implementation is considered to be an implementation of Dependency Injection and the "external" piece of code referred to earlier is likely to be either hand coded or implemented using one of a variety of DI frameworks.
www.theserverside.com /articles/article.tss?l=IOCBeginners   (3667 words)

  
  Dependency injection - Wikipedia, the free encyclopedia
Dependency injection (DI) is a programming design pattern and architectural model, sometimes also referred to as Inversion of Control or IoC, although technically speaking, dependency injection specifically refers to an implementation of a particular form of IoC.
Dependency injection is a pattern in which responsibility for object creation and object linking is removed from the objects themselves and transferred to a factory.
Dependency injection is a way to achieve loose coupling.
en.wikipedia.org /wiki/Dependency_injection   (331 words)

  
 Why dependency injection is more ...
Dependency is injected into requesting piece of code by the IOC containers like Spring, Hivemind, etc. With IOC containers you do not care about how services are created and how you get references to the ones you need.
If you're using dependency injection then bean names aren't required in the code (although they may still be required in whatever configuration data is used to wire up the dependencies).
With dependency injection the configuration of a component is very clearly separated from the use of the component.
www.javalobby.org /java/forums/t71655.html   (2905 words)

  
 [No title]
One way to mitigate the proliferation of dependencies is by using Dependency Injection (DI), which allows you to inject objects into a class, rather than relying on the class to create the object itself.
The dependencies have been populated and resolved and the client app is using the new classes, all without knowing what class it's using and all without requiring a recompile.
Dependency Injection is a worthwhile concept to explore for use within apps that you develop.
msdn.microsoft.com /msdnmag/issues/05/09/DesignPatterns   (3710 words)

  
 Dependency injection in Apache Geronimo, Part 2: The next generation
Continue the exploration of dependency injection (DI) in Apache Geronimo that began in Part 1 of this two-part article series.
As explained in the first article of this series, constructor injection implies that the framework supplies constructor parameters required by the class upon instantiation.
Many proponents of DI prefer constructor injection, because it means that the injected class never exists in a state where its dependencies aren't present.
www-128.ibm.com /developerworks/java/library/os-ag-ioc2/index.html   (2135 words)

  
 Tim Ng : Dependency Injection in C#
Dependency Injection in C# Jim Weirich has an excellent article on Dependency Injection for Ruby.
The other thing I like about dependency injection is that it is essentially a pattern of Abstract Factory - so you can replace the implementation of your production dependency injection with a test one and you will be able to insert mock objects through the container.
ObjectBuilder is a great dependency injection system in C# (and VB code is available), and its usage can be seen in the source of Enterprise Library and CAB.
blogs.msdn.com /timng/archive/2006/04/09/572135.aspx   (477 words)

  
 java.net: Create a Simple IoC Container Using Annotations
Inversion of Control (IoC), or Dependency Injection (DI), is a concept that allows for the removal of responsibilities from the service component, so it doesn't have to worry about obtaining required services or components.
With property- or setter-based injection, the container that is managing dependencies is introspecting all setter methods or class fields and trying to find named dependencies that match the property and the setter method name.
Constructor-based dependency injection naturally enforces the component contract for mandatory dependencies, as all of them have to be passed to the constructor.
today.java.net /pub/a/today/2005/07/05/IOCAnnotation.html   (1393 words)

  
 Application Generation: Dependency Injection
One of the differentiators of LightWire is the concept of "mixin injection".
It could more properly be called generic setter injection and the idea is to provide the benefits of setter injection (the ability to handle circular dependencies) without having to clutter up your classes with a bunch of setters that you're never actually supposed to call.
The presentation provided a brief intro to Dependency Injection, a short overview of ColdSpring and then ran through how to use LightWire and why you might consider it for some use cases.
www.pbell.com /index.cfm/Dependency-Injection   (856 words)

  
 simonwacker.com - Weblog | About | Projects | Portfolio
Class A must be modified to exchange a dependency (tight coupling): the instance of B may be replaced by an instance of SubB which fulfils the same contract as its super-class B.
Problem of dependency injection: The wiring code may become rather complex if there are a lot of instances with a lot of dependencies to satisfy.
While dependency injection is a pattern with many advantages, there are also some problems when used extensively, which can only be solved by an Inversion of Control Container.
www.simonwacker.com /blog/archives/000102.php   (804 words)

  
 /etc/development » Dependency Injection - Containers / Frameworks   (Site not responding. Last check: 2007-10-19)
Also where you offer a number of potential components any one of which could be used at runtime, dependency injection enables the users to switch the components by changing the configuration files (declaratively) rather than modifying your source.
However in all cases, the dependencies are automatically resolved by the container and passed to the dependent object.
I have in the past preferred to use xwork since dependency injection is the easiest to implement for web based applications where you are likely to use webwork anyway (simplicity), and dipping into xwork API gives you access to a a fair amount of functionality (capability).
dnene.com /archives/3   (1429 words)

  
 /etc/development » Why Dependency Injection - Some more answers
I have found dependency injection to be a very useful pattern in implementing pluggable service providers for service abstractions.
Dependency Injection allows you to either relocate the second dependency onto the fringe boundaries of your code (where one assumes it would be easier to make such changes) or straight into an XML which could be edited by someone outside your organisation (e.g.
Dependency Injection is not something you need to use time and again.
dnene.com /archives/4   (1300 words)

  
 Dependency Injection for Loose Coupling
Constructor Injection is the DI technique of passing an object's dependencies to its constructor.
Setter Injection does not force dependencies to be passed to the constructor.
As implied previously, the primary motivators for doing this include 1) supporting dependency injection without having to modify the constructor of a legacy class and 2) allowing expensive resources or services to be created as late as possible and only when needed.
geekswithblogs.net /billy/archive/2006/04/18/75505.aspx   (1662 words)

  
 Jeremy D. Miller -- The Shade Tree Developer : The Dependency Injection Pattern – What is it and why do I care?
In a nutshell, dependency injection just means that a given class or system is no longer responsible for instantiating their own dependencies.
Dependency Injection is an important pattern for creating classes that are easier to unit test in isolation
I know the important thing is to break the dependency but as you mentioned at one of your old posts it is also important to use the right pattern name at the right place.
codebetter.com /blogs/jeremy.miller/archive/2005/10/06/132825.aspx   (3074 words)

  
 Dr. Dobb's | Dependency Injection & Testable Objects | April 11, 2006
Dependency injection, the topic I examine in this article, is a simple pattern to loosely couple objects and their dependencies.
Dependencies can be expensive, often performing time-consuming procedures such as getting data from a database, and they may have expensive dependencies of their own.
Dependency injection is a popular pattern to design loosely coupled—and therefore robust, reusable, and testable—objects.
www.ddj.com /dept/debug/185300375   (2168 words)

  
 Dependency Injection for Loose Coupling - The Code Project - Design and Architecture
Constructor Injection is the DI technique of passing an object's dependencies to its constructor.
Setter Injection does not force dependencies to be passed to the constructor.
The drawback to using DI-controllers is that the dependencies are still hard-coded somewhere; albeit, they're hard-coded in a location that is often subject to frequent changes anyway.
www.codeproject.com /cs/design/DependencyInjection.asp   (1992 words)

  
 Dependency Injection for Resources
The Dependency Injection pattern simplifies application code, and increases configuration flexibility by deferring component configuration and assembly to the container.
Dependency injection is a term used to describe a separation between the implementation of an object and the construction of an object it depends on, and the ability for a container like Resin to resolve the dependency.
The Dependency Injection pattern is just as useful for servlet configuration as it is for resources.
www.caucho.com /resin-3.0/resource/tutorial/injection/index.xtp   (665 words)

  
 InfoQ: Resource Injection in the Java EE platform Overview
Dependency injection, called resource injection by the spec designers uses annotations or XML descriptors to declare resources or environment entries used by a class, eliminating JNDI lookups.
It is interesting to note that the Java standards emphasize Annotation-driven injection, while the Spring community which popularized dependency injection continues to ignore annotations as a means of injection, using XML descriptors instead.
Dependency Injection was originally known as Inversion of Control (IoC).
www.infoq.com /news/Resource-Injection-in-the-Java-E   (959 words)

  
 Alex Miller - dependency injection
Setter injection is simple, allows you choose which parts of the object to inject, can make setting up bidirectional relationships easier, but has the downside that it’s easier to create an object in a partially constructed state.
At this point, all components in the system declare their dependence on the concrete singleton class and that singleton class is instantiated at a very few points at the “top” or your architecture (then passed down through the systems).
Both properties and dependent components are points on a continuum of “component configuration” but can be roughly classified as configuring a component vs wiring components together.
tech.puredanger.com /category/dependency-injection   (2194 words)

  
 AMIS Technology blog » Blog Archive » Dependency Injection in PL/SQL - Remove Hard Coded Dependencies from ...
The Dependency Injection design pattern has been introduced by Martin Fowler - see for example Inversion of Control Containers and the Dependency Injection pattern at http://www.martinfowler.com/articles/injection.html - and can be seen as a specialization of the Inversion of Control pattern.
Dependency Injection is about the principle of separating configuration from use.
However, the components still have a dependency on this central package and in order to promote reuse, it is far from ideal to have this extra package, especially if components from various sources use different "central" packages for management of constants.
technology.amis.nl /blog/?p=1086   (1605 words)

  
 Dependency injection in PHP5 - PHP Thinktank Blog
There was a port of Pico container by Pawel Kozlowski, who gave a talk on it recently, and that was almost it (some bright minds from #php.thinktank had their own solutions for that).
I think the reason Dependency Injection isn't commonly found in the PHP world is because it's a solution in search of a problem.
And if you want to be able to change dependencies without modifying PHP code you would have to use a configuration file anyway, independent of whether you use the DI or the Registry/Service Locator pattern.
phpthinktank.com /archives/51-Dependency-injection-in-PHP5.html   (659 words)

  
 Dependency Injection in Ruby - { | one, step, back | }
First of all, Dependency Injection (DI) and Inversion of Control (IoC) is hard to explain, the benefits are subtle and the dynamic nature of Ruby make those benefits even more marginal.
Dependency Injection is much like using service locators in that we identify the services by name.
The big difference is that dependency injectors also take the responsibility of creating the service objects and making sure the dependent services are provided as needed.
onestepback.org /index.cgi/Tech/Ruby/DependencyInjectionInRuby.rdoc   (1886 words)

  
 Bob Lee's Blog: Getter-based Dependency Injection
Like service locators, dependency injection containers save you from implementing the same dynamic loading and configuration code over and over in different ways; you can configure your entire application consistently in one place.
Unlike service locators, dependency injection containers don't require component dependence on a service locator API which facilitates sharing between teams that may have their own service locators.
Cedric and I chatted last week about his "useless methods" blog and the benefits of getter-based dependency injection over setter or constructor-based injection (a la pico container and Spring).
weblogs.java.net /blog/crazybob/archive/2004/05/getterbased_dep.html   (877 words)

  
 James Shore: Successful Software
Dependency injection means giving an object its instance variables.
Now when we use the variable (dependency), we use the object that we were given rather than the one we created.
Dependency injection is really just passing in an instance variable.
www.jamesshore.com /Blog/Dependency-Injection-Demystified.html   (494 words)

  
 Constructor Dependency Injection   (Site not responding. Last check: 2007-10-19)
It is therefore quite common that servlets or actions either instantiate these dependencies themselves, or use some sort of lookup mechanism to establish these dependencies.
Depending on registration place in container hierarchy action can have not only request scope, but also session or application.
Months later though, when a jar of components is replaced in an application with a leter version of the same, a new dependency may be missed, and a non-functioning application may be shipped to live.
www.picocontainer.org /cdi-book.html   (5909 words)

  
 Inforbiomatica » Blog Archive » Dependency Injection != Service Locator
Part of any Dependency Injection (DI) solution is some sort of registry that contains all of the configured objects with their declared dependencies resolved.
Because both these patterns have a registry object, it is possible to use the Dependency Injection container as a Service Locator, making all objects dependent on the container class (let’s stick with Spring because I know it better), the ApplicationContext.
If you’re going to do Dependency Injection, however, it would be better to have objects coupled only to their precise dependencies, rather than passing an instance of the ApplicationContext to an object.
www.moseshohman.com /blog/2004/11/24/15   (517 words)

  
 Slashdot | Dependency Injection with AspectJ and Spring
Adrian Colyer, Chief scientist of Interface21, examines how to combine these two techniques to 'facilitate advanced dependency injection scenarios.' From the article: 'Dependency injection and aspect-oriented programming (AOP) are two key technologies that help to simplify and purify domain models and application layers in enterprise applications.
Dependency injection has NOTHING to do w/ weak or strict type-safety (and, in fact, a concrete class is not required at all..
With setter and constructor injection and through the use of interfaces, you facilitate mocking of 3'rd party services such that you completely skip all the complexity of side components and focuses very specificly on what a single component is doing..
rss.slashdot.org /Slashdot/slashdotDevelopers?m=247   (1294 words)

  
 Dependency Injection and Microsoft Windows Forms @ SYS-CON BRASIL   (Site not responding. Last check: 2007-10-19)
Dependency Injection is a design pattern that was originally developed in the Java community.
The basic idea of Dependency Injection is to design software that consists of a number of highly cohesive modules that have predefined interfaces, and to determine the details of how the objects interact with one another at run time.
A great in-depth article on Dependency Injection by Martin Fowler can be found at www.martinfowler.com/articles/injection.html.
br.sys-con.com /read/163735.htm   (1631 words)

Try your search on: Qwika (all wikis)

Factbites
  About us   |   Why use us?   |   Reviews   |   Press   |   Contact us  
Copyright © 2005-2007 www.factbites.com Usage implies agreement with terms.