What is the proper name for this design pattern in Python?
- by James
In Python, is the proper name for the PersonXXX class below PersonProxy, PersonInterface, etc?
import rest
class PersonXXX(object):
def __init__(self,db_url):
self.resource = rest.Resource(db_url)
def create(self,person):
self.resource.post(person.data())
def get(self):
pass
def update(self):
pass
def delete(self):
pass
class Person(object):
def __init__(self,name, age):
self.name = name
self.age = age
def data(self):
return dict(name=self.name,age=self.age)