[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: Usage of BIND, REFERENCE-ONLY and BY-REFERENCE with ProDataSets & temp-tables

  • Thread starter Thread starter Jon Brock
  • Start date Start date
Status
Not open for further replies.
J

Jon Brock

Guest
We are using BIND for performance and to facilitate sharing and manipulation of temp-table default buffers. We create classes that implement the DAO pattern. However, rather than a class that encapsulates each business entity, the data is stored in a dataset or temp-table and the DAO classes wrap them. BIND functionality allows us to: 1. Access buffers statically, which allows for compile time checking and makes the code easier to read and maintain. 2. Treat the DAO classes as lightweight disposable objects since they don't entail temp-table initialization 3. Share the default buffer between the business procedure and the DAO class, which again makes the code easier to read and maintain To illustrate with code: oCustomerDao = new SomeDao(table ttCustomer bind). oCustomerDao:LoadById("blah"). ttCustomer.x = y. oCustomerDao:UpdateCustomer(). oCustomerDao:LoadAllModifiedSince(today - 7). for each ttCustomer: ttCustomer.x = y. oCustomerDao:UpdateCustomer(). end. One thing that would be a great enhancement (that actually has nothing to do directly with BIND, but just how we use it) would be to have static buffer access for before-tables. For instance it would be great to do: WritePreTransValidate(): define buffer bOldCustomer for ttCustomerBefore. bOldCustomer:find-by-rowid(buffer ttCustomer:before-rowid). if bOldCustomer.Email <> ttCustomer.Email then do: etc It would be even better if you could do: define before-buffer bOldCustomer for ttCustomer. And then bOldCustomer would always point to the appropriate before record for the current ttCustomer buffer.

Continue reading...
 
Status
Not open for further replies.
Back
Top