akeneo/pim-community-dev — pull request #1754 by nidup (2014-11-08 15:02:14+00:00)
Title: [POC] Experiments around managers normalization

Today, our managers have heterogeneous API but provide very similar operations (save, remove), sometimes with different naming, save vs update, remove vs delete.

This PR is an attempt of standardization by introducing 4 interfaces, UpdaterInterface, BulkUpdaterInterface, RemoverInterface, BulkRemoverInterface.

With following immediate benefits,
- a better developer experience, easier to know how to use more homegeneous managers
- a centralization of persist / flush logic (for instance, with this change, the AttributeManager wraps this concern, no more persist / flush of attribute and options in controllers and form handler but still the possibility to do so)
- be able to use different managers in same way if they implement a common interface (for instance, have a mass delete for different grids)

Expected mid-term benefit is also to ease the introduction of new business events (to plug custom code in projects) on single update (update a product, disable a product, publish it) or bulk update in a future version (could be 1.3).

Why many interfaces ?
- don't want introduce a kinda CRUD
- we implement what we need for real in the business managers, not more

Why a component for these interfaces ?
- not symfony or doctrine related
- not business related
- used by many bundles (catalog, enrich, comment, etc)
- would avoid bundle coupling on so basic interfaces

| Q | A
| -------------------- | ---
| Bug fix? |
| New feature? |
| BC breaks? |
| CI currently passes? |
| Tests pass? |
| Scenarios pass? |
| Checkstyle issues?* |
| PMD issues?** |
| Changelog updated? |
| Fixed tickets |
| DB schema updated? |
| Migration script? |
| Doc PR |