Hi guys,
The legacy database I'm "springwrapping" has Id's that are Strings and that give away some information. For instance, a UserId looks like "DK-6715-00001", meaning a user in Denmark, postal code 6715. This is so wrapped into the enterprise applications that it needs to be kept and my entities verify this in their setter methods.
But, User also has the fields country and postal code, so when an Id for the bean is set, it might as well also set country and postal code. For this, it needs the CountryService to look up that Dk is the Denmark Country object, and look up 6715 with the newly found Country object in PostalService.
First of all, can I wire this up so that I can access CountryService and PostalService from my Entity object? (Entities are defined long before the service objects in my bean definition) Second of all, this should violate any nice design principles. Is there a better design I could do then to let my entities carry references to service beans?
Cheers
Nik