Code Monkey home page Code Monkey logo

slam's Introduction

Slam

Slam : A new approach to (dependency) injection!!!

Intro and Part 1 of Slam - https://www.youtube.com/watch?v=VjNTbzEPE88

Part 2 of Slam - https://www.youtube.com/watch?v=9n6936cBCWk

I got tired of the amount of uncessary code that modern day injection models require, and non-essential interfaces that make it difficult for the developer to navigate and debug code.

This effort takes advantage of Jerry Wang http://www.codeproject.com/Articles/463508/NET-CLR-Injection-Modify-IL-Code-during-Run-time work which is used in one of the calls.

Slam is similar to DI or Mock frameworks except that the code is simply replaced at run time. And it allows for replacement and execution of sealed and private methods otherwise not accessible.

Requirements

Before you get started, this is the currently required environment: -Visual Studio 2013 (you might try 2015, but it might not work) -MVC Classes (these don't always get installed; re-run setup by using Uninstall a Program feature in Windows and select Change. Check the MVC Classes box and install -Visual Studio Unit Tests for C# (probaby installed but obtainable through Visual Studio by select Tools / Exentions and Updates -Visual Studio Exentsibility - (not a hard requirement, but you won't get Visaualizations)

Getting Started

It is going to take a while for me to write up the full functionality, so here is the easiest way to get started. Buid the entire solution. Then select Test / Windows / Test Explorer. Examine each of the Unit Tests their. Place a break point at the start of each unit test and debug one at a time. To understand just the basics, step OVER the injector, e.g. Injector.SlamClass(typeof(MySourceClass), typeof(MyMockClass)). It will detract from the initial core learning. Do examine each of the classes (such as MySourceClass) to understand better what is going on.

Lastly, there is one necessary change to make. The RunSealed tests currently requires a hard path to the unittest dll. Make this modification to reflectc your local build environment. @"C:\Users\Patrick\Documents\GitHub\Slam\bin\Slam.UnitTests.Classes.dll"

Please leave all comments in issues on this site. Enjoy!

-Patrick Dengler

slam's People

Contributors

patrickdenglerhobbisoft avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.