[BangPypers] How to model these entities?

Abhaya Agarwal abhaya.agarwal at gmail.com
Wed Mar 25 14:32:42 CET 2015


I need to model four entities that share some attributes and behaviors and
also have some unique attributes and behaviors. I need to be able to refer
to them from other entities. And these entities are Singletons.

Ex: online marketplaces. They share common attributes like website, contact
person, commission rates which are best stored in DB. But they differ in
how you upload data to them - one of them supports FTP, other Dropbox -
best modeled as implementation of an interface. There may be unique data
associated with these behaviors. FTP credentials, Dropbox credentials.

Also a product may need to refer to these marketplaces (Ex: where all is it
going to be listed), so they need to be enumerable.

I have considered class hierarchy + a central registry + on disk config
files. But since this is a part of a larger Django project, implementing it
like this kind of sticks out and integrating it with admin etc requires lot
more work. What are the other options to model something like this? I feel
like I'm missing something obvious.

Thanks a lot!


blog: http://abhaga.blogspot.com
Twitter: http://twitter.com/abhaga

More information about the BangPypers mailing list