I recently stumbled upon the following Configuration Injection Framework. Seems interesting and seems to fit my needs. Has anyone tried it or knows about some other Configuration Injection frameworks? As far as I know Spring and Google Guice does not support this kinds of injection?
...
I have several components for which there exists different versions, depending on the language used by the system (configurable, and can be changed at runtime). For example, I have an interface ("component") for Tokenizer, and two concrete implementations for english and chinese, like so:
public interface Tokenizer {
List<String> to...
I have a guice based app that now needs multiple instances of a given type so I plan on using a named annotation to disambiguate the dependencies. However a dependency of this type also needs to vary based on which one I get.
To illustrate lets say I have
@Singleton
public class FooCache {
private final FooCacheListener listener;
...
can you get 2 singleton instances of the same underlying type?
this is obviously trivial in spring as it is based on named instances to which you attach a scope but I can't see the equivalent in guice which is about binding types to implementation classes. Note that I don't want to have to bind to the instance as the instances in quest...
I'm trying to set up Ninject for the first time. I've got an IRepository interface, and a Repository implementation. I'm using ASP.NET MVC, and I'm trying to inject the implementation like so:
public class HomeController : Controller
{
[Inject] public IRepository<BlogPost> _repo { get; set; }
public ActionResult Index()
{...
Posted this on the structuremap group as well. We just started using structuremap last week, and are really digging it.
I'm sure I'm missing something simple.
I am trying to mimic the following code, using SM within my factory.
I'm ok with having the container dependency in the factory class. The
consensus in this thread seemed ...
We are using the following code in a code behind page
[CreateNew]
public AdminController Controller { get; set; }
and the following code within the controller class
[ServiceDependency]
public IAdminService Adminervice { get; set; }
this works fine for a normal aspx page.
I would like to audit a Session starting event in my applica...
Should I have any concerns about using a IoC/DI Container, specifically ninject, in a windows mobile app using the compact framework 3.5?
...
Using Unity in Prism, I would like to send a parameter to the object's constructor like this:
PSEUDO-CODE:
SmartFormPresenter smartFormPresenter1 =
this.container.Resolve<SmartFormPresenter(customer)>();
But instead I have to instatiate it and then assign a property:
SmartFormPresenter smartFormPresenter1 =
this.container.Re...
We are building an ASP.NET MVC site, and I'm struggling with where to define a connection to best enable unit testing (I use 'connection' generically - it could be a session, a connection, an adapter, or any other type of data context that can manage transactions and database operations).
Let's say we have 3 classes:
UserController
U...
Anybody out there have experience testing "out of process assemblies"?
I'm testing some Com+ (Serviced Component) and WCF services configured to be activated out of process and I'm not sure what the best practices are for testing in these situations.
What I've done is given the public classes their own IOC container that they can buil...
Do any inversion of control / dependency injection framworks support viewing the object dependencies that have been registered? This is not to execute the code, but to better understand it. It seems that a graph based on the information it has (class A depends on B and C, class B dependencs on C and E, etc) would really document a syst...
I'm starting a web application that contains the following projects:
Booking.Web
Booking.Services
Booking.DataObjects
Booking.Data
I'm using the repository pattern in my data project only. All services will be the same, no matter what happens. However, if a customer wants to use Access, it will use a different data repository than if t...
see also Which C#/.NET Dependency
Injection frameworks are worth looking
into?
There are now many dependency injection frameworks to choose from. You used to often be forced to use a given dependency injection framework due to a library you were using. However the Common Service Locator library has enabled library code to be i...
This probably isn't possible, but it's annoying enough to try...
For convenience sake I'd like to be able to select "Go to definition" on a property or method on a variable defined as an interface and have Visual Studio go to the concrete implementation instead of the interface. Is there an attribute or something that I can use to instr...
I am looking for a dependency injection framework for a Java SE (Swing) application that runs under JDK 1.4. Are there any recommended DI frameworks that I can use? (Guice and other annotation-based frameworks are out, and I don't want to mess with something like Retroweaver.)
Also, is Spring suitable for use in a Java SE application?
...
Hi
I am writing a client/server application, where the client is a Windows Forms app, and the server is a WCF service hosted in a Windows Service. Note that I control both sides of the application.
I am trying to implement the practice of coding against an interface: i.e. I have a Shared assembly which is referenced by the client appli...
I am currently trying to wrap my mind around Java EE 5. What I'd like to do is create a sample application that
offers a simple stateless EJB (e. g. a simple calulator with an add() method)
expose this add method as a webservice
consume this webservice from another EJB
The first two steps are easy and I can deploy and test this bean ...
public class StatisticsViewPresenter
{
private IStatisticsView view;
private Statistics statsModel;
public StatisticsViewPresenter(IStatisticsView view, Statistics statsModel)
{
this.view = view;
this.statsModel = statsModel;
}
}
I don't use events (but am willing to if it can solve my problem), so ...
I work in a small shop where we have a LOT of legacy Cobol code and where a methology has been adopted to allow us to minimize forking and branching as much as possible.
For a given release we have three levels:
CORE - bottom layer, this code is common to all releases
GROUP - optional code common to several customers.
CUSTOMER - optio...