Hi,

This is regarding the implementation of APIs on API Manager v3.0 using a
Design First Approach. The API Publisher Portal of API Manager will have
the UI constructs required to design the interface of the API including the
resource paths, verbs, base paths, etc. This version of API Manager uses
Ballerina as its API implementation language. When it comes to implementing
the API logic, our plan was to allow users to edit the full Ballerina
source of the corresponding API. The sequence of actions in performing this
operation would be as follows.

1. User creates API definition (interface) using UI.
2. Server code gens the Ballerina source corresponding to the above
definition.
3. User edits the Ballerina source of the corresponding resources.

Since this leads to a situation where the user edits an auto generated code
and re-auto generation leads to complications related to merging auto
generated code with user written code, this has led to rethinking how to
want to enable implementation of APIs from the API publisher.

An alternative approach is to let the user implement Ballerina functions
offline and upload them to the API Manager. These functions should be
written according to a function template (signature). They can then be
linked to a particular resource. A function each can be linked for
processing the request and for processing the response. This is similar to
the model that we have today of uploading sequences for a given API, but
more powerful in terms of capability due to how the Gateway engine behaves
(Synapse vs Ballerina). This way a user does not edit auto generated code.
The code gen process would link the auto generated code with the user
uploaded code and create a consolidated Ballerina source to be deployed on
the Gateways.

Another advantage here is that this model does not require us to have a web
based Ballerina editor. Users defining functions could use any editor
supported by Ballerina offline.

I am opening up this idea for thoughts and suggestions.

Thanks,
NuwanD.

-- 
Nuwan Dias

Director - WSO2, Inc. http://wso2.com
email : [email protected]
Phone : +94 777 775 729
_______________________________________________
Architecture mailing list
[email protected]
https://mail.wso2.org/cgi-bin/mailman/listinfo/architecture

Reply via email to