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

0
votes
2answers
67 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 ...
-2
votes
1answer
25 views

Listings Manager

I am trying to learn to code using Dependency Injection and IoC in GoLang. Please consider the following code. I am basically creating an interface ListingManager ...
2
votes
0answers
94 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
66 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
83 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 ...
3
votes
0answers
20 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
134 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
97 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
27 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
48 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
54 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
90 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
79 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
49 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
103 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
148 views

Web job logger implementation

Interface for logger: ...
11
votes
1answer
181 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
312 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
164 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
107 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
130 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
64 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
198 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
68 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
169 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
47 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
151 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
49 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
31 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
279 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
471 views

Having a static com.google.inject.Injector

Dependencies: ...
7
votes
1answer
187 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
56 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
126 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
46 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 ...
1
vote
1answer
631 views

Dependency Injection With Unity in MVC 5 without repository and unit of work

I want to use dependency injection with Unity in my application. I am not following repository pattern and unit-of-work (and don't want to). I also have ViewModel in my controller action method. ...
2
votes
1answer
69 views

Road tax data parser

I'm making a data parser for road tax data (costs) which parses a JSON file with all weird variable names, which the customer gave me. The costs are different on each vehicle type. The costs at some ...
5
votes
2answers
535 views

Abstracting a Password Service

I want to use Microsoft.AspNet.Identity's PasswordHasher but I don't want to pollute my Domain layer with knowledge of it. As ...
1
vote
0answers
67 views

OOP QueryHandler in PHP

I have a simple database connection class which is using PDO: ...
3
votes
2answers
71 views

Creating list ViewModels in the correct way

I'm using Caliburn Micro to create a WPF application. So what I want to do here is a typical Master/Detail situation. I'm displaying a list of Users and you can can add/edit a User and save the ...
3
votes
1answer
158 views

Game stats storage / display

I have a simple game where you try to go as high up with rockets as possible. I currently store 2 statistics about your playthrough: Current altitude Highest altitude These statistics are stored ...
1
vote
1answer
87 views

Factory object with a dependency on a bean

My problem is quite straightforward. I want to build a factory, but the kind of object returned depends on a value read from a bean that is somehow a cache. So of course, I can't call the bean's ...
0
votes
2answers
145 views

Dynamic connections classes

I have an abstract Connection class which looks like this: ...
5
votes
1answer
137 views

Autowiring publishers/listeners with reflection in Unity Framework

I'm currently building an application with the Microsoft Unity Framework. I also use a simple system of message publishers/listeners inspired from MVVM light and caliburn: The listener interface ...
1
vote
0answers
44 views

Injecting required functions by synchronous script loading

I have a file HintBox.js containing a JS prototype of the same name which requires our internal JS library (call it $lib) in ...
3
votes
1answer
2k views

Dependency Injection into an Abstract Class

Me and another developer have recently forked and taken over an abandoned, open-source project. I have also been reading articles and watching videos by Misko Hevery. When I was reading through the ...
3
votes
1answer
424 views

Implementing ViewModel design pattern using DI in a MVP-VM architecture

Based on this answer: MVVM implementation using C# and XAML, I understand that my ViewModel is some kind of a wrapper for my Model. Being a fan of DI and SOLID principles, I have made my ViewModel ...
2
votes
1answer
130 views

What could be bad from using this form of dependancy injection?

I have a custom framework that I am not sure if certain things I have applied are wrong and if so, just why. I am not well versed in any framework, so I was forced to use mine. Here is an example ...
7
votes
2answers
6k views

Unit of work + repository + service layer with dependency injection

I am designing a web application and a windows service and want to use the unit of work + repository layer in conjunction with a service layer, and I am having some trouble putting it all together so ...