Design pattern to reduce coupling between components, by dynamically injecting into a software component dependencies that it needs to function.
-1
votes
0answers
33 views
Implementing low level class recurring interaction with app logic [on hold]
What solution for printing errors to user would you chose from below examples and why you think its the best choice.
Do you have better solution?
1.Using Error collector class and shutdown function ...
3
votes
2answers
84 views
Simple Python IoC
I'm looking into having a simple dependency injection container in Python. I've Googled on it but so far the solutions that I've found are quite huge and use constructs such as decorators and so on ...
4
votes
1answer
86 views
JSON loader with event bus, cache, and session
I have an Android application which needs to retrieve JSON files from a server and then display the information in my app. To accomplish this I have the following architecture:
The main activity adds ...
0
votes
0answers
93 views
Refactoring duplicate custom service configuration in .NET core
In my current .NET Core project, I want to inject two services into my controllers for dependency injection.
I wrote the following extension methods that each takes a ...
7
votes
0answers
110 views
Unit of Work (UoW) pattern with ADO.NET
I'm trying to implement the UoW pattern using ADO.NET and this is what I've achieved so far:
The IUnitOfWork Interface:
...
4
votes
1answer
49 views
IDTExtensibility2 implementation for Rubberduck's entry point
Here is the new & improved Rubberduck 2.x entry point class, based on MZ-Tools 8.0's Connect.VBA implementation of the ...
1
vote
0answers
37 views
Keep clean SimpleIoc initialization when reusing UserControl
Originally I had ChildUserControl inside ParentUserControl inside MainWindow with this view-...
3
votes
0answers
76 views
Factory (pattern) of Commands (pattern) with additional dependency injection (dependency inversion pattern)
What would you improve at the following code, except:
The problems I'm already aware of, marked as TODO
Line width of at most 120 characters (I've run flake8 over ...
4
votes
3answers
415 views
Dependency Inversion Principle and Dependency Injection in C#
I was doing some sample example which were perfectly fine. But, when I read about SOLID design principle, I had to change my code.
I have implemented DIP and DI (Constructor Injection) in my code. ...
2
votes
1answer
36 views
Pass logger dependency to PostSharp aspect
I'm trying to pass my logger to a Logging Aspect that I've created with PostSharp. I have one logger per job run (because I need to send each job's logs to different folders), each job runs in ...
2
votes
1answer
141 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 ...
5
votes
1answer
83 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
52 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
29 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
80 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
453 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
648 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
165 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
126 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
201 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
628 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
193 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
409 views
Dependency injection with asp.net identity and property injection with dbcontext
I configure asp.net identity using Simple Injector
...
1
vote
2answers
125 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
93 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
112 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
340 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
646 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
128 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
32 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
57 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
...
3
votes
1answer
270 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
84 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
62 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
161 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
334 views
11
votes
1answer
376 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
654 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
186 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
127 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
233 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
74 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
225 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
71 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
490 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
174 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
412 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.
...