Hello to all. I have a question regarding external...
# android-architecture
k
Hello to all. I have a question regarding external services and domain layer. I am developing an application where I am using Google Places SDK and the Autocompletetion Fragment where the user can call the API to get a Place. The Place contains among other properties an
ID
and
Name
. I am also storing a Place Entity with Room in SQLite. After that a user of the App can select a Place from a list and display some details about it. To do that I call Google Places API again to fetch Places Detail with the
ID
of the Place selected. I have build the app around the clean architecture approach but I did not find yet a way to handle external ( Google Place) IDs. I don't want to put them in my domain model but I cannot figure out a way to skip that. How do you handle such cases?
e
As I see it, from a DDD perspective, Google Places belongs to another bounded context, and in this case it’s completely valid to use their ID as a Value Object, nothing to worry about.
as a reference, here is a snippet, describing a very similar use-case as yours, from Implementing Domain-Driven Design, a book which I totally recommend if you are trying to implement a true Clean Architecture
k
Ok thanks I will check it out
The problem is I can't figure out how to add that to my UseCases etc without coupling them to Google Places specific IDs
n
@Eduard Boloș I have a doubt here, If I have created an interface for repository in domain module (Pure java module). But my methods return LiveDataT Then what can I do? Can you please suggest me to figure out domain modeling.