Follow-up from "Add email, phone and previous operator dynamic fields to mobile ticket"
The following discussion from !39 (merged) should be addressed:
-
@sauloperez started a discussion: IMO this name is unnecessarily coupled with its implementation. If that changes in the future (it fetches the companies from an API, for instance) we risk the next dev taking false assumptions and having a hard time. I'd prefer to use an abstract name that is not tied to that and let the consumer simply use a nice public interface. Isn't that the whole point of OOP?
To me, this is simply a
TelecomCompany
value object and instead of passing aPepePhone
string around, we pass aTelecomCompany
instance. I bet we'll need to implement thestr()
for things to keep working, as usual with value objects.more literature on the topic: http://wiki.c2.com/?ValueObject
and one of the first posts I read about it: https://codeclimate.com/blog/7-ways-to-decompose-fat-activerecord-models/
Also
-
@sauloperez started a discussion: remember adjectives go before the noun in English. So this should have been MappingTelecomCompaniesService instead FYI.
We must define a TelecomCompany value object to manage the TelecomCompany entities between the ERP and OTRS.
We need to play with __str__
and __repr__
to obtain the expected behaviour.
This object will be used as a string in other places.