LabVIEW Craft
  • Blog
  • About
  • Contact
  • Tools
  • Resources

Dependency  Inversion Principle

11/20/2015

9 Comments

 
Jon McBee
The Dependency Inversion Principle (DIP) is a principle of object-oriented design that will change the way you think about writing software.  It is one of the 5 SOLID principles Robert Martin discusses in his book, I highly recommend checking this book out if you have never read it.  I gave a presentation on the DIP with Stephen Loftus-Mercer at NI Week 2015, and just gave a slightly different presentation on the DIP at the Software Craftsmanship Workshop at NI Days Boston 2015.  Below is a recording of the Software Craftsmanship Workshop presentation, along with my slides.
Picture
Depend upon abstract entities, not concrete entities
Jon McBee is a Principal Software Engineer at Cambridge NanoTech and is a Certified LabVIEW Architect, Certified LabVIEW Embedded Developer, Certified TestStand Developer, an NI Certified Professional Instructor, and a LabVIEW Champion
software_craftsmanship_workshop_2015.pptx
File Size: 3357 kb
File Type: pptx
Download File

9 Comments
Ted ANDERSON link
11/20/2015 02:13:14 am

Cool stuff, Jon! Glad to see you continue pushing the boundaries of LabVIEW. Congrats on your new position at Cambridge NanoTech.
Cheers,
Ted

Reply
Jon McBee
11/20/2015 06:49:06 am

Hey Ted,

Good to hear from you. I hope all is well.

-Jon

Reply
Russell Blake link
11/20/2015 10:34:54 am

Jon,

This is a great presentation. I enjoyed it so much I sent it to my coworkers to watch. You did an amazing job explaining an abstract topic in a very clear and easy to follow matter. I thought the analogy of the Craftsman Bolt-On was a great addition.

-Russell

Reply
Jon McBee
11/20/2015 11:16:06 am

Hey Russell,

It's good to hear from you. I'm glad that you enjoyed the presentation! I was putting the slides together at work and happened to see a Bolt-On-esque hand tool lying a mechanical engineers desk nearby. My only regret is that I didn't work in a Michael Bolton reference.

Hope to see you at the CLA summit.

-Jon

Reply
Amiri link
11/20/2015 06:14:57 pm

Great presentation, thanks. Was your NI Week 2015 much different than this video presentation?

Reply
Jon McBee
11/20/2015 06:41:24 pm

My NI week presentation was a co-presentation with AristosQueue. I covered DIP and he covered ISP. For my part I spent a lot more time on the Black Hole example and talked about how DIP can be applied to low coupled messaging for the Actor Framework.

TLDR, it was a different presentation.

Thanks,
Jon

Reply
Matt Gould
11/20/2015 07:29:56 pm

Hey Jon, good to see you back. Question: Is a hardware abstraction layer an example of dependency inversion? Great presentation by the way.

Reply
Jon McBee
11/20/2015 09:12:36 pm

Hey Matt,

It's good to be back, I was playing free agent for a while there. At the risk of oversimplification, yes the DIP is the gateway to both HAL and MAL. In fact, you can think of the message broker in that demo as a MAL, and I suppose that the client broker is really just a UI abstraction layer.

Think about the Bolt-On as a HAL. The designers had to consider the high level module (hand) while designing the abstraction (base) and had to be sure that the abstraction's interface could handle the concrete implementations well (attachments).

In our applications we tend to have a bit more complexity though. The HAL usually needs to be accessed by multiple somethings (sequencer, UI elements, data logging...) and some of those may end up having their own abstraction layers too (abstracted test steps in a sequencer) or may need abstracted messaging to communicate.

Short answer, hardware abstraction layers (or any type of abstraction layer really) are rooted in dependency inversion and dependency injection because you have to be able to separate out the details from the high level module(s) and you have to be able to inject the right details at the right time.

I hope this answer helps, I've got a feeling it's one of those clear as mud types.

Reply
Anthony Maglio
1/15/2016 03:54:39 am

One of the best resources I've come across on to help understand Abstraction and Dependency Inversion a bit better. The practical examples and illustrative explanations really help. Thanks Jon!

Reply



Leave a Reply.

    RSS Feed

    Tags

    All
    Abstract Messaging
    Actor Framework
    Agile
    AI
    Asynchronous Programming
    Best Practices
    C#
    Complexity
    Continuations
    Control Values By Index
    Craftsmanship
    Dependency Inversion
    Dependency Viewer
    Futures/Promises
    Genetic Algorithm
    Liskov Substitution
    Malleable VIs
    Mediator Pattern
    .NET
    Object Oriented
    Object-Oriented
    Packed Project Library
    Parallelism
    Polymorphism
    Pub/Sub
    RawCap
    Root Loop
    Scrum
    Task Parallel Library
    TCP/IP
    TDD
    Test Engineering
    UML
    Unit Test
    VI Scripting
    VI Server
    WireShark

    Archives

    April 2019
    July 2018
    October 2017
    March 2017
    February 2017
    January 2017
    December 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    January 2016
    December 2015
    November 2015
    October 2015
    August 2015
    February 2015
    January 2015

    LabVIEW Blogs

    Eyes on VIs
    LabVIEW Hacker
    VI Shots
    LabVIEW Artisan
    Software Engineering for LabVIEW
    ​Wiresmith Techology
Picture
Powered by the Panda Ant

  • Blog
  • About
  • Contact
  • Tools
  • Resources