Wednesday, December 21, 2016

Tuple Dictionary Key ???

The other day myself and some coworkers where going over some ideas on refactoring a process.  In this conversation the idea of a dictionary key of a tuple came up.  I thought this has to work especially after my last post about dictionaries => Fun with Dictionaries – Replacing ugly switch and if statements

So below is some code showing my findings.  Also here is the link to my github with all the code (https://github.com/devdaves/FunWithDictionaries2)

Here is an example factory where the dictionary with a tuple key is instantiated and used.

Using the Tuple as a key you can actually take some extremely complicated logic with multiple options and turn it into a simple dictionary lookup.

1 comment:

  1. The parts’ mechanical dimensions are outlined using computer-aided design software program, after which translated into manufacturing directives by computer-aided manufacturing software program. Therefore, essential to|it could be very important|you will want to} have educated CNC machinists and programmers in the industry to function this high-tech machinery. As long because the machine is programmed with the proper code, the machine Kids Mittens functions will perform the steps as dictated by the software program.

    ReplyDelete