Skip to content

Commit

Permalink
Clean Borg / MacroResolver classes - only comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mohierf committed May 15, 2017
1 parent 455305b commit b8a46e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 6 additions & 1 deletion alignak/borg.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,16 @@
"""



class Borg(object): # pylint: disable=R0903
"""Borg class define a simple __shared_state class attribute.
__dict__ points to this value when calling __init__
TODO: Is this class really needed? Only subclassed by MacroSolver
This is used to make a Singleton-like pattern with a python object that inherits from the Borg.
The Singleton design pattern (DP) has a catchy name, but the wrong focus -- on identity
rather than on state. The Borg design pattern has all instances share state instead,
and Python makes it, literally, a snap.
"""
__shared_state = {}

Expand Down
1 change: 0 additions & 1 deletion alignak/macroresolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@

import re
import time
# import warnings

from alignak.borg import Borg

Expand Down

0 comments on commit b8a46e3

Please sign in to comment.