atomize = KIS = SOC = smart !

Was writing a CList class and was gently reminded of some principles of programming.

  • atomize = KIS = SOC = smart !
  • atomize : for procs the less the better.
  • KIS : keep-it-simple.
  • SOC : seperation-of-concern : this proc is for this, that one for that.
  • smart! : a wise thing to do ; that will pay off ; rather sooner ; and surely later.

/*
Atomize = KIS = Seperation of concern = smart !
@IMPORTANT ! Strictly maintain:
- 1) Callformat: {keyword:xx, data:xx}
Use:
//eg: {"keyword":"ReqSetListFilter","data":{"filters":[{"dbfd":"groupNr","xval":"20"}]}}
//eg: {"keyword":"ReqGetListRecNr","data":{"recNr":1}}
Do not use:
//eg: {"keyword":"ReqSetListFilter","filters":[{"dbfd":"groupNr","xval":"10"}]}
//eg: {"keyword":"ReqGetListRecNr","recNr":0}
- 2) Do not return anything if not specifically a fGetXX call. eg: do not return recs on fEdit etc. Only return true, or false if something went wrong.
Except maybe some feedback info eg on fDoBulkUpdate(data.data) return ~nTouched. No, not even then. Use fGetListCount > fDoBulkUpdate > fGetListCount
*/

In the end you’ll end up with a nice CList class that, as by accident, quite easily handles filters (arrOriIdxs =[]) (flyweight pattern ?) and bulk updates.

Gotto run…