I have a backend service written in Kotlin. I need...
# announcements
s
I have a backend service written in Kotlin. I need to be able to mock out some functionality for the client-side application before starting development on some new stuff so they have something to work with. My plan is to just return a bunch of static mock data for every possible situation the data can find itself in. I am struggling with how best to house this data. The shape is rather complex so I have something like 7 files that mock out different parts of the data and then another file that aggregates that data together in the necessary combinations. Does it make the most sense to wrap this data in classes that just have public access to the variables? Or have classes that have public functions that just return this mock data? Or something else entirely?
d
If you think this mock implementation will be thrown out once the real implementation is in place, I’m not sure the architecture of the mock implementation matters very much. What you’ve described does seem reasonable as far as I’m able to tell, but I would need more details to have a stronger opinion.
s
I think it is a bit more permanent than that. It also mocks out some of the functionality for my particular microservice in a pretty large microservice mesh which is nice so that other developers don't have to bother with configuring my service or its other dependencies.
a