• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Devaka Cooray
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Saloon Keepers:
  • Tim Holloway
Bartenders:

URI API Versioning with Kotlin/SpringBoot: How to version model, DTO, repository and service

 
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have been working with a Kotlin/SpringBoot and opted for the URI API Versioning approach. I am, however, very unsure on how to go about versioning model, DTO, repository and service classes. What is the best approach to follow. I give you an example from my controller:



As you can see, I have two @GetMapping with two versions of the service method getCustomers (V1 and V2). I also have a change in the model (one additional field), so I have created a new version of CustomerDto (v2). Is this the correct approach? Change in the model also required me to modify the Dto converter as well as the Repository. Is it good norm to have multiple versions of the repository considering that there has been a change in the model?
 
Marshal
Posts: 6209
501
IntelliJ IDE Python TypeScript Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would only consider applying a versioning strategy to the public API of your system as a courtesy to your users providing backwards compatibility. How you organise your code behind that API is entirely up to you so do whatever makes the most sense to you and the other maintainers of the code (if any).
 
Slideshow boring ... losing consciousness ... just gonna take a quick nap on this tiny ad ...
The new gardening playing cards kickstarter is now live!
https://www.kickstarter.com/projects/paulwheaton/garden-cards
reply
    Bookmark Topic Watch Topic
  • New Topic