What can CF10 RESTful API do that Coldbox RESTful API cannot do? And vise versa?
Asked Answered
Z

3

4

Just started looking at some MVC JS framework / library and most of them expect a RESTful API endpoint, which got me thinking... what can I do using CF10 that cannot be done using CF9 + ColdBox RESTful support, and vise versa?

Thank you.

Zest answered 23/5, 2012 at 0:19 Comment(0)
S
7

Restful webservices is a standard concept and all the implementation eventually adhere to those norms. There are already existing frameworks like Taffy, Powernap and frameworks like ColdBox 3, Mach II which can help create restful services in ColdFusion. And I they do a terrific job in terms of completeness and empowerment offered to the users. The difference much lies in the way they enable it, how do they let you create your services. Some follow convention others configuration with their own DSL etc and somewhat in terms of features they offer.

ColdFusion 10 has native restful webservices support. What it brings to the table is:

  1. You can use your own understanding of components and extend them as restful webservices
  2. Based on standard JAX-RS
    • Tons of support/ applications available for extending (testing/automation)....
    • No implementation biasness, widely available/acceptable
  3. Better performance
  4. Better support and doc
  5. Less configuration
  6. Application WADL implmented (WSDL like)
  7. Full JSON/XML support and easily extensible

As you will see most of these are benefits of having it "natively" available to the language rather than a vis a vis comparison of features and that is why we have implemented it. IMO there isn't any comparison at all. I would like to see all frameworks take the advantage of natively available feature and build on top of it.

Thumb rule should be pre CF10 use any one which suits your taste, usecase/ post CF10 release use natively available or any framework which utilizes the same.

Word of caution: Every framework author would be biased towards their own so judge before you take the leap.

p.s. I have implemented Rest support in ColdFusion10 :)

Sniffy answered 23/5, 2012 at 8:55 Comment(3)
That should go in the wiki - great answer!Rieth
what is Application WADL? Thank youZest
@Zest WADL is short for Web Application Description Language. You can view all resources in any application using Application.wadl. Also GETing OPTIONS on any endpoint would return all the operations/methods available. Very much similar to service discovery with WSDLSniffy
S
0

As rest cfc would generally just be a wrapper for your model, and if your model was already created with a cf framework like coldbox, you may be better of using the frameworks implementation of a ReSTful webservice .

If you are starting off from scratch, the newly added functionality in CF10 ( and Railo 4) will give you the infrastructure without the overhead of the application framework.

Submersible answered 26/5, 2012 at 13:53 Comment(0)
Z
0

Excellent resource: https://github.com/atuttle/CF-REST-Comparison/tree/master/CF10

Requirements / Quirks

  • All remote methods must have returnType="..." specified (where ... is the type that will be returned).
  • Don't forget restArgSource for <cfargument/> tags for URI-token arguments. The default value for restArgSource is body, which will not work if you're trying to get a value from the URI.
  • Application-specific mappings are not supported. Use server-mappings or the fully-qualified cfc path instead.
  • Whenever refreshing services, I always follow this workflow: Delete "exception.log" from the log files screen Refresh REST services Check to see if "exception.log" is back. (If so, read it and address the problem.)
Zest answered 10/6, 2014 at 1:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.