I'm building an application based on DDD and Hexagonal Architecture. Hexagonal architecture suggests that you shouldn't, let's say, pollute your domain with logic of elsewhere, your Domain layer should be "pure" and only containing your business logic.
But what if I have a valueobject where I want to generate an ID from an external library? UUID for example.
This is not contaminating my domain, but still, I'm importing a third party in my Domain layer and it's supposed to be placed in the Infrastructure layer.
However, do this every time I want to do this kind of things for time formats, converters... it can become kinda tedious.
Are there exceptions on third party imports in the Domain layer? If so, on what depends?
What you guys think?
Many thanks