Best approach selection
Although, it is possible to implement a service using either approaches, each approach has some advantages and limitations when it comes to the capabilities.
- RESTful approach
- Advantages
- Less verbose & reads closer to the typical HTTP interaction
- Out of the box transport level error handling
- Out of the box support for retrial in case of temporary outages
- Out of the box support for proxied connectivity
- Out of the box support for future enhancements in Asset Picker in this regard
- Limitations
- Cannot be used for non-RESTful or non-HTTP integrations, such as database or file system interactions
- Advantages
- Functional approach
- Advantages
- Can be used for non-RESTful or non-HTTP integrations, such as database or file system interactions
- Limitations
- No out-of-the-box support available for transport level error handling, retrials, proxied connectivity, and any future enhancements from Asset Picker
- Incorporation of logic for all the missing out of the box supports can make functional service very verbose
- Advantages
You can see that the Function approach is well suited for non-RESTful or non-HTTP based integrations. Any service implemented using RESTful approach can also be implemented using Functional approach by taking care of all the necessary out-of-the-box capabilities provided by Asset Picker. While Functional approach gives flexibility in terms of implementation design, it takes away a few useful capabilities.