removed proxy, bridge, template, and strategy patterns as they were too abstract to offer much use.

This commit is contained in:
tylerlaberge
2016-08-28 20:32:45 -04:00
parent 7501604bbf
commit 6ce017a391
8 changed files with 0 additions and 385 deletions
-17
View File
@@ -1,17 +0,0 @@
from abc import ABCMeta
class Bridge(object, metaclass=ABCMeta):
"""
Base Bridge class as part of the Bridge design pattern.
External Bridge Pattern documentation: U{https://en.wikipedia.org/wiki/Bridge_pattern}
"""
def __init__(self, implementor):
"""
Initialize a new Bridge instance.
@param implementor: The implementor that concrete classes should call upon to do some action.
"""
self.implementor = implementor
-30
View File
@@ -1,30 +0,0 @@
from abc import ABCMeta
class Proxy(object, metaclass=ABCMeta):
"""
Base Proxy class as part of the Proxy design pattern.
External Proxy Pattern documentation: U{https://en.wikipedia.org/wiki/Proxy_pattern}
"""
def __init__(self, subject):
"""
Initialize a new proxy instance.
@param subject: The real subject this proxy calls upon.
"""
self._subject = subject
self._validate()
def _validate(self):
"""
Validate that the subject and this proxy follow the same interface.
@raise AttributeError: If the subject and this proxy do not follow the same interface.
"""
for attr in dir(self._subject):
if attr.startswith('_') or attr.startswith('__'):
continue
elif not callable(getattr(self._subject, attr, None)) or not callable(getattr(self, attr, None)):
raise AttributeError('Subject and Proxy must follow same interface')