Skip to main content
3 votes

Is it good practice to return ApiResponse from a Spring service layer?

Let me change your question a little bit, as it could be general instead of Spring based. Is it good practice to return an API Response from a service layer? There is going to be multiple comments ...
captncrunch's user avatar
2 votes

Are there any good and modern approaches, to have variables that feel global (no need to pass them around explicitly), yet are local to an instance?

As the experts in this community point out, the solution is obvious: use OOP, enclose the state in objects and live a happy life: import {F} from './f'; ... // myLibrary/index.ts export class ...
Blue Nebula's user avatar
1 vote

Is it good practice to return ApiResponse from a Spring service layer?

To be short, the answer is clearly no, but I will use many approach to argument this answer: programmatic and pragmatic approach: You are using Spring ApiResponse, and what if you use @Controller ...
pdem's user avatar
  • 235
1 vote

Is it good practice to return ApiResponse from a Spring service layer?

Is it good practice to return ApiResponse from a Spring service layer? David Parnas proposed about modularization, and in particular the benefits of choosing your module boundaries so that the ...
VoiceOfUnreason's user avatar
1 vote

why would one use the "Functional Options" pattern in go?

The primary advantages are that It's a very clean constructor signature type optfunc func(*MyObject) func NewMyObject(opts ...optfunc) *MyObject {...} It's infinitely scalable. You can pass in as ...
Jeremy French's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible