Blog

Category Filtering: 'dependency-injection'

21
May 2014

Gavin Pickin

Techie Gotchas - Debugging Code - How important is it to a Programmer?

CFML Language, Chit Chat, Conferences, Dependency Injection, Techie Gotchas, WireBox

It seems as programmers, we're always writing code, but as Dan Wilson said in one of his great sessions at cf.Objective() last week, we spend only a small fraction of our time writing new code, we spend most of it debugging, fixing and reading code. Thats not something you normally think about, but it aligns with my thinking recently, about what makes a good programmer. Being involved with teams for some time now, albeit small teams, adding new members is something which is constantly on the horizon, and the more I think about it, one of the biggest signs of a good programmer is the ability to spot bugs and problems with code. If you're fixing, debugging, or just trying to read code, it makes sense that reading and understanding the code is the most important thing. Now, whether you agree or not, why am I writing this today? 

27
February 2014

Gavin Pickin

Adding ColdBox's WireBox to Legacy Site - Installation 1 2 3 Go

CFML Language, ColdBox, Dependency Injection, WireBox

I'm dealing with a the task of bringing more and more of my legacy code projects into this decade, especially when we're doing upgrade and continuous work, so we can eliminate some of the headaches as we move forward. One of the steps is ensuring we are using our CFC components properly, so today, I am going to install Wirebox into our app, which is easy, but this series, we'll go through the other steps to being able to use Wirebox properly. I use that word like I know what Properly is, I guess we'll find out soon if I do know, or not.

17
February 2014

Gavin Pickin

Techie Gotcha - Application CFC inheritance Paths with Mappings - Silly Me

CFML Language, CFML Server, Dependency Injection, Techie Gotchas

There is someone, somewhere, beating their head into their desk and saying to themselves, either very quietly, or yelling it at the top of their lungs, "What the {appropriate bad word} was I thinking, I'm an idiot". It might not be you right now (you're reading this blog post, so its probably not you), it might not be you tomorrow, but we all have those moments, where, something seemingly simple, gets the best of us... because its only simple once you see the light. Hindsight is 20/20, I believe its better to share those moments, so that everyone else can learn from your mistakes, even if it proves you have those moments, and it might prove you have them more of those moments than most people :) 

Today, I have one of those moments to share with you, and today, its about Application.cfc Inheritance Paths with Mappings, and how I finally "clicked" about something I had always wondered about, but hadn't really looked into properly.

22
January 2014

Gavin Pickin

Unit Testing - Online Learning - Great way to understand Dependency Injection

Angular, Dependency Injection, Online Interactive Learning, Unit Testing

We've done a lot lately with Unit Testing, and one of the items we touched on, only briefly, in the scheme of things, was Dependency Injection, and why it is a good practice to use. We also discussed why a Dependency Injection framework like ColdBox's WireBoxSean Corfield's DI/1 from Framework/1, and Coldspring from the XML days are a great benefit, especially as your app gained momentum and size. 

I explained it here, and although I only touched on it, I know Dependency Injection is not an easy concept to grasp, the funny thing, once you actually do it, you think to yourself, wow, thats not complicated at all. Yesterday I blogged about the great videos available online at youtube for Angulars Conference ng-conf, and one of the ones I watched about Dependency Injection was priceless... so todays post is going to discuss that video, and then let you watch the video, and everything will click (I hope).

17
January 2014

Gavin Pickin

Unit Testing 06 - Mocking External Dependencies Part 2

Dependency Injection, Unit Testing

Welcome back to the 6th post in our Unit Testing for Dummies Series, where I walk you through building a small ColdFusion (cfml) application using Test Driven Development, running our tests with TestBoxOrtus Solutions and ColdBox's testing platform. 

Last time we created our WebsiteDAO.cfc and a simple method getWebsite() that would return a query containing the Website Details. In our method, we returned only an empty query at this time, since we are still fleshing out our App, as we explore through our Test Driven Development. Today, we're going to use Mocks to isolate our CUT component under test, which is our Website.cfc (website service). 

09
January 2014

Gavin Pickin

Unit Testing 05 - External Dependencies and Dependency Injection

Dependency Injection, Unit Testing

Our last post was an introduction into what is Mocking, and why we Mock in Unit Testing. We looked at Mocking an dependency of one function on another function internal to our CUT component under test. In this post, we're going to look at dependencies of our function on other objects and functions, and how we use Dependency Injection, or Inversion of Control to give our Website service object access to our WebsiteDAO.

Blog Search