#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# adapter_pattern.py
# 适配器模式
class Adaptee:
def request(self):
print('打印开始!!!')
class Target:
def handleRequest(self):
pass
class Adapter(Target):
def __init__(self):
self.adaptee = Adaptee()
def handleRequest(self):
self.adaptee.request()
def main():
a = Adapter()
a.handleRequest()
if __name__ == "__main__":
main()