What is the proper name for this design pattern in Python?
Posted
by
James
on Programmers
See other posts from Programmers
or by James
Published on 2011-06-28T20:07:08Z
Indexed on
2011/06/29
0:31 UTC
Read the original article
Hit count: 316
python
|design-patterns
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)
© Programmers or respective owner