0

I am using Peewee as ORM provider and my BaseModel subclasses correspond to normalized database tables. These names will be part of my data access layer (DAL) API. Then we will want to define the higher level data model which will have probably extra information, containment and more functionality than the ORM pure "value objects".

For example, I have a portfolio table with the corresponding ORM Portfolio BaseModel sub-class. The class will contain a few attributes that map to the database table and will serve the purpose of the few CRUD use-cases. At the service application layer (SAL) API I need to work a bit higher level and will define again a Portfolio class but with a beefier design, will have containment and a bunch of useful methods and hence a name clash.

How would you in Python best avoid name clashes between the DAL and the SAL? renaming the class during import? or using a naming convention? any references?

SkyWalker
  • 13,729
  • 18
  • 91
  • 187

0 Answers0