on 04-10-2015 1:08 PM
I have been using Hana's server side javascript XSJS for a while. Me primarily coming from a javascript background, i try to write quite efficient, modularized code in javascript. For that the solid & proven way is to follow some of the javascript design patterns. (Learning JavaScript Design Patterns)
Ex-
But with xsjs, surprisingly i haven't found anyone implementing those in their project's code or in the code samples. With xsjslib there comes an option for reusability, but i still find many of the approaches there is to simply create everything as functions.
As i'm trying to follow these pattern on my xsjs/xsjslib code, i would like to get few tips from the experts out here to know whether this is the best way to write a efficient,maintainable,reusable code or is this kind off overhead with xsjs. I sometimes wonder is this just because of developers in SAP ecosystem usually aren't from javascript background and don't really make the best use of javascript !
-Sakthivel
Remember that XSJS should be a lightweight pass-through layer. May times you just are creating a service endpoint where the bulk of the logic is in turn implemented within the database itself. This should be the primary design pattern overall. Following this pattern should leave you with relatively little JavaScript code itself which often falls nicely into simply small functions.
We did teach a Code Review session last year at TechEd on some more advanced JavaScript techniques. We use some of those patterns in our own larger XSJS libraries. However really I would encourage customers/partners to first look at putting most of their logic in the database itself and then trying leverage that logic via libraries like XSDS.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That sounds fine - all business logic in the database. This may be good for having one place where all logic is defined and for performance reasons.
What can you say about the arguments that have been raised frequently against having all business logic in stored procedures?
Some of the following good practices/ patterns cannot be easily implemented in stored procedures.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.