I think a base class with subclasses is the best approach. Define as much common behavior as possible, set up defaults for those fields needed by your outbound API
How are you handling the branching lookup of what subclass to use? You might name the subclasses in some way that they can be derived from the partner URL - or some other way that intelligently selects the subclass for you I assume you've looked at django-piston -Preston On Oct 24, 7:43 am, Jason Beaudoin <jasonbeaud...@gmail.com> wrote: > Anyone else have thoughts on this, with respect to design > considerations, implementing in python versus using some of django's > tools.. ? > > > > On Fri, Oct 23, 2009 at 8:22 AM, Jason Beaudoin <jasonbeaud...@gmail.com> > wrote: > > 2009/10/23 kmike <kmik...@googlemail.com>: > > >> Maybe you don't have enough information to make an abstraction right > >> now. If so I suggest to actually implement several API's in a dumb > >> way. After that it'll be clear what are the differences and what are > >> the common parts so making a good abstraction will be easier. > > > I've implemented each of the APIs enough (standalone) to know a lot of > > the differences. Where I'm struggling is envisioning the proper > > abstraction and implementation with python / django code to tie it all > > together. > > > My current idea is to setup a Request class, then create specific > > subclasses of this, overriding the default methods, writing conversion > > methods, and defining additional fields. But "seeing" the python code > > around this has yet to come. > > > As I've never really implemented this type of abstraction (and I > > imagine others have), I'm really interested in what has been done / > > known solutions to the general problem / do I have the right idea / > > any source folks can suggest / etc.. > > > Thanks for taking the time to read about my situation! > > > ~Jason --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---