Hi Mike,
Thanks for the reply, basically I am trying to create a loan application system where by people can submit an application to the system to be processed. I am still new to Rest/HATEOAS, so forgive me for my silly questions or assumptions I might have.
The complex part of this, is the actual Application data required which includes the Loan Details, Applicants, Products, Address, Assets, Liabilities and the whole lot, plus a whole bunch of validation / business rules.
I am currently prototyping a conceptual model, and I do think HATEOAS/REST/Hypermedia is a valid fit for this scenario, which is why I am wrapping my head around it at the moment.
Maybe Collection+JSON is not the most appropriate format for me, am also looking at SIREN and HAL suggested by many others on the web.
I have read a couple of books, Building Hypermedia with Node js and HTML5 by yourself and also the REST in Practice book, which inspired me to try building a RESTFUL API for my scenario.
With all the restbucks examples in REST in Practice book, I see a lot of similarities to what I want to achieve. I am still getting my head around all these Media Types available, and looking at the documentation to find the most suitable one for my need.
What I have identified so far, I have a few states, New/Pending, Cancelled, ValidationError, Expired, Submitted, Success, and Rejected for a Loan Application System. I need to transfer a Model/Payload/DTO of a very complicated, deeply nested object hierarchy Per Application as described above, which I plan to document it in like a /docs url or something. As different lenders would have different rules for validation, I guess the root url will contain links to a list of lenders? But at some point, I need to do a submission based on that large payload, or how can I break them down?
I guess in terms of Hypermedia Design elements, would the template area in Collection+Json be considered an Ad-Hoc (In Message Hypermedia Control) State Transfer pattern? Which I guess I do not need? Maybe a Predefined (External Documentation) State Transfer pattern is more suitable in my scenario? I do want a Generic or Agnostic domain style, because of the varying data structure requirements for different lenders, which is why I find Collection+Json quite suitable? Application flow can be applied or intrinsic I am not fussed as there are only a limited set of states.
With regards to the extension, I am still fuzzy as to how to use it, but would it mean that all sub items is a resource in itself? Maybe I am doing it wrong, but I have a resource path of "Application" only, I do not have resources of say "Applicants/Address" etc... they are all part of Application, but they can be documented. As when applying for a loan, I need the whole chunk, there is no point in partial updates to certain path/parts of the model only. In the example,
"http://example.org/comments/1,2,3,4": { /* embedded collection+json */ }, which means the payload of the inline collection is of another resource?
So do you have any advice or mediatypes suggestions for me? Maybe I do not need to use the template part, so HAL is probably more suitable?
Thanks in advance.
Josh