xmlsquad / gsheet-to-xml

Given the url of a Google Sheet, this Symfony Console command fetches the Google Sheet and outputs it in the form of Xml.
Apache License 2.0
2 stars 1 forks source link

Ensure the XmlSerializer is moved into the domain and has an abstract interface. #24

Closed forikal-uk closed 6 years ago

forikal-uk commented 6 years ago

Goal

[See title]

Why

Currently this class implements a domain-specific knowledge yet is used within the Abstract Command.

See: https://github.com/xmlsquad/gsheet-to-xml/issues/21#issuecomment-401548989

How

forikal-uk commented 6 years ago

Restructure the code to allow domain to have services.

Let's move all model code into a folder called Domain and then add a folder for Services.

This will also allow us to have a folder for model related DataAccess classes such as DataMappers.

forikal-uk commented 6 years ago

I was temped to redefine the class as an Object-to-Xml Data Mapper (like an ORM Mapper but for Xml Database instead of Relational Database). However, the class does not save xml to the filesystem. So, it is not quite matching that pattern.

I will stick with the term Serialize for now. However, serialization is all about converting something for transport. Whilst xml is used to transport data, this might narrow our view of the possibilities for this tool. It is a minor point and I can live with it for now.

Actually I will put them into Model/Domain and create a place for the service in Model/Service