Python设计模式(10)-模板模式


class DbManager:
def insert(self):
pass

def dele(self):
pass



class DbManager:
def insert(self):
pass

def dele(self):
pass


class MSSQLMgr(DbManager):
def insert(self):
print "插入MSSQL"

def dele(self):
print "删除MSSQL"


class MySQLMgr(DbManager):
def insert(self):
print "插入MySQL"

def dele(self):
print "删除MySQL"


if __name__ == "__main__":
msqslMgr = MSSQLMgr()
mysqlMgr = MySQLMgr()
msqslMgr.insert()
mysqlMgr.insert()
posted @ 2016-03-15 21:34  逆风飞行  阅读(272)  评论(0编辑  收藏  举报