aspiers/ansible-viz

convert code into more idiomatic OO

Open

#3 opened on Dec 13, 2017

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Ruby (7 forks)github user discovery
help wantedtechnical debt

Repository metrics

Stars
 (42 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Currently classes are used more or less as libraries rather than in a true OO fashion, e.g.

  • State is passed everywhere via parameters (e.g. dict and g), rather than being stored in instances.
  • The instances have little or no state, and yet the methods are mostly instance methods not class methods.
  • There is no relationship modelled between classes, whereas there is ample opportunity for composition via dependency injection.
  • Core objects such as playbooks, roles, tasks, templates, variables etc. are modelled as Hashes rather than as objects. Commonality between the objects (e.g. name, fqn, parent, originating file path) is not enforced in any rigorous way - this is crying out for inheritance.

Contributor guide