Adapter observations
some RL adapters may require much code 0 mixin classes are a great way to help adapt to rich protocols implement advanced methods on top of fundamental ones 0 Adapter occurs at all levels of complexity in Python, it's _not_ just about classes and their instances by a long shot - supplier code provides rich, complex functionality in protocol S owe need simplesubset C of S a facaedecode implements and supplies C bymeansof appropriate calls to S on
Facade vs Adapter
Adapter's about supplying a given protocol required by client-code 0 or, gain polymorphism via homogeneity 0 Facade is about simplifying a rich interface when just a subset is often needed 0 Facade most often fronts for many objects, Adapter for just one
What are classic SW DPs
0 not domain-specific architectures for entire subsystems 0 just descriptions of communicating objects and classes that are customized to solve a general design problem in a particular context Gof4 d scope sometimes class, mosty object 0 purpose general category describing what the pattern is about amp results, rationale, related DPs 0 DP are about description and helpful related suggestions , NOT prescription
KU of Decorator
gzip.GzipFile decorates a file with compress decompress functionality 0 threading.RLock decorates thread.Lock with reentrancy amp ownership functionality 0 codecs classes decorate a file with generic encoding and decoding functionality client code y needs to access an object t 0 however, something interferes w that amp t lives remotely, or in persisted form access restrictions may apply security amp lifetime or performance issues 0 proxy object tt sneaks in the middle 0 tt wraps t, may create...
Classic TM
abstract base class offers organizing method which calls hook methods amp in ABC, hook methods stay abstract 0 concrete subclasses implement the hooks 0 client code calls organizing method d on some reference to ABC injecter, or 0 which of course refers to a concrete SC class AbstractBase object def orgMethod self self.doThis self.doThat class Concrete AbstractBase def doThis self def doThat self 0 output each line, while tracking where you are on the page 0 just before the first line of each...


