<div dir="ltr"><div>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 <a href="https://pulp.plan.io/issues/3285">https://pulp.plan.io/issues/3285</a> and <a href="https://pulp.plan.io/issues/3295">https://pulp.plan.io/issues/3295</a>.</div><div><br></div><div>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.</div><div><br></div><div>What this means for plugin writers:</div><div>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.</div><div>These models will also contain some business logic (for example  adding and removing content), which writes to multiple database tables.</div><div><br></div><div>What needs to be done:</div><div>- Bihan will remove the facade object and move functionality onto the model, and update the Plugin API</div><div>- I will update <a href="https://pulp.plan.io/issues/3295">https://pulp.plan.io/issues/3295</a></div></div>