Skip to content

Conversation

@mickp
Copy link
Collaborator

@mickp mickp commented Dec 6, 2019

Managing different types of Settings may be achieved more flexibly and simply through the use of subclasses of Setting and the use of a factory pattern or helper method for their creation.

  • Added TODO
  • Replaced direct instantiation of Settings with creation through method.

Managing different types of Settings may be achieved more flexibly
and simply through the use of subclasses of Setting and the use of
a factory pattern or helper method for their creation.

* Added TODO
* Replaced direct instantiation of Settings with creation through method.
carandraug pushed a commit that referenced this pull request Dec 17, 2019
#125)

Managing different types of Settings may be achieved more flexibly
and simply through the use of subclasses of Setting and the use of a
factory pattern or helper method for their creation.  So make the
`Setting` class and the `Device.settings` attribute private so that
the `Device` methods become the only sactioned method to get to them.

* microscope/cameras/atmcd.py: use the `*_setting` methods instead of
  manipulating `self.settings` directly.
* microscope/devices.py: mark `Setting` class and `Device.settings`
  attribute as private.
* microscope/testsuite/test_setting.py: Setting class is now _Setting.
* NEWS: make note of backwards incompatible change.
@carandraug
Copy link
Collaborator

Pushed after also making the Device.settings attribute private. This effectively makes the Device.*_setting methods the only sanctioned methods to manipulate settings which should give us all flexibility to make changes how settings work internally.

@carandraug carandraug closed this Dec 17, 2019
@mickp mickp deleted the refactorSettings branch December 19, 2019 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants