SyliusImportExportPlugin icon indicating copy to clipboard operation
SyliusImportExportPlugin copied to clipboard

[RFC] Services organisation

Open pamil opened this issue 6 years ago • 2 comments

I'm working on adding importers/exporters for new models. With the current services definition organisation, it'd become a little bit messy quite fast.

Eg. for countries export/import, there are currently 9 services scattered over 7 files, including one which is 200 lines long.

Most of the time we are working on one model only, so it would make sense to group them together like:

  • src/Resources/config/services/country.yml: processors, plugin pools, plugins - basically those from services.yml connected to country model
  • src/Resources/config/services/country_json.yml: exporters and importers for country in JSON format
  • src/Resources/config/services/country_csv.yml and Resources/config/services/country_spreadsheet.yml: same as above

This way we can see straightly from the file structure which models are supported in which formats and it's much easier to look for services related to a certain model. In case there are too many files in services/ directory, we can then move the exporters/importers definitions in any format into a separate directory for that model.

pamil avatar Mar 25 '19 18:03 pamil

I think this is a good idea and should make things easier to understand.

mattagohni avatar Apr 01 '19 08:04 mattagohni

Hi @pamil, I face a simple but annoying issue with current organization: all services are up and running without any way - or I missed it? - to configure what importer / exporter you really need. In my case, I only want a custom exporter and needed to unregister the ones provided by the plugin. A better organization of services could ease the activation piece by piece of wanted functionalities. Say one want to export orders with no import feature, or import products with no import, that should be possible as we already do for routing stuff.

caillioux avatar May 05 '19 09:05 caillioux