Decision Table Dependency Rules - Gnorion/BizVR GitHub Wiki

Decision Table Dependency Rules

DEFINITION

Dependency occurs when one table (or sub decision) can effect the outcome of another

Dependency can be caused by

  • Objects that have values (things and collections of things) and by
  • Functions and Methods that return values (transformations).

Methods are always defined in the context of a class of object either as

  • instance methods eg eligibility=p.determineEligibility
  • class methods eg p=PERSONS.new(name=‘john’)

Note: p.determineEligibility might refer to a DT that is defined as an instance method on the class of PERSONS

Functions are defined independently from classes of object. Function arguments or return values may reference instances or classes Functions should be side-effect free

Four Cases To Consider

  1. Dependency via an object which can be any of these:

    • Bare object (Input, Output or Transient)
    • Plain eg risk,
    • Stuctured eg toy.price
    • Any Expression involving object eg price+tax+shipping
  2. Dependency via a Collection If a DT modifies a collection then any DT that refers to that collection may be dependent - but how do we know which comes first?

  3. Dependency via a Function Call

  4. Dependency via a Method Call

NOTES

  • A DT that invokes a function is dependent on that function or method
  • Dependency can be established purely using the function or method name
  • Always from the function or method table to the table that invokes it
  • NOTE: any arguments passed to the function or method may create their own dependencies on the DTs that set the values of those arguments
  • A function or method may be dependent on other functions or methods
  • A function or method should not be dependent on or change the value of any external object – only what is formally passed in as an argument

Basic Dependency Principles

A Decision table consists of four parts:

image

image

Object Dependency

Object Dependency occurs between two decision tables DT1 and DT2 when

  1. A named object P has its value set in an action of DT1 and
  2. The name P is used in DT2 either tested in a condition or used in an action expression

An object P can be

  • The name of a single data element (eg color),
  • The name of an attribute of a structure (eg toy.color)
  • The name of an instance of a class {toy in TOYS}
  • The name of an entire collection eg PERSONS

Function Dependency

Function Dependency occurs between two decision tables DT1 and DT2 when

  1. DT1 is defined as a function that returns a value
  2. DT2 uses that function is either tested in a condition or used in an action expression

A value can be

  • the value of a single data element (eg color),
  • the value of an attribute of a structure (eg toy.color)
  • an instance of a class {toy in TOYS}
  • an entire collection eg PERSONS

The Independent Table

image