We have split our application so that package A handles data from one external source and package B from another. In both cases we need to create a domain object and have a "Transformer" to do this.
So I have com.foo.bar.a.ThingTransformer
and com.foo.bar.b.ThingTransformer
I suspect that this is poor practice, but want to see what the good people of SO think.
I wouldn't go as far as saying that it's always a bad practice, but it's somewhat of a code smell.
If both classes do different things, then why don't they have different names?
if both classes do the same thing, then why are there two classes?
From a practical standpoint it can become very annoying if those two classes ever need to be referenced in the same class: you'll have to use the FQN for one of those (it would probably be best to use it for both in this case, for clarity). If those two classes are in sufficiently distinct parts of the code that they won't be referenced from the same code, then the practical problem is not so bad.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With