Does a RESTful API in Caché remove the requirement to use a DLL and generate proxy classes for .NET web development?

Does developing a RESTful API in Caché remove the requirement to use the InterSystems.Data.CacheClient.dll and generate proxy classes using the Caché Object Binding Wizard for .NET web development? If anyone has links to sample applications using .NET with Caché and REST Services, I would be grateful if you could share them.

  • 0
  • 0
  • 204
  • 3
  • 1

Answers

very short:

.NET binding in Caché projects Caché Object classes to .NET with properties and methods
and services them with a private protocol. It is dependent on synchronized objects at both ends.

you may know this picture:

http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GBMP_intro

A RESTful API does something total different.

You define request (for data or actions)  and sent the request to Caché.
And you get it back preferred in JSON style expressed.
Your requests are straight HTTP with someWebServer in between on your way to Caché.

SOAP does something similar. But it has an incredible overhead of XML.
And as with .NET binding you need predefined data structures to be serviced.

In extrem:  With REST you just get back a string / stream and it is up to you to decide what this means:
No predefinded structures. It is all your task to organize yourself.
For .NET end I found this link:
https://docs.microsoft.com/en-us/aspnet/web-api/overview/advanced/calling-a-web-api-from-a-net-client
 

For Caché side there are lots of useful articles in the forum already and examples in SAMPLES.

Simple summary:

For RESTapi you will not need 
InterSystems.Data.CacheClient.dll nor generated proxy classes using the Caché Object Binding Wizard for .NET
You are the owner of the exchanged data structures.
 

Comments

Do you want to access data stored in Caché from .Net via REST API?

Yes @Eduard Lebedyuk, that is correct. I am thinking of a MVC Core .NET web application that consumes a RESTful API in Caché Objectscript. Thanks @Robert Cemper for your post.