Skip to content

Questions about API parsing methods in Service Layer + Passing down newly instantiated SObjects to Domain layer #408

Answered by ImJohnMDaniel
ghost asked this question in Q&A
Discussion options

You must be logged in to vote

G'day Jens

Why is this method in the Service layer and how is it reusable in its current form? I can not think of any other caller of this method, then a (single) resource class, cause it is written for a very specific use case in my view.

  • This method involves some level of business logic and/or DML. With those two criteria alone, this functionality would belong in the Service layer. In general, you want to avoid either of these two in controllers, REST APIs, webservices, invocable methods, or any other "service tier client".
  • While the service method in this instance may only be called from one place, it is still reusable because there is always a chance that another service tier clien…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ImJohnMDaniel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant