RaspberryPi-Samples / py-my-key

Access control with RaspberryPi and NFC card reader
ISC License
1 stars 1 forks source link

Factories for Reader and Hardware #4

Closed scls19fr closed 8 years ago

scls19fr commented 8 years ago

Hi,

Factory pattern is necessary for Reader and Hardware. It will be possible to use an other kind of NFC reader and hardware (RaspberryPi, BeagleBone Black...) Moreover it will be possible to use a FakeBoard a fake NFC reader for unit tests.

See factory pattern: https://en.wikipedia.org/wiki/Factory_method_pattern

This gist implements such features:

https://gist.github.com/scls19fr/6fba064b025c774e0ce5

Kind regards

lwalter86 commented 8 years ago

Factory, BaseReader and ReaderFactory done https://github.com/RaspberryPi-Samples/py-my-key/commit/548cf5789b09eb533b6b5f34c86cf96b19ef170b

BaseHardware, HardwareFactory: ToDo