Hey all - beginner here: What’s the best way to de...
# exposed
m
Hey all - beginner here: What’s the best way to decouple the DAO API from my app? It looks like the DAO API is both an entity and a DAO so I was wondering what the best way to go about this was. I could just resort to using the DSL API and have my own DAO object and Entity, but was hoping to avoid the boilerplate of mapping table properties to that entity. Thanks!
p
I would add a repository between Exposed DAO and the business services, to not mix business logic with Exposed specific functionality. This layer I use for mapping DAO entity to domain object and also doing transaction handling.
m
I see so you do a bit of mapping from the exposed DAO API to your custom domain object. Do you find that easier than using the DSL API and doing the same mapping?
p
It's not saving too much. Just a few query methods which DAO offers
m
Got it thanks, makes sense!