Hello,
On the latest release we got new module type "Library", and after reading it's documentation I still confused about how it's differ from "Service" in terms of
Like when I should put my action in Library or Service, or when I should consume a REST API in Library or Service.
Thanks in advance.
Hi Kevin, according to the 4 layer canvas, you'll need identify the business concept. It means, you cannot think like:
- OK! it is a action client, so it should be in "End User Layer" for exemple.
The module Library is only available on React Applications Type and not on Tradicional Web Applications.You can create in Library things like WebBlocks (front-end components), Client and Server Actions and this kind of module still keep the same context and transactions. It must have contain generic and reusable actions.
A Service module cannot contain client actions, webblocks or even screens. This type of module provide a loosely coupled when you reference service actions.
With this definitions, I could say:When you are creating several components, webblocks, client actions even some kind of server actions but depends on your business concept and these component can be shared by a majority of others applications. I would put it in Library.
If you are integrating with a external systems or you need to have a loosely coupled. I would use Service module. and here it's necessary to have attention when you use Service Actions. It's because Service Actions Transactions have a different transaction and context.
Hope it be useful, and I know that is can be confuse but you need thinking about business concept.
Best Regards, Paulo Fagundes Jr.
Thanks Paulo! I really appreciate your explanation!
I was having the same doubt of when to use effectively a consumed integration in a Service vs Library module. Most of the time I was always use consumed integration in Service modules to promote loosely-coopled dependencies.
May you give me an example of when it is useful to develop a consumed integration in a Service module?
Best regards,