Design pattern to reduce coupling between components, by dynamically injecting into a software component dependencies that it needs to function.

learn more… | top users | synonyms

2
votes
1answer
55 views

Implementation of a C++ IOC container

I have created a pretty simple IOC container for C++ that should allow me to write less coupled code in the future and make my code easier to unit test. Overall I am fairly happy however I feel like ...
4
votes
1answer
59 views

UnitTesting with Mocking and Dependency Injection using Ninject

I have the following scenario that I have not come across so far using Ninject. I have the following class structure (simplified for easy of reading :]). First the abstract base class for all ...
0
votes
0answers
33 views

Prefered way to Inject a object with default properties using Ninject

I've introduced Ninject to an application, and want to understand if what we are running is as in line with best practice as can be. I have a simple config which is required by a service. I want to ...
2
votes
0answers
24 views

Supporting all closure options in WinForms MVC application

I have a WinForms MVC application that uses Ninject for it's Dependency Injection (DI) / IoC Container. I have build quite a nice framework that allows the main shell (which uses a Docking Container ...
4
votes
0answers
72 views

“Ymbirtt vs The Gilded Rose” Kata

The Gilded Rose Kata is a refactoring challenge, in which some frankly disgusting code is thrown at the developer, and they're told to make a small change to it. For reference, the (truncated) ...
0
votes
0answers
108 views

Prism 6 Popup Window with EventAggregator to replace a service

I have a WPF project with Prism 6 and EF6. In my project I have a MainTabModule which has ...
2
votes
1answer
191 views

Injectable logging with NLog and Ninject

I have been using NLog for logging purposes in my web applications, but it was not injectable. More precisely, each class using logging declared the logger like this: ...
1
vote
0answers
66 views

MVC application internationalization using a database provider and dependency injection

Following Nadeem Afana's article about how to include internationalization into an MVC application, I have introduced i18n into one of my MVC applications. These ...
2
votes
0answers
100 views

Tiny calculator using dependency injection and inversion of control

I've started to learn very interesting concept of DI, IoC and related stuff. I have decided to learn it using simple application, very tiny calculator (only basic functions: add, subtract, multiply &...
1
vote
1answer
138 views

Dependency injection class in C++

In a recent project I started passing dependencies to classes as constructor arguments, instead of using local instances. This makes unit testing straightforward (with mock objects), but manual ...
3
votes
1answer
249 views

Use of Ninject as an IoC container in a WinForms MVC application

I am a relatively experienced WPF developer who has had good exposure to MVVM. I have been developing legacy WinForms applications for a while and have recently been asked to fully re-write a large ...
6
votes
2answers
170 views

Dependency problem in C#, through polymorphism, and appropriate design pattern

I'm currently working on a project which involves EntityFramework with a (very) rich model (lots of inheritance). I'm currently facing a problem, quite interesting in my opinion. My model is ...
4
votes
0answers
226 views

Dependency injection with asp.net identity and property injection with dbcontext

I configure asp.net identity using Simple Injector ...
1
vote
2answers
104 views

Entity framework - code first data access

I'm looking for your opinions about ways to improve the access to data in my application. I develop web applications, using Entity Framework 6 code first, and Autofac for dependency injection. Before ...
-1
votes
2answers
87 views

PHP Dependecy Injection Container

A few weeks ago, I asked for another DIC review, but didn't get any response (but only for one about my error handling). So I tried to rework my DIC without any outside insight on it, and the first ...
-1
votes
1answer
35 views

Listings Manager

I am trying to learn to code using Dependency Injection and Inversion of Control in Go. Please consider the following code. I am basically creating an interface ...
2
votes
0answers
105 views

ASP.NET MVC with automatic testing (follow up)

This is a follow-up of this question regarding MVC application architecture fit for automatic testing. I have rewritten the DI code based on the answer provided there and also created some tests to ...
1
vote
0answers
75 views

PHP Dependency Injection Container

I am currently working on a small framework and one of its main components is a dependency injection container I made. I am not a professional dev and I would like someone more experienced than I am ...
1
vote
1answer
237 views

ASP.NET MVC application architecture fit for unit testing with mocking

I am trying to learn how to professionally work with unit testing, so I have refactored a medium sized project of mine (a sort of article aggregator that also does some NLP processing) and tried to ...
2
votes
0answers
22 views

Return four spreadsheets of Google Analytics account, property, profile, and filter information

Scenario goes like this: User enables plugin from within Google Spreadsheet Authenticates with their Google Analytics Account They select which accounts they'd like to perform an audit on Four ...
4
votes
3answers
377 views

Unity Lazy Resolve Implementation

I have been using Microsoft.Unity as my container and have decided that the approach for a lazy implementation causes too much rework. Each time you decide to swap ...
1
vote
2answers
118 views

IoC.Resolve deep in the project or Constructor Injection on entry point of app

I'm building cross-platform application (every mobile/desktop OS + web in ASP.NET). I'm using Xamarin, so I can do everything in C#. But before I start working on UIs, I want to build soild, flexible ...
-2
votes
1answer
31 views

Dependency injection with glob

I have a folder called core with two files inside: index.js and module.js. I'm kidding a little with dependency injection and ES6, and I would like to receive feedback with improvements for my code. ...
1
vote
1answer
54 views

Application Configuration in PHP

I'm learning PHP and I know too many ways to configure the application. I use this method: Folder: app config app.php db.php src class.php index.php ...
0
votes
0answers
89 views

Unit of Work by using Windsor Castle

I want to implement Unit of Work patter with the usage of Windsor Castle in order to controll the trasanctions and sessions. What I did till now is: My business class methods: ...
3
votes
1answer
170 views

Dependency injection with Factory pattern sample code

I'm trying to understand and learn about the SOLID principle and especially Dependency Injection (DI) and Factory pattern. Some background: I have a production application that uses some "helpers" ...
4
votes
1answer
83 views

Hashed texts based on user's passwords

I have finished my first project using ASP.NET MVC. I did not have to wait long to realise I have essentially violated all possible codes of good programming. Well, experience comes with practice. ...
8
votes
1answer
56 views

CommandBars, Buttons and Commands: Take 3

Following up on CommandBars, Buttons and Commands: Take 2, I've refactored quite a lot of the Rubberduck code base (like, a whole third of the entire code base has been affected), and successfully ...
3
votes
1answer
138 views

Configuring MVC 5 project with service layer and DI and UOW

In the past I have always called the repositories directly from the controller, but that is a bad practice and now I am implementing a "Business Layer" to my project. Would I have two UnitOfWorks? ...
3
votes
1answer
244 views

Web job logger implementation

Interface for logger: ...
11
votes
1answer
284 views

IoC Registration: Convention over Configuration

The rubberduck project has reached a turning point. The core features are implemented (except the SmartIndenter embedding - we're keeping that for 2.0), the next few releases will probably just build ...
3
votes
1answer
515 views

PHP class architecture and dependency injection

Let me start off by saying I am not new to PHP or PDO, but very new to OO PHP, and have been struggling to get a firm idea of best practices in my head regarding dependency injection and structuring ...
5
votes
2answers
175 views

Generic Networking Class for PHP

I am in the process of writing networking code for PHP that is meant to be used in long-running PHP processes. I realize that PHP is supposedly not well suited for long-running processes, however ...
2
votes
1answer
121 views

Ball Entity for a Entity/Component/System Soccer Game - Revision 1

I made some refactorings in my classes. The original code is in this question. In that question I receive the suggestion to create a Factory for the class BallEntity. I myself forgot that BallEntity ...
3
votes
1answer
188 views

Safely storing Azure Topic clients in concurreny dictionary

I am trying to optimize the usage of TopicClients in my app. The instance is originally covered by interface and passed by IoC, so the IoC will dispose it at the end of the program life cycle. This ...
2
votes
0answers
67 views

Abstract DI Container Scopes

I'm in the process of refactoring one of my open source projects, branch here. The basic idea of the refactor is to allow for classes and all of its children in the graph to be scoped. I wrote a blog ...
1
vote
1answer
223 views

Factory dependency injector

I recently made the switch from procedural to OOP style of coding. I decided I wanted to learn how everything works before deciding to jump into a framework, follow tutorials, and becoming dependent ...
1
vote
1answer
70 views

Creating various types of menus using dependency injection

I am here to discuss what are the possible improvement can be made in order to make the following code covering all the principles of programming paradigm ( SOLID , DRY ...etc ). Basically, I am ...
5
votes
2answers
299 views

“CommandBus” with Handlers & Observers

I'm looking for a very simple (at first sight) CommandBus, which will handle some ICommand publication. The ...
2
votes
1answer
89 views

Dependency Injection with classes which are created often

I have a question about dependency injection and best practices when using simple classes which are meant to be created often, which have dependencies on external services. Here's a (vastly) ...
0
votes
1answer
243 views

Dependency injection with reading a file

I implemented this code, looking at a dependency injection program as an example. I wanted to confirm with you all whether this implementation is the right way of doing the same. ...
1
vote
1answer
58 views

Manager for customer billing and subscriptions in Rails

I'm looking to get rid of a couple dependencies that I have a sneaking suspicion are present in the code that I'm writing. Right now I have a service class that manages my subscriptions for part of ...
0
votes
1answer
32 views

updateBuildChart method with a lot of dependencies

I've some refactoring issue with one method. This method has a lot of dependencies ...
5
votes
1answer
445 views

Unity and an IoC for Settings

After a somewhat lengthily discussion in the chat room, I have set up an IoC container with Unity to store my settings in. This is my static IoC class: ...
0
votes
1answer
647 views

Having a static com.google.inject.Injector

Dependencies: ...
7
votes
1answer
293 views

Allowing query handlers to use other query handlers

I recently started looking into CQRS when using Entity Framework and the impact it has had on my systems has been overwhelming. I implemented the following patterns described in these blog posts: ...
3
votes
1answer
62 views

MS VS solution structure w.r.t. dependency injection unit tests?

Is the following MS VS solution structure and classes OK w.r.t. easy unit tests with dependency injection? Would your unit tests look similar? If you call the calculations below over a WPF module, ...
7
votes
2answers
1k views

ViewModel creator design

I am trying to move some logic outside my controller for creating my view models for the view. I have a lot of queries to fire to make sure the complete view model is ready, so to keep my ...
2
votes
1answer
136 views

Vehicle running cost calculator

I'm making a road tax data calculator/parser for practice. I do this because I want to learn more about OOP and arrays with its functionality. On my previous post, I made this same application but ...
1
vote
1answer
47 views

Managing a collection of object instances and getting them back out with instance manager / service locator

I'm creating an event loop for an asynchronous event execution library for PHP in PHP. Note that this is for a library and not an application. My event loop is just that -- a simple event loop that ...