ioc-container Questions

3

Solved

I get a bit confused over all the nice things laravel has to offer in terms of the IOC container and facades. Since I'm not an experienced programmer it gets overwhelming to learn. I was wondering,...
East asked 10/8, 2014 at 13:28

4

Solved

How can I configure Ninject to resolve null with my constructor injection? I am using ToMethod with a factory method and InTransientScope. My factory is designed to return null if certain things ar...
Alto asked 2/3, 2011 at 1:15

10

Solved

We have an ASP.NET MVC 4 web app that uses SQL Server 2012 and Entity Framework as ORM and Unity for IoC. Web app is hosted on Amazon EC2. I started getting "Physical connection is not usable&...

3

Solved

How do I registertype with the container where the type doesn't have NO PARAMETER constructor. In fact my constructor accepts a string, and I normally pass in a string that represents a Path. So ...
Seethe asked 23/10, 2010 at 8:36

6

I have a BaseController that provides the foundation for most HTTP methods for my API server, e.g. the store method: BaseController.php /** * Store a newly created resource in storage. * * @re...
Termination asked 22/4, 2015 at 11:21

6

Recently I asked a question about software architecture Should service call another service or repository directly? After that answer, I reorganized and refactored my application. In a simple way...

2

Solved

How can I register a decorator class when using Microsoft.Extensions.DependencyInjection as the container? When registering my types in the following way (similar to Castle Windsor) I get a "Syst...
Retard asked 28/9, 2017 at 13:26

8

I have a test class with a constructor that needs an IService. public class ConsumerTests { private readonly IService _service; public ConsumerTests(IService servie) { _service = service; } ...
Alenealenson asked 24/8, 2016 at 19:5

2

Solved

Following this answer, I want to inject the IHostApplicationLifetime in my class to shutdown properly when the method StartAsync is over. But I don't know how to get the applicationLifetime from t...

2

Solved

I'm registering many types to my Container, implementing all sorts of interfaces. In some programmatic manner, I want to have a unit test that will check all resolving are successful, meaning there...
Cyclotron asked 16/7, 2017 at 10:52

10

Solved

I find that my constructors are starting to look like this: public MyClass(Container con, SomeClass1 obj1, SomeClass2, obj2.... ) with ever increasing parameter list. Since "Container" is my dep...

8

Solved

I'm working with Laravel 5 and I would like to know how to generate a RESTful Resource Controller with all predefined methods using the Artisan command (PHP). When I run php artisan make:controlle...
Beestings asked 8/1, 2016 at 12:49

4

Solved

Bindings I'm using bindings in my service provider between interface and implementation: public function register() { $this->app->bind('MyInterface', MyImplementation::class); } Middlewa...
Latoshalatouche asked 31/5, 2016 at 20:40

8

Using a IOC container will decrease the speed of your application because most of them uses reflection under the hood. They also can make your code more difficult to understand(?). On the bright si...
Improvement asked 5/2, 2009 at 7:52

5

Solved

I have several beans that implement the same interface. Each bean is annotated with @Component @Order(SORT_ORDER). public class MyClass implements BeanInterface{ ... } At one point I autowire...
Sutra asked 6/6, 2013 at 17:0

3

I just can't seem to wrap my brain around this situation in Autofac: My business logic needs an object of type IFinal. The implementing class Final has several dependencies that are not known by ...
Disincentive asked 1/4, 2018 at 5:50

2

Solved

Why would you use a Dependency Injection Framework when you can simple use the following pattern? unit uSomeServiceIntf; interface type ISomeService = interface procedure SomeMethod; end; va...

4

Solved

I was wondering is there's any side effect to registering the container within itself IContainer container; ContainerBuilder builder = new ContainerBuilder(); container = builder.Build(); builder...
Computer asked 24/4, 2016 at 3:36

4

Solved

I ran into a problem where I had an Html.DropDownList in my view that would postback the selected value the first time I submitted the form, but each subsequent postback would only post data from t...
Sanctimony asked 24/11, 2009 at 19:14

3

Solved

I'm new to Spring, I would like to know: I have a java class annotated with @Component (spring) and inside I have a method annotated with @PostConstruct. The class is then referenced by @Autowire...
Latria asked 21/6, 2017 at 16:5

3

Solved

I have an Eloquent Model called Surface which is dependent on a ZipCodeRepository object: class Surface extends Model{ public function __construct(ZipCodeRepositoryInterface $zipCode){...} and ...
Lamee asked 10/11, 2015 at 18:21

5

Solved

How would you go about registering diferent IDbConnectionFactory instances in Funq and then access them directly within your services? Do named instances somehow come into play here? Is this the ...
Obediah asked 6/1, 2012 at 20:35

3

Is there a way to make Unity dispose property-injected objects as part of the Teardown? The background is that I am working on an application that uses ASP.NET MVC 2, Unity and WCF. We have writte...
Sabra asked 18/9, 2009 at 9:41

4

I need to apply specific global scope only if authenticated user's role is equal to something. So that user with certain role will only be able to execute queries on a given subset of records. I c...

3

Solved

I need to use a custom Implementation of UrlGenerator. So how can I change the default binding of laravel, that is implemented somewhere deep in the core as 'url' => ['Illuminate\Routing\UrlGe...
Kordula asked 22/9, 2015 at 3:36

© 2022 - 2025 — McMap. All rights reserved.