Today, some of the developers met to discuss our new context managers.
These objects are the interface for creating and using RepositoryVersion
and Publication objects and they are used by both core developers and
plugin writers. They described in detail in https://pulp.plan.io/issues/3285
and https://pulp.plan.io/issues/3295.

The subject of the meeting was inheritance vs composition and where the
business logic should live. The previous design created a facade layer, but
we settled on adding these features directly to the Django model. Since
most objects in our Plugin API are simple Django models, we are going
forward with the plan to do the same with RepositoryVersion and Publication
models.

What this means for plugin writers:
Plugins will use the RepositoryVersion and Publication Django models
directly. These models can be used as a context manager with Python's
`with` statement to safely create, finalize, and cleanup.
These models will also contain some business logic (for example  adding and
removing content), which writes to multiple database tables.

What needs to be done:
- Bihan will remove the facade object and move functionality onto the
model, and update the Plugin API
- I will update https://pulp.plan.io/issues/3295
_______________________________________________
Pulp-dev mailing list
Pulp-dev@redhat.com
https://www.redhat.com/mailman/listinfo/pulp-dev

Reply via email to